Skip to content

Commit 4b656a2

Browse files
spetrosiclaude
authored andcommitted
feat: Parametrize no_log usage in trustee_server role
- Replace literal no_log: true with trustee_server_secure_logging variable - Add no_log: "{{ ansible_verbosity < 2 }}" to service_facts - Add trustee_server_secure_logging: true to defaults/main.yml - Document trustee_server_secure_logging variable in README.md This change allows users to control logging of potentially sensitive information by setting trustee_server_secure_logging: false for debugging, while maintaining secure defaults. For service_facts, the role now uses verbosity-based logging to hide verbose output unless ansible_verbosity >= 2. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a1ad615 commit 4b656a2

4 files changed

Lines changed: 20 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ When enabled, the secret registration server:
5959

6060
Clients can then fetch the key from Trustee CDH using attestation.
6161

62+
## Variables
63+
64+
### trustee_server_secure_logging
65+
66+
If `true`, suppress potentially sensitive output from tasks that handle
67+
credentials, secrets, and other sensitive data by setting `no_log: true` on
68+
those tasks. This prevents passwords, API tokens, private keys, and similar
69+
sensitive information from appearing in Ansible logs and console output.
70+
71+
If you need to debug issues with credential handling or secret management, you
72+
can temporarily set `trustee_server_secure_logging: false` to see the full output from
73+
these tasks. However, be aware that this may expose sensitive information in
74+
logs, so it should only be used in development or troubleshooting scenarios.
75+
76+
Default: `true`
77+
6278
## License
6379

6480
MIT

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ trustee_server_trustee: true
77
# Secret registration server service configuration
88
trustee_server_secret_registration_enabled: false
99
trustee_server_secret_registration_listen_port: 8081
10+
trustee_server_secure_logging: true

tasks/secret_registration_server.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
- name: Gather service facts for firewall check
3131
ansible.builtin.service_facts:
32+
no_log: "{{ ansible_verbosity < 2 }}"
3233

3334
- name: Allow secret registration server port in firewall
3435
ansible.posix.firewalld:

tasks/trustee_quadlet.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@
6060
cp {{ __trustee_server_config_dir }}/as/token.crt {{ __trustee_server_config_dir }}/kbs/trusted_certs/token0.crt
6161
fi
6262
changed_when: true
63-
no_log: true
63+
no_log: "{{ trustee_server_secure_logging }}"
6464

6565
- name: Gather service facts
6666
ansible.builtin.service_facts:
67+
no_log: "{{ ansible_verbosity < 2 }}"
6768

6869
- name: Allow port 8080 in firewall
6970
ansible.posix.firewalld:

0 commit comments

Comments
 (0)