-
Notifications
You must be signed in to change notification settings - Fork 59
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
Conversation
d349d02
to
ac852a5
Compare
There was a problem hiding this 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 😉 .
controllers/agents.js
Outdated
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'}; |
There was a problem hiding this comment.
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
.
wazuh-api/controllers/agents.js
Line 508 in 03cccb3
if (!filter.check(req.params, {'agent_id':'numbers'}, req, res)) // Filter with error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
1f663f4
ac852a5
to
46db7a5
Compare
1f663f4
to
322b5d1
Compare
322b5d1
to
0bf9999
Compare
…into dev-query-config
There was a problem hiding this 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.
models/wazuh-api.py
Outdated
@@ -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, |
There was a problem hiding this comment.
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
.
This pull request add the capability to get the agent configuration using the API.
wazuh/wazuh#548