Skip to content

Commit

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

The remediation now uses the ansible_sshd_set macro and the
sshd_approved_macs variable.
  • Loading branch information
mpurg committed May 9, 2024
1 parent 1fd5296 commit 9f849e5
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_macs') }}}
{{{ ansible_sshd_set(parameter="Macs", value="{{ sshd_approved_macs }}", config_is_distributed=sshd_distributed_config) }}}
{{%- else %}}
- name: "Configure sshd to use approved MACs"
lineinfile:
path: /etc/ssh/sshd_config
line: 'MACs hmac-sha2-512,hmac-sha2-256'
state: present
regexp: '^[\s]*MACs[\s]+(hmac-sha2-512(?=[\w,-@]+|$),?)?(hmac-sha2-256(?=[\w,-@]+|$),?)?[\s]*(?:#.*)?$'
create: True
{{%- endif %}}

0 comments on commit 9f849e5

Please sign in to comment.