Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ansible in sshd_use_approved_kex_ordered_stig #11148

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
{{% set prefix_conf="^\s*KexAlgorithms\s*" %}}
{{% set kex_algos=["ecdh-sha2-nistp256","ecdh-sha2-nistp384","ecdh-sha2-nistp521",
"diffie-hellman-group-exchange-sha256"] %}}
{{% set kex_algos_regex=prefix_conf ~ "(?=[\w-])" "(\\b" ~ kex_algos|join("\\b,?)?(\\b") ~ ")?" ~
sufix_conf ~ "[\s]*(?:#.*)?$" %}}
- name: "Configure sshd to use FIPS 140-2 approved key exchange algorithms"
lineinfile:
path: /etc/ssh/sshd_config
line: 'KexAlgorithms {{{ kex_algos|join(",") }}}'
state: present
regexp: '{{{ kex_algos_regex }}}'
regexp: '{{{ prefix_conf }}}'
create: True
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@
comment="tests the value of Kex algorithms setting in the {{{ path }}} file"
id="test_{{{ rule_id }}}" version="1">
<ind:object object_ref="obj_{{{ rule_id }}}" />
<ind:state state_ref="state_{{{ rule_id }}}" />
</ind:textfilecontent54_test>

<ind:textfilecontent54_object id="obj_{{{ rule_id }}}" version="1">
<ind:filepath>{{{ path }}}</ind:filepath>
<ind:pattern operation="pattern match">{{{ kex_algos_regex }}}</ind:pattern>
<ind:instance datatype="int">1</ind:instance>
<ind:pattern operation="pattern match">{{{ prefix_conf }}}.*</ind:pattern>
<ind:instance datatype="int" operation="greater than or equal" >1</ind:instance>
</ind:textfilecontent54_object>


<ind:textfilecontent54_state id="state_{{{ rule_id }}}" version="1">
<ind:text operation="pattern match">{{{ kex_algos_regex }}}</ind:text>
</ind:textfilecontent54_state>

</def-group>
Loading