-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a problem updating the API host registry (#6995)
* fix: a problem upgrading the API host registry data through /api/check-stored-api endpoint The allow_run_as missing data in the API host registry could cause the authentication used the internal user instead of the context of logger user when run_as was enabled. * chore(changelog): add entry * fix: ensure the user authentication uses the related endpoint according to the configuration of run_as - Ensure the user authentication uses the related endpoint according to the configuration of run_as Move the logic to decide the authentication (user or not run_as) to asCurrentUser.authenticate - Fix when the `run_as: false` for a server API host, any login of an user caused the internal user token was replaced by the obtained for the logged user. --------- Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
- Loading branch information
1 parent
2373b8c
commit c3d75ea
Showing
6 changed files
with
131 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,8 @@ | ||
/** | ||
* @example | ||
* HOST = set in configuration | ||
* USER = set in user interface | ||
* | ||
* ALL_DISABLED | ||
* binary 00 = decimal 0 ---> USER 0 y HOST 0 | ||
* | ||
* USER_NOT_ALLOWED | ||
* binary 01 = decimal 1 ---> USER 0 y HOST 1 | ||
* | ||
* HOST_DISABLED | ||
* binary 10 = decimal 2 ---> USER 1 y HOST 0 | ||
* | ||
* ENABLED | ||
* binary 11 = decimal 3 ---> USER 1 y HOST 1 | ||
*/ | ||
export enum API_USER_STATUS_RUN_AS { | ||
UNABLE_TO_CHECK = -1 /* Initial value or could not check the user can | ||
use the run_as */, | ||
ALL_DISABLED = 0, // Wazuh HOST and USER API user configured with run_as=false or undefined | ||
USER_NOT_ALLOWED = 1, // Wazuh HOST API user configured with run_as=true in configuration but it has not run_as in Wazuh API | ||
HOST_DISABLED = 2, // Wazuh HOST API user configured with run_as=false in configuration but it has not run_as in Wazuh API | ||
HOST_DISABLED = 2, // Wazuh HOST API user configured with run_as=false in configuration but it has run_as in Wazuh API | ||
ENABLED = 3, // Wazuh API user configured with run_as=true and allow run_as | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.