Repository navigation
feat(adapters): read-only Wazuh adapter - #1461
Conversation
Fifteen GET-only tools on the Wazuh 4.x server API (port 55000): manager info and status, agents and their summaries, rules, rule groups, decoders, SCA policies and checks, and FIM (syscheck) data. LOGIN_TOKEN signs in at /security/user/authenticate with loginBasicAuth (HTTP Basic on the login request only), reads data.token and sends it as Bearer; errorWhen turns failed_items 1701 into a not-found. Alerts and vulnerabilities (indexer) are out of scope. The live spec now signs in through the real LoginTokenService and checks that a wrong password fails with 401 without echoing the credentials. Updates the catalog, adapter counts and llms.txt.
fce674b to
a5f2df8
Compare
|
Sorry for the slow reply, @helpcodeai, and thanks for fixing the generated docs on #1460. I've rebased this onto |
helpcodeai
left a comment
There was a problem hiding this comment.
Thanks for the rebase, @GallaGit. The PR is clean now: only the Wazuh adapter, the generated counts and the spec. I read the whole adapter. It is careful work: read-only GETs, a dedicated readonly API user, the password marked secret, and good hints for 401, 403 and 404.
Two things before we can merge:
1. Encode the path parameters. Four tools put a model-supplied value into the path: wazuh_list_sca_policies, wazuh_list_sca_checks, wazuh_list_syscheck_files and wazuh_get_syscheck_last_scan. The engine does not enforce the pattern on string parameters, so ^\d{3,}$ on agent_id is only a hint, and policy_id has no pattern at all. A value like ../../security/users would then reach another endpoint of the API. Please add "encodePathParams": true to the endpointMapping of these four tools (see intl/podio.json for an example), and a short assertion in the spec that every tool with a {param} in its path sets it.
2. Add the logo. icon is wazuh, but packages/frontend/public/logos/connectors/wazuh.svg is missing (step 6 in AGENTS.md). Without it the catalog shows a broken image.
CI is running on the new commit. Once these two are in, I will do a last pass and merge.
Set encodePathParams on the four tools with {agent_id}/{policy_id} paths, assert it in the static spec, and add the Wazuh logo (from wazuh/wazuh-dashboard-plugins).
|
Thanks for the review, @helpcodeai. Both points are in 4e348fc:
|
helpcodeai
left a comment
There was a problem hiding this comment.
Thanks, @GallaGit. I checked 4e348fc and both points are done:
encodePathParams: trueis set on all four tools with a{param}in the path. Your spec assertion also lists exactly those four, so a new path tool without the flag will fail the test.- The logo is in. The wordmark works: our tiles have a white background and
object-contain, and other connectors also use wide logos.
validate-adapters reports no warnings for wazuh.json, adapter-count --check matches 695, and CI is green on the head commit. Merging now. Thanks for the careful work and the live testing against v4.14.9.
|
Thanks @GallaGit, merged. The Wazuh adapter will be on AnythingMCP Cloud with the next deploy, and in the next self-hosted release. Thanks also for the live test against v4.14.9 and the path parameter check. |
Read-only Wazuh adapter (#982), built on the
loginBasicAuthflag from #1460 (merged).Adapter:
intl/wazuh.json, 15 read-only GET tools on the Wazuh 4.x server API (manager info/status, agents and summaries, outdated agents, rules, rule groups, decoders, SCA policies/checks, syscheck files and last scan). Alerts and vulnerabilities live in the indexer and are out of scope, as agreed.Auth: LOGIN_TOKEN with
loginBasicAuth: trueonPOST /security/user/authenticate,tokenJsonPath data.token,Bearer ${token},refreshOn401. Error 1701 insidedata.failed_itemsis mapped to 404. Instructions coverSSRF_ALLOWED_HOSTSand the self-signed TLS default (NODE_EXTRA_CA_CERTS).Tested against Wazuh v4.14.9 (
wazuh/wazuh-manager:4.14.9in Docker):wazuh.live.spec.tswithRUN_WAZUH_LIVE=1: 31/31, all 15 tools through the real RestEngine and LoginTokenService, plus a wrong-password case returning 401 without echoing credentials.validate-adapters --warn: no warnings for Wazuh;adapter-count --checkandgenerate-llms-txt --check: OK.