Skip to content

Commit 07be9d4

Browse files
committed
Check if the NSS file exists, if not then run the update-crypto-policies
This is to mimic the OVAL that does the same check.
1 parent cb06f97 commit 07be9d4

File tree

1 file changed

+8
-1
lines changed
  • linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/ansible

1 file changed

+8
-1
lines changed

linux_os/guide/system/software/integrity/crypto/configure_crypto_policy/ansible/shared.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,15 @@
3636
failed_when: false
3737
check_mode: false
3838

39+
- name: "{{{ rule_title }}} - Check existence of /etc/crypto-policies/back-ends/nss.config"
40+
ansible.builtin.stat:
41+
path: /etc/crypto-policies/back-ends/nss.config
42+
register: nss_config_stat
43+
changed_when: false
44+
3945
- name: "{{{ rule_title }}} - Verify that Crypto Policy is Set (runtime)"
4046
ansible.builtin.command: /usr/bin/update-crypto-policies --set {{ var_system_crypto_policy }}
4147
when: >
4248
(current_crypto_policy.stdout.strip() != var_system_crypto_policy) or
43-
(config_file_stat.stat.exists and current_file_stat.stat.exists and config_file_stat.stat.mtime > current_file_stat.stat.mtime)
49+
(config_file_stat.stat.exists and current_file_stat.stat.exists and config_file_stat.stat.mtime > current_file_stat.stat.mtime) or
50+
(not nss_config_stat.stat.exists)

0 commit comments

Comments
 (0)