Skip to content

Commit

Permalink
keycloak_client: sanitize saml.encryption.private.key (#9621)
Browse files Browse the repository at this point in the history
* sanitize saml.encryption.private.key in module output

* add changelog fragment

* Re-categorize changelog fragment.

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit fb4f724)
  • Loading branch information
fgruenbauer authored and patchback[bot] committed Jan 26, 2025
1 parent 56a906e commit 8732c98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
security_fixes:
- keycloak_client - Sanitize ``saml.encryption.private.key`` so it does not show in the logs (https://github.com/ansible-collections/community.general/pull/9621).
7 changes: 5 additions & 2 deletions plugins/modules/keycloak_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,11 @@ def sanitize_cr(clientrep):
result['secret'] = 'no_log'
if 'attributes' in result:
attributes = result['attributes']
if isinstance(attributes, dict) and 'saml.signing.private.key' in attributes:
attributes['saml.signing.private.key'] = 'no_log'
if isinstance(attributes, dict):
if 'saml.signing.private.key' in attributes:
attributes['saml.signing.private.key'] = 'no_log'
if 'saml.encryption.private.key' in attributes:
attributes['saml.encryption.private.key'] = 'no_log'
return normalise_cr(result)


Expand Down

0 comments on commit 8732c98

Please sign in to comment.