-
Notifications
You must be signed in to change notification settings - Fork 764
Ubuntu 24.04 STIG rule UBTU-24-400360 #13359
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
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a3080ad
Ubuntu 24.04 SITG rule UBTU-24-400360 sssd_certification_path_trust_a…
ericeberry 66b7164
Fixed status to automated
ericeberry 91e496a
Ubuntu 24.04 STIG 400360 add sssd_enable_pam_services
ericeberry f597e4c
Ubuntu 24.04 STIG 400360 add sssd_enable_smartcards
ericeberry 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
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
38 changes: 38 additions & 0 deletions
38
linux_os/guide/services/sssd/sssd_certification_path_trust_anchor/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,38 @@ | ||
| # platform = multi_platform_ubuntu | ||
| # reboot = false | ||
| # strategy = configure | ||
| # complexity = low | ||
| # disruption = medium | ||
|
|
||
| # sssd configuration files must be created with 600 permissions if they don't exist | ||
| # otherwise the sssd module fails to start | ||
| OLD_UMASK=$(umask) | ||
| umask u=rw,go= | ||
|
|
||
| # find key in section and change value | ||
| found=false | ||
| # find key in section but don't change current value | ||
| if grep -qzosP "[[:space:]]*\[domain/.*\]([^\n\[]*\n+)+?[[:space:]]*ca_cert" "/etc/sssd/sssd.conf"; then | ||
| found=true | ||
|
|
||
| # find section and add key = value to it | ||
| elif grep -qs "[[:space:]]*\[domain/.*\]" "/etc/sssd/sssd.conf"; then | ||
| sed -i "/[[:space:]]*certificate_verification/a ca_cert = \/etc\/ssl\/certs\/ca-certificates.crt" "/etc/sssd/sssd.conf" | ||
| found=true | ||
| fi | ||
|
|
||
| # if section not in file, append section with key = value | ||
| if ! $found ; then | ||
| mkdir -p "/etc/sssd" | ||
| echo -e "\n[domain/example.com]\nca_cert = /etc/ssl/certs/ca-certificates.crt" >> "/etc/sssd/sssd.conf" | ||
| fi | ||
|
|
||
| if grep -qzosP "[[:space:]]*\[domain/.*\]([^\n\[]*\n+)+?[[:space:]]*certificate_verification" "/etc/sssd/sssd.conf"; then | ||
| sed -i "s/certificate_verification[^(\n)]*/certificate_verification = ca_cert,ocsp/" "/etc/sssd/sssd.conf" | ||
|
|
||
| # find section and add key = value to it | ||
| else | ||
| sed -i "/[[:space:]]*\[domain\/.*\]/a certificate_verification = ca_cert,ocsp" "/etc/sssd/sssd.conf" | ||
| fi | ||
|
|
||
| umask $OLD_UMASK | ||
25 changes: 25 additions & 0 deletions
25
linux_os/guide/services/sssd/sssd_certification_path_trust_anchor/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,25 @@ | ||
| <def-group> | ||
| <definition class="compliance" id="{{{ rule_id }}}" version="1"> | ||
| {{{ oval_metadata("SSSD should be configured with trust path to an accepted trust anchor.") }}} | ||
| <criteria> | ||
| <criterion comment="check value of certificate_verification in sssd configuration" | ||
| test_ref="test_{{{rule_id}}}" /> | ||
| </criteria> | ||
| </definition> | ||
|
|
||
| <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="test the value of | ||
| certificate_verification in sssd configuration" 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 operation="pattern match">^/etc/sssd/sssd.conf$</ind:filepath> | ||
| <ind:pattern operation="pattern match">^[\s]*\[domain\/.*](?:[^\n\[]*\n+)+?[\s]*certificate_verification\s*=\s*([\w,]+)$</ind:pattern> | ||
| <ind:instance operation="greater than or equal" datatype="int">1</ind:instance> | ||
| </ind:textfilecontent54_object> | ||
|
|
||
| <ind:textfilecontent54_state comment="value of certificate_verification" id="state_{{{rule_id}}}" version="1"> | ||
| <ind:subexpression operation="equals">ca_cert,ocsp</ind:subexpression> | ||
| </ind:textfilecontent54_state> | ||
| </def-group> |
34 changes: 34 additions & 0 deletions
34
linux_os/guide/services/sssd/sssd_certification_path_trust_anchor/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,34 @@ | ||
| documentation_complete: true | ||
|
|
||
|
|
||
| title: 'Certificate trust path in SSSD' | ||
|
|
||
| description: |- | ||
| Enable certification trust path for SSSD to an accepted trust anchor. | ||
|
|
||
| rationale: |- | ||
| Without path validation, an informed trust decision by the relying party cannot be made when | ||
| presented with any certificate not already explicitly trusted. | ||
|
|
||
| severity: medium | ||
|
|
||
|
|
||
| ocil_clause: 'certificate_verification in sssd is not configured' | ||
|
|
||
| ocil: |- | ||
| Ensure "ca" is enabled in "certificate_verification" with the following command: | ||
| <pre>$ sudo grep certificate_verification /etc/sssd/sssd.conf</pre>. | ||
| If configured properly, output should look like | ||
| <pre> | ||
| certificate_verification = ca_cert,ocsp | ||
| </pre> | ||
|
|
||
| fixtext: |- | ||
| Configure SSSD for PKI-based authentication. To validate certificates by constructing a certification path | ||
| to an accepted trust anchor by checking the following configuration of the <pre>/etc/sssd/sssd.conf</pre> file. | ||
| <pre> | ||
| [domain/example.com] | ||
| ldap_user_certificate = usercertificate;binary | ||
| certificate_verification = ca_cert,ocsp | ||
| ca_cert = /etc/ssl/certs/ca-certificates.crt | ||
| </pre> |
18 changes: 18 additions & 0 deletions
18
...x_os/guide/services/sssd/sssd_certification_path_trust_anchor/tests/correct_value.pass.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,18 @@ | ||
| #!/bin/bash | ||
| # packages = sssd-common | ||
|
|
||
| mkdir -p /etc/sssd/conf.d | ||
| touch /etc/sssd/sssd.conf | ||
| echo -e "$ sudo vi /etc/sssd/sssd.conf | ||
| [sssd] | ||
| services = nss,pam,ssh | ||
| config_file_version = 2 | ||
|
|
||
| [pam] | ||
| pam_cert_auth = True | ||
|
|
||
| [domain/example.com] | ||
| ldap_user_certificate = usercertificate;binary | ||
| certificate_verification = ca_cert,ocsp | ||
| ca_cert = /etc/ssl/certs/ca-certificates.crt | ||
| " >> /etc/sssd/sssd.conf |
5 changes: 5 additions & 0 deletions
5
..._os/guide/services/sssd/sssd_certification_path_trust_anchor/tests/not_configured.fail.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,5 @@ | ||
| #!/bin/bash | ||
| # packages = sssd-common | ||
|
|
||
| mkdir -p /etc/sssd/conf.d | ||
| touch /etc/sssd/sssd.conf |
24 changes: 24 additions & 0 deletions
24
..._os/guide/services/sssd/sssd_certification_path_trust_anchor/tests/partial_config.fail.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,24 @@ | ||
| #!/bin/bash | ||
| # packages = sssd-common | ||
|
|
||
| mkdir -p /etc/sssd/conf.d | ||
| touch /etc/sssd/sssd.conf | ||
| echo -e "$ sudo vi /etc/sssd/sssd.conf | ||
| [sssd] | ||
| services = nss,pam,ssh | ||
| config_file_version = 2 | ||
|
|
||
| [pam] | ||
| pam_cert_auth = True | ||
|
|
||
| [domain/test.com] | ||
| ldap_user_certificate = usercertificate;binary | ||
| certificate_verification = ca_cert | ||
| ca_cert = /etc/ssl/certs/ca-certificates.crt | ||
|
|
||
| [domain/test2.com] | ||
| ldap_user_certificate = usercertificate;binary | ||
| certificate_verification = ca_cert | ||
| ca_cert = /etc/ssl/certs/ca-certificates.crt | ||
| " >> /etc/sssd/sssd.conf | ||
|
|
19 changes: 19 additions & 0 deletions
19
...os/guide/services/sssd/sssd_certification_path_trust_anchor/tests/partial_config2.fail.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,19 @@ | ||
| #!/bin/bash | ||
| # packages = sssd-common | ||
|
|
||
| mkdir -p /etc/sssd/conf.d | ||
| touch /etc/sssd/sssd.conf | ||
| echo -e "$ sudo vi /etc/sssd/sssd.conf | ||
| [sssd] | ||
| services = nss,pam,ssh | ||
| config_file_version = 2 | ||
|
|
||
| [pam] | ||
| pam_cert_auth = True | ||
|
|
||
| [domain/test.com] | ||
| ldap_user_certificate = usercertificate;binary | ||
| certificate_verification = ca_cert | ||
| ca_cert = /etc/ssl.crt | ||
| " >> /etc/sssd/sssd.conf | ||
|
|
18 changes: 18 additions & 0 deletions
18
...os/guide/services/sssd/sssd_certification_path_trust_anchor/tests/partial_config3.fail.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,18 @@ | ||
| #!/bin/bash | ||
| # packages = sssd-common | ||
|
|
||
| mkdir -p /etc/sssd/conf.d | ||
| touch /etc/sssd/sssd.conf | ||
| echo -e "$ sudo vi /etc/sssd/sssd.conf | ||
| [sssd] | ||
| services = nss,pam,ssh | ||
| config_file_version = 2 | ||
|
|
||
| [pam] | ||
| pam_cert_auth = True | ||
|
|
||
| [domain/test.com] | ||
| ldap_user_certificate = usercertificate;binary | ||
| certificate_verification = ca_cert | ||
| " >> /etc/sssd/sssd.conf | ||
|
|
6 changes: 6 additions & 0 deletions
6
...x_os/guide/services/sssd/sssd_certification_path_trust_anchor/tests/wrong_section.fail.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 @@ | ||
| #!/bin/bash | ||
| # packages = sssd-common | ||
|
|
||
| mkdir -p /etc/sssd/conf.d | ||
| touch /etc/sssd/sssd.conf | ||
| echo -e "[sssd]\ncertificate_verification = ca_cert,ocsp" >> /etc/sssd/sssd.conf |
2 changes: 1 addition & 1 deletion
2
linux_os/guide/services/sssd/sssd_enable_pam_services/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
2 changes: 1 addition & 1 deletion
2
linux_os/guide/services/sssd/sssd_enable_smartcards/tests/sssd_parameter_false.fail.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
2 changes: 1 addition & 1 deletion
2
linux_os/guide/services/sssd/sssd_enable_smartcards/tests/sssd_parameter_missing.fail.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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #!/bin/bash | ||
| # packages = sssd | ||
| # platform = multi_platform_fedora,Oracle Linux 7,Red Hat Virtualization 4 | ||
| # platform = multi_platform_fedora,Oracle Linux 7,Red Hat Virtualization 4,multi_platform_ubuntu | ||
|
|
||
| SSSD_FILE="/etc/sssd/sssd.conf" | ||
| echo "[pam]" > $SSSD_FILE |
2 changes: 1 addition & 1 deletion
2
...x_os/guide/services/sssd/sssd_enable_smartcards/tests/sssd_parameter_missing_file.fail.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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #!/bin/bash | ||
| # packages = sssd | ||
| # platform = multi_platform_fedora,Oracle Linux 7,Red Hat Virtualization 4 | ||
| # platform = multi_platform_fedora,Oracle Linux 7,Red Hat Virtualization 4,multi_platform_ubuntu | ||
|
|
||
| SSSD_FILE="/etc/sssd/sssd.conf" | ||
| rm -f $SSSD_FILE |
2 changes: 1 addition & 1 deletion
2
linux_os/guide/services/sssd/sssd_enable_smartcards/tests/sssd_parameter_true.pass.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
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.