-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
P0Critical priorityCritical prioritybugSomething isn't workingSomething isn't workinggoPull requests that update go codePull requests that update go code
Description
I — Identify
- Priority: P0
- Area:
pkg/wazuh/provision.go - Owner: engineering
S — Situation
Wazuh DRY helper doWazuhAPIRequest currently uses a placeholder bearer token string, so API calls cannot authenticate in real environments.
o — Observations
- Code evidence:
pkg/wazuh/provision.gocontainstoken := "<vaulted-wazuh-token>". - Expected behavior: token sourced from secure store (Vault), with controlled fallback.
- Risk: operational failure + insecure secret handling pattern.
B — Background
Recent DRY refactor consolidated duplicated Wazuh HTTP request logic. During extraction, token retrieval path was not fully wired.
A — Assessment
Root cause hypothesis: helper centralization captured a stub credential path instead of production token retrieval flow.
Impact: all downstream Wazuh API calls using this helper can fail with auth errors and violate security best practice.
R — Recommendation
- Implement
getWazuhAPIToken(rc)with Vault-first and env fallback. - Update
doWazuhAPIRequestto accept runtime context and call token provider. - Add focused tests for token sourcing, header injection, and ID resolver behavior.
- Attach command outputs for build/test/vet as evidence.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0Critical priorityCritical prioritybugSomething isn't workingSomething isn't workinggoPull requests that update go codePull requests that update go code