Skip to content

Commit 23afc38

Browse files
committed
Use remote_login_banner_contents variable in rule banner_etc_issue_net
Use remote_login_banner_contents variable in remediations in rule banner_etc_issue_net. Also, add test scenarios to test the ability to parametrize the rule with a custom banner text.
1 parent c699736 commit 23afc38

File tree

16 files changed

+36
-27
lines changed

16 files changed

+36
-27
lines changed

controls/ccn_ol9.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ controls:
629629
- motd_banner_text=cis_default
630630
- motd_banner_contents=cis_default
631631
- remote_login_banner_text=cis_default
632+
- remote_login_banner_contents=cis_default
632633

633634
- id: A.11.SEC-OL5
634635
title: Network Acess to the System is Controlled

controls/cis_al2023.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ controls:
488488
rules:
489489
- banner_etc_issue_net
490490
- remote_login_banner_text=cis_banners
491+
- remote_login_banner_contents=cis_default
491492

492493
- id: 1.7.4
493494
title: Ensure permissions on /etc/motd are configured (Automated)

controls/cis_sle12.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ controls:
479479
rules:
480480
- banner_etc_issue_net
481481
- remote_login_banner_text=cis_banners
482+
- remote_login_banner_contents=cis_default
482483

483484
- id: 1.8.1.4
484485
title: Ensure permissions on /etc/motd are configured (Automated)

controls/cis_sle15.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ controls:
477477
rules:
478478
- banner_etc_issue_net
479479
- remote_login_banner_text=cis_banners
480+
- remote_login_banner_contents=cis_default
480481

481482
- id: 1.8.1.4
482483
title: Ensure permissions on /etc/motd are configured (Automated)

controls/general_sle15.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ controls:
490490
rules:
491491
- banner_etc_issue_net
492492
- remote_login_banner_text=cis_banners
493+
- remote_login_banner_contents=cis_default
493494

494495
- id: SLES-15-151050060
495496
title: Configure access to the Message of the Day Banner

controls/general_slmicro5.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ controls:
289289
rules:
290290
- banner_etc_issue_net
291291
- remote_login_banner_text=cis_banners
292+
- remote_login_banner_contents=cis_default
292293

293294
- id: SLEM-5-SET-08010400
294295
title: Verify Ownership and Permissions of/on Message of the Day Banner

controls/std_tencentos4.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ controls:
134134
rules:
135135
- banner_etc_issue_net
136136
- remote_login_banner_text=cis_banners
137+
- remote_login_banner_contents=cis_default
137138

138139
- id: 1.4.4
139140
title: Ensure permissions on /etc/motd are configured

controls/stig_ubuntu2204.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ controls:
498498
- medium
499499
rules:
500500
- remote_login_banner_text=dod_banners
501+
- remote_login_banner_contents=dod_default
501502
- sshd_enable_warning_banner_net
502503
- banner_etc_issue_net
503504
status: automated

controls/stig_ubuntu2404.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ controls:
441441
- medium
442442
rules:
443443
- remote_login_banner_text=dod_banners
444+
- remote_login_banner_contents=dod_default
444445
- sshd_enable_warning_banner_net
445446
- banner_etc_issue_net
446447
status: automated

linux_os/guide/system/accounts/accounts-banners/banner_etc_issue_net/ansible/shared.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# strategy = unknown
44
# complexity = low
55
# disruption = medium
6-
{{{ ansible_instantiate_variables("remote_login_banner_text") }}}
6+
{{{ ansible_instantiate_variables("remote_login_banner_contents") }}}
77

88
- name: "{{{ rule_title }}} - ensure correct banner"
99
ansible.builtin.copy:
1010
dest: /etc/issue.net
11-
content: '{{{ ansible_deregexify_banner_etc_issue("remote_login_banner_text") }}}'
11+
content: "{{ remote_login_banner_contents | replace('\\n', '\n') }}\n"

0 commit comments

Comments
 (0)