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

Update usage of GET /groups/{group_id}/files/{file_name}/- json/xml #6385

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Removed embedded discover [#6120](https:/wazuh/wazuh-dashboard-plugins/pull/6120) [#6235](https:/wazuh/wazuh-dashboard-plugins/pull/6235) [#6254](https:/wazuh/wazuh-dashboard-plugins/pull/6254) [#6285](https:/wazuh/wazuh-dashboard-plugins/pull/6285) [#6288](https:/wazuh/wazuh-dashboard-plugins/pull/6288) [#6290](https:/wazuh/wazuh-dashboard-plugins/pull/6290) [#6289](https:/wazuh/wazuh-dashboard-plugins/pull/6289) [#6286](https:/wazuh/wazuh-dashboard-plugins/pull/6286) [#6275](https:/wazuh/wazuh-dashboard-plugins/pull/6275) [#6287](https:/wazuh/wazuh-dashboard-plugins/pull/6287) [#6297](https:/wazuh/wazuh-dashboard-plugins/pull/6297) [#6287](https:/wazuh/wazuh-dashboard-plugins/pull/6287) [#6291](https:/wazuh/wazuh-dashboard-plugins/pull/6287)
- Develop logic of a new index for the fim module [#6227](https:/wazuh/wazuh-dashboard-plugins/pull/6227)
- Allow editing groups for an agent from Endpoints Summary [#6250](https:/wazuh/wazuh-dashboard-plugins/pull/6250)
- Changed the usage of the endpoint GET /groups/{group_id}/files/{file_name} [#6385](https:/wazuh/wazuh-dashboard-plugins/pull/6385)

### Fixed

Expand Down
10 changes: 10 additions & 0 deletions docker/imposter/agents/group_files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var raw_param = context.request.queryParams;

switch (raw_param.raw) {
case 'true':
respond().withStatusCode(200).withFile('agents/group_files_raw.xml');
break;
default:
respond().withStatusCode(200).withFile('agents/group_files_default.json');
break;
}
27 changes: 27 additions & 0 deletions docker/imposter/agents/group_files_default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"data": {
"vars": "None",
"controls": [
{
"name": "CIS - Testing against the CIS Debian Linux Benchmark v1.",
"cis": [],
"pci": [],
"condition": "all required",
"reference": "CIS_Debian_Benchmark_v1.0pdf",
"checks": [
"f:/etc/debian_version;",
"f:/proc/sys/kernel/ostype -> Linux;"
]
},
{
"name": "CIS - Debian Linux - 1.4 - Robust partition scheme - /tmp is not on its own partition",
"cis": [],
"pci": [],
"condition": "any",
"reference": "https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf",
"checks": ["f:/etc/fstab -> !r:/tmp;"]
}
]
},
"error": 0
}
3 changes: 3 additions & 0 deletions docker/imposter/agents/group_files_raw.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<agent_config>
<!-- Shared agent configuration here -->
</agent_config>
4 changes: 2 additions & 2 deletions docker/imposter/security/security-actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
"GET /groups/{group_id}/agents",
"GET /groups/{group_id}/configuration",
"GET /groups/{group_id}/files",
"GET /groups/{group_id}/files/{file_name}/json",
"GET /groups/{group_id}/files/{file_name}/xml",
"GET /groups/{group_id}/files/{file_name}",
"GET /groups/{group_id}/files/{file_name}?raw=true",
"GET /overview/agents"
]
},
Expand Down
9 changes: 4 additions & 5 deletions docker/imposter/wazuh-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,10 @@ resources:

# Get a file in group
- method: GET
path: /groups/{group_id}/files/{file_name}/json

# Get a file in group
- method: GET
path: /groups/{group_id}/files/{file_name}/xml
path: /groups/{group_id}/files/{file_name}
response:
statusCode: 200
scriptFile: agents/group_files.js

# ===================================================== #
# LISTS
Expand Down
Loading