-
Notifications
You must be signed in to change notification settings - Fork 794
Enable checks and remediations for the following SLES-12 STIGs: #6599
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
Merged
yuumasato
merged 1 commit into
ComplianceAsCode:master
from
guangyee:upstream_sles12_stigs_98e1391ac
Feb 8, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
linux_os/guide/services/ntp/chronyd_or_ntpd_set_maxpoll/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # platform = multi_platform_sle | ||
| # reboot = false | ||
| # strategy = restrict | ||
| # complexity = low | ||
| # disruption = low | ||
|
|
||
| {{{ ansible_instantiate_variables('var_time_service_set_maxpoll') }}} | ||
|
|
||
| - name: Check that /etc/ntp.conf exist | ||
| stat: | ||
| path: /etc/ntp.conf | ||
| register: ntp_conf_exist_result | ||
|
|
||
| - name: Check that /etc/chrony.conf exist | ||
| stat: | ||
| path: /etc/chrony.conf | ||
| register: chrony_conf_exist_result | ||
|
|
||
| - name: Update the maxpoll values in /etc/ntp.conf | ||
| lineinfile: | ||
| path: /etc/ntp.conf | ||
| regex: '^(server.*maxpoll) [0-9]+(\s+.*)$' | ||
| line: '\1 {{ var_time_service_set_maxpoll }}\2' | ||
| backrefs: yes | ||
| when: ntp_conf_exist_result.stat.exists | ||
|
|
||
| - name: Update the maxpoll values in /etc/chrony.conf | ||
| lineinfile: | ||
| path: /etc/chrony.conf | ||
| regex: '^(server.*maxpoll) [0-9]+(\s+.*)$' | ||
| line: '\1 {{ var_time_service_set_maxpoll }}\2' | ||
| backrefs: yes | ||
| when: chrony_conf_exist_result.stat.exists | ||
|
|
||
| - name: Set the maxpoll values in /etc/ntp.conf | ||
| lineinfile: | ||
| path: /etc/ntp.conf | ||
| regex: '(^server\s+((?!maxpoll).)*)$' | ||
| line: '\1 maxpoll {{ var_time_service_set_maxpoll }}\n' | ||
| backrefs: yes | ||
| when: ntp_conf_exist_result.stat.exists | ||
|
|
||
| - name: Set the maxpoll values in /etc/chrony.conf | ||
| lineinfile: | ||
| path: /etc/chrony.conf | ||
| regex: '(^server\s+((?!maxpoll).)*)$' | ||
| line: '\1 maxpoll {{ var_time_service_set_maxpoll }}\n' | ||
| backrefs: yes | ||
| when: chrony_conf_exist_result.stat.exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...guide/system/accounts/accounts-pam/pam_disable_automatic_configuration/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # platform = multi_platform_sle | ||
| # reboot = false | ||
| # strategy = restrict | ||
| # complexity = low | ||
| # disruption = low | ||
|
|
||
| - name: Find soft links /etc/pam.d/ | ||
| find: | ||
| paths: /etc/pam.d | ||
| file_type: link | ||
| patterns: common-.* | ||
| use_regex: yes | ||
| register: find_pam_soft_links_result | ||
|
|
||
| - name: Remove soft links in /etc/pam.d/ | ||
| shell: | | ||
| target=$(readlink -f "{{ item.path }}") | ||
| cp -p --remove-destination "$target" "{{ item.path }}" | ||
| with_items: "{{ find_pam_soft_links_result.files }}" | ||
6 changes: 6 additions & 0 deletions
6
..._os/guide/system/accounts/accounts-pam/pam_disable_automatic_configuration/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # platform = multi_platform_sle | ||
|
|
||
| for link in $(find /etc/pam.d/ -type l -iname "common-*") ; do | ||
| target=$(readlink -f "$link") | ||
| cp -p --remove-destination "$target" "$link" | ||
| done |
29 changes: 29 additions & 0 deletions
29
...os/guide/system/accounts/accounts-pam/pam_disable_automatic_configuration/oval/shared.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <def-group> | ||
| <definition class="compliance" id="pam_disable_automatic_configuration" version="1"> | ||
| <metadata> | ||
| <title>The PAM configuration should not be changed automatically</title> | ||
| <affected family="unix"> | ||
| <platform>multi_platform_sle</platform> | ||
| </affected> | ||
| <description>Verify the SUSE operating system is configured to not overwrite Pluggable | ||
| Authentication Modules (PAM) configuration on package changes.</description> | ||
| </metadata> | ||
| <criteria> | ||
| <criterion comment="/etc/pam.d/common-* are not symbolic links" test_ref="test_pam_disable_automatic_configuration" /> | ||
| </criteria> | ||
| </definition> | ||
|
|
||
| <unix:file_test check="all" check_existence="all_exist" comment="/etc/pam.d/common-* are not symbolic links" id="test_pam_disable_automatic_configuration" version="1"> | ||
| <unix:object object_ref="obj_pam_disable_automatic_configuration" /> | ||
| <unix:state state_ref="state_pam_disable_automatic_configuration_no_symlink" /> | ||
| </unix:file_test> | ||
|
|
||
| <unix:file_object comment="/etc/pam.d/common-* files" id="obj_pam_disable_automatic_configuration" version="1"> | ||
| <unix:path operation="equals">/etc/pam.d</unix:path> | ||
| <unix:filename operation="pattern match">^common-.*$</unix:filename> | ||
| </unix:file_object> | ||
|
|
||
| <unix:file_state id="state_pam_disable_automatic_configuration_no_symlink" version="1"> | ||
| <unix:type>regular</unix:type> | ||
| </unix:file_state> | ||
| </def-group> |
37 changes: 37 additions & 0 deletions
37
linux_os/guide/system/accounts/accounts-pam/pam_disable_automatic_configuration/rule.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| documentation_complete: true | ||
|
|
||
| prodtype: sle12 | ||
|
|
||
| title: 'The PAM configuration should not be changed automatically' | ||
|
|
||
| description: |- | ||
| Verify the SUSE operating system is configured to not overwrite Pluggable | ||
| Authentication Modules (PAM) configuration on package changes. | ||
|
|
||
|
|
||
| rationale: |- | ||
| <tt>pam-config</tt> is a command line utility that automatically generates | ||
| a system PAM configuration as packages are installed, updated or removed | ||
| from the system. <tt>pam-config</tt> removes configurations for PAM modules | ||
| and parameters that it does not know about. It may render ineffective PAM | ||
| configuration by the system administrator and thus impact system security. | ||
|
|
||
| severity: medium | ||
|
|
||
| identifiers: | ||
| cce@sle12: CCE-83113-1 | ||
|
|
||
| references: | ||
| stigid@sle12: SLES-12-010910 | ||
| disa@sle12: CCI-000366 | ||
| srg@sle12: SRG-OS-000480-GPOS-00227 | ||
| nist@sle12: CM-6(b),CM-6.1(iv) | ||
|
|
||
| ocil_clause: 'that is not the case' | ||
|
|
||
| ocil: |- | ||
| Check that soft links between PAM configuration files are removed with the following command: | ||
|
|
||
| <pre># find /etc/pam.d/ -type l -iname "common-*"</pre> | ||
|
|
||
| If any results are returned, this is a finding. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.