Skip to content

Commit

Permalink
Modify Ubuntu ansible remediation for sshd_use_approved_ciphers_order…
Browse files Browse the repository at this point in the history
…ed_stig

The remediation now uses the ansible_sshd_set macro and the
sshd_approved_ciphers variable.
  • Loading branch information
mpurg committed May 9, 2024
1 parent da09757 commit 0918aac
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
# complexity = low
# disruption = low

{{%- if 'ubuntu' in product %}}
{{{ ansible_instantiate_variables('sshd_approved_ciphers') }}}
{{{ ansible_sshd_set(parameter="Ciphers", value="{{ sshd_approved_ciphers }}", config_is_distributed=sshd_distributed_config) }}}
{{%- else %}}
- name: "Configure sshd to use approved ciphers"
lineinfile:
path: /etc/ssh/sshd_config
line: 'Ciphers aes256-ctr,aes192-ctr,aes128-ctr'
state: present
regexp: '^[\s]*[Cc]iphers[\s]+(aes256-ctr(?=[\w,-@]+|$),?)?(aes192-ctr(?=[\w,-@]+|$),?)?(aes128-ctr(?=[\w,-@]+|$),?)?[\s]*(?:#.*)?$'
create: True
{{%- endif %}}

0 comments on commit 0918aac

Please sign in to comment.