Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get agent configuration from API #72

Merged
merged 21 commits into from
Sep 21, 2018
Merged

Get agent configuration from API #72

merged 21 commits into from
Sep 21, 2018

Conversation

albertomn86
Copy link
Contributor

@albertomn86 albertomn86 commented Apr 18, 2018

This pull request add the capability to get the agent configuration using the API.

wazuh/wazuh#548

Copy link
Contributor

@mgmacias95 mgmacias95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested in the comment bellow 😉 .

logger.debug(req.connection.remoteAddress + " GET /agents/:agent_id/config/:component/:configuration");

var data_request = {'function': '/agents/:agent_id/config/:component/:configuration', 'arguments': {}};
var filters = {'agent_id': 'names', 'component': 'names', 'configuration': 'names'};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The agent_id must be filtered as numbers, not as names.

if (!filter.check(req.params, {'agent_id':'numbers'}, req, res)) // Filter with error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!
1f663f4

@albertomn86 albertomn86 changed the base branch from master to 3.6 August 16, 2018 10:52
@jesuslinares jesuslinares changed the base branch from 3.6 to 3.7 September 10, 2018 09:03
Copy link
Contributor

@mgmacias95 mgmacias95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any necessary extra steps to execute these new steps? (Adding extra configuration/agents?). Please, update this https://github.com/wazuh/wazuh-api/blob/master/test/README.md.

@@ -196,6 +196,8 @@ def usage():
'PUT/agents/:agent_id/upgrade_custom': Agent.upgrade_agent_custom,
'/agents/:agent_id/upgrade_result': Agent.get_upgrade_result,

# Read remote configuration
'/agents/:agent_id/config/:component/:configuration': Agent.get_config,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When merging to 3.7 there will be a conflict with Distributed API. Now API calls are defined here: https://github.com/wazuh/wazuh/blob/3.7/framework/wazuh/cluster/dapi/requests_list.py. This call should be distributed_master.

@jesuslinares jesuslinares merged commit 8c222cf into 3.7 Sep 21, 2018
@jesuslinares jesuslinares deleted the dev-query-config branch September 21, 2018 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants