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

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
11 changes: 7 additions & 4 deletions docker/imposter/wazuh-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,16 @@ resources:
- method: GET
path: /groups/{group_id}/files

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

Choose a reason for hiding this comment

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

If this is not used I think we should remove it to avoid polluting the file.

# - method: GET
# path: /groups/{group_id}/files/{file_name}

# 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
Loading