-
Notifications
You must be signed in to change notification settings - Fork 717
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
Ubuntu2004 stig profile v1r9 update #10738
Changes from all commits
3158229
2ef1fed
234f8bf
725185d
aeaad7a
a6c8736
94747d3
30eecd3
910b8b9
74f46d9
e7d99c0
e10688c
6ebd682
bd20a4d
2559ba5
6d336c6
e7e88dc
c3ca6fd
72e8f38
42d3227
42ef19e
af5bbd3
b9d81a1
86b7764
6a79941
e043e4d
85eb22b
ef5e085
9bbf7f2
e04cff6
6cbcf9a
dc3b56d
56ab476
69659ce
e7814a4
d0090a5
cb60109
e808a31
5e499fa
f678cca
ee952de
ee58feb
b728606
f536340
2060bc6
3e936dc
9276622
164dc76
114455d
f654425
9322cab
460935a
4de2afc
c77d64e
91182c3
e8f79b1
fffa887
98aed89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_ol,multi_platform_rhel,multi_platform_sle | ||
# platform = multi_platform_ol,multi_platform_rhel,multi_platform_sle,multi_platform_ubuntu | ||
|
||
source common.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# platform = multi_platform_ubuntu | ||
# reboot = false | ||
# strategy = unknown | ||
# complexity = low | ||
# disruption = medium | ||
|
||
- name: "{{{ rule_title }}} - Uncomment banner-message-enable for Login Warning Banner" | ||
ansible.builtin.lineinfile: | ||
path: /etc/gdm3/greeter.dconf-defaults | ||
regexp: ^(#.*)(banner-message-enable=) | ||
line: \2 | ||
backrefs: true | ||
|
||
- name: "{{{ rule_title }}} - Set banner-message-enable to True for Login Warning Banner" | ||
ansible.builtin.ini_file: | ||
dest: /etc/gdm3/greeter.dconf-defaults | ||
section: "org/gnome/login-screen" | ||
option: banner-message-enable | ||
value: "true" | ||
create: yes | ||
no_extra_spaces: yes | ||
|
||
- name: "{{{ rule_title }}} - Dconf Update" | ||
ansible.builtin.command: dconf update | ||
|
||
- name: "{{{ rule_title }}} - Restart gdm3.service" | ||
ansible.builtin.systemd: | ||
name: gdm3 | ||
enabled: true | ||
state: restarted |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
<def-group> | ||
{{% if product not in ['ubuntu2004'] %}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please revert the changes to this file. we will need an specific ubuntu to handle both cis and stig. |
||
{{%- set gui_banner_path = "/etc/dconf/db/{{{ dconf_gdm_dir }}}" %}} | ||
{{%- else %}} | ||
{{%- set gui_banner_path = "/etc/gdm3/greeter.dconf-defaults" %}} | ||
{{% endif %}} | ||
|
||
<definition class="compliance" id="dconf_gnome_banner_enabled" version="1"> | ||
{{{ oval_metadata("Enable the GNOME3 Login warning banner.") }}} | ||
<criteria operator="OR"> | ||
<extend_definition comment="dconf installed" definition_ref="package_dconf_installed" negate="true" /> | ||
<criteria comment="Enable GUI banner and prevent user from changing it" operator="AND"> | ||
<extend_definition comment="dconf user profile exists" definition_ref="enable_dconf_user_profile" /> | ||
<criterion comment="Enable GUI banner" test_ref="test_banner_gui_enabled" /> | ||
{{% if product not in ['ubuntu2004'] %}} | ||
<criterion comment="Prevent user from disabling banner" test_ref="test_prevent_user_banner_gui_enabled_change" /> | ||
{{% endif %}} | ||
</criteria> | ||
</criteria> | ||
</definition> | ||
|
@@ -18,7 +26,7 @@ | |
</ind:textfilecontent54_test> | ||
<ind:textfilecontent54_object id="obj_banner_gui_enabled" | ||
version="1"> | ||
<ind:path>/etc/dconf/db/{{{ dconf_gdm_dir }}}/</ind:path> | ||
<ind:path>{{{ gui_banner_path }}}</ind:path> | ||
<ind:filename operation="pattern match">^.*$</ind:filename> | ||
<ind:pattern operation="pattern match">^\[org/gnome/login-screen\]([^\n]*\n+)+?banner-message-enable=true$</ind:pattern> | ||
<ind:instance datatype="int">1</ind:instance> | ||
|
@@ -31,7 +39,7 @@ | |
</ind:textfilecontent54_test> | ||
<ind:textfilecontent54_object id="obj_prevent_user_banner_gui_enabled_change" | ||
version="1"> | ||
<ind:path>/etc/dconf/db/{{{ dconf_gdm_dir }}}/locks/</ind:path> | ||
<ind:path>{{{ gui_banner_path }}}/locks/</ind:path> | ||
<ind:filename operation="pattern match">^.*$</ind:filename> | ||
<ind:pattern operation="pattern match">^/org/gnome/login-screen/banner-message-enable$</ind:pattern> | ||
<ind:instance datatype="int">1</ind:instance> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# platform = multi_platform_ubuntu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix format to style guide |
||
# reboot = false | ||
# strategy = unknown | ||
# complexity = low | ||
# disruption = medium | ||
{{{ ansible_instantiate_variables("login_banner_text") }}} | ||
|
||
- name: "{{{ rule_title }}}" | ||
lineinfile: | ||
path: /etc/gdm3/greeter.dconf-defaults | ||
regexp: ^(#.*)(banner-message-text=) | ||
line: \2 | ||
backrefs: true | ||
|
||
- name: "{{{ rule_title }}}" | ||
ini_file: | ||
dest: /etc/gdm3/greeter.dconf-defaults | ||
section: org/gnome/login-screen | ||
option: banner-message-text | ||
value: '{{{ ansible_deregexify_banner_dconf_gnome("login_banner_text") }}}' | ||
create: yes | ||
no_extra_spaces: yes | ||
|
||
- name: Dconf Update | ||
command: dconf update |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,31 @@ | ||
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle | ||
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle,multi_platform_ubuntu | ||
# reboot = false | ||
# strategy = configure | ||
# complexity = low | ||
# disruption = medium | ||
|
||
{{% if product in [ "sle12", "sle15" ] %}} | ||
{{% if product in [ "sle12", "sle15" ] or product in [ "ubuntu1804", "ubuntu2004" ] %}} | ||
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/common-password' -%}} | ||
{{% else %}} | ||
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/system-auth' -%}} | ||
{{% endif %}} | ||
|
||
{{{ ansible_instantiate_variables("var_password_pam_unix_remember") }}} | ||
|
||
{{% if product not in ['ubuntu2004'] %}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we prefer to have checks like, if "product in", makes it easier to check, so coul you invert the if else please? |
||
|
||
{{{ ansible_pam_pwhistory_enable(accounts_password_pam_unix_remember_file, | ||
'requisite', | ||
'^password.*requisite.*pam_pwquality\.so') }}} | ||
|
||
{{{ ansible_pam_pwhistory_parameter_value(accounts_password_pam_unix_remember_file, | ||
'remember', | ||
'{{ var_password_pam_unix_remember }}') }}} | ||
|
||
{{% else %}} | ||
{{{ ansible_ensure_pam_module_line(accounts_password_pam_unix_remember_file, | ||
"password", | ||
"[success=1 default=ignore]", | ||
"pam_unix.so obscure sha512 shadow remember=5 rounds=5000")}}} | ||
|
||
{{% endif %}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{{% if product in [ "sle12", "sle15" ] %}} | ||
{{% if product in [ "sle12", "sle15" ] or product in [ "ubuntu1804", "ubuntu2004"] %}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any reason to drop the specific oval? |
||
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/common-password' -%}} | ||
{{% else %}} | ||
{{%- set accounts_password_pam_unix_remember_file = '/etc/pam.d/system-auth' -%}} | ||
{{% endif %}} | ||
{{% if product in ["ubuntu2004"] %}} | ||
{{%- set pam_unix_legacy_regex = '^\s*password\s+\[success=1 default=ignore\]\s+pam_unix\.so.*remember=([0-9]*).*$' %}} | ||
{{% else %}} | ||
{{%- set pam_unix_legacy_regex = '^\s*password\s+(?:(?:sufficient)|(?:required))\s+pam_unix\.so.*remember=([0-9]*).*$' %}} | ||
{{% endif %}} | ||
|
||
|
||
<def-group> | ||
<definition class="compliance" id="{{{ rule_id }}}" version="2"> | ||
|
@@ -145,14 +151,14 @@ | |
<!-- Check the pam_unix.so remember case --> | ||
<ind:textfilecontent54_test id="test_accounts_password_pam_unix_remember_legacy" version="1" | ||
check="all" check_existence="all_exist" | ||
comment="Test if remember attribute of pam_unix.so is set correctly in /etc/pam.d/system-auth"> | ||
comment="Test if remember attribute of pam_unix.so is set correctly in {{{ accounts_password_pam_unix_remember_file }}}"> | ||
<ind:object object_ref="object_accounts_password_pam_unix_remember_legacy" /> | ||
<ind:state state_ref="state_accounts_password_pam_unix_remember" /> | ||
</ind:textfilecontent54_test> | ||
|
||
<ind:textfilecontent54_object id="object_accounts_password_pam_unix_remember_legacy" version="1"> | ||
<ind:filepath>/etc/pam.d/system-auth</ind:filepath> | ||
<ind:pattern operation="pattern match">^\s*password\s+(?:(?:sufficient)|(?:required))\s+pam_unix\.so.*remember=([0-9]*).*$</ind:pattern> | ||
<ind:filepath>{{{ accounts_password_pam_unix_remember_file }}}</ind:filepath> | ||
<ind:pattern operation="pattern match">{{{ pam_unix_legacy_regex }}}</ind:pattern> | ||
<ind:instance datatype="int">1</ind:instance> | ||
</ind:textfilecontent54_object> | ||
</def-group> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multi_platform_ubuntu