Restrict access to partial configuration information to read-only users #7455
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In certain configurations, authenticated users with read-only API roles may retrieve agent enrollment credentials through the
/utils/configuration
endpoint. These credentials can be used to register new agents within the same Wazuh tenant without requiring elevated permissions through the UI.Users with authenticated access and the appropriate RBAC profile may access the configuration API. This endpoint returns a JSON payload that includes the
enrollment.password
andenrollment.dns
fields used to register agents.Despite lacking
agent:create
permissions via the user interface, these credentials may be used manually to register additional agents via command-line or automation scripts.Example of retrieved information by a read-only user:
Issues Resolved
https://github.com/wazuh/internal-devel-requests/issues/2414
Evidence
Verify that the following 3 requests are made in parallel when accessing deploy-agent (



/app/endpoints-summary#/agents-preview/deploy
).GET
/
GET
/cluster/status
GET
/groups
Test
Check List
yarn test:jest