-
Notifications
You must be signed in to change notification settings - Fork 696
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 debian12 anssi bp28 minimal profile #11592
update debian12 anssi bp28 minimal profile #11592
Conversation
Hi @a-skr. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
d64b770
to
6950750
Compare
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_remember' differs.
--- xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_remember
+++ xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_remember
@@ -2,6 +2,10 @@
if rpm --quiet -q pam; then
var_password_pam_unix_remember=''
+
+
+
+
if [ -f /usr/bin/authselect ]; then
OVAL for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_interval' differs.
--- oval:ssg-accounts_passwords_pam_faillock_interval:def:1
+++ oval:ssg-accounts_passwords_pam_faillock_interval:def:1
@@ -1,19 +1,19 @@
criteria AND
criteria AND
criteria AND
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_system_pam_unix_auth:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_password_pam_unix_auth:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_system_pam_unix_auth:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_password_pam_unix_auth:tst:1
criteria AND
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_system_pam_faillock_auth:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_system_pam_faillock_account:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_password_pam_faillock_auth:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_password_pam_faillock_account:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_system_pam_faillock_auth:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_system_pam_faillock_account:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_password_pam_faillock_auth:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_password_pam_faillock_account:tst:1
criteria OR
criteria AND
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_parameter_pamd_system:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_parameter_pamd_password:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_parameter_no_faillock_conf:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_parameter_pamd_system:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_parameter_pamd_password:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_parameter_no_faillock_conf:tst:1
criteria AND
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_parameter_no_pamd_system:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_parameter_no_pamd_password:tst:1
-criterion oval:ssg-test_accounts_passwords_pam_faillock_interval_parameter_faillock_conf:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_parameter_no_pamd_system:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_parameter_no_pamd_password:tst:1
+criterion oval:ssg-test_accounts_passwords_pam_faillock_fail_interval_parameter_faillock_conf:tst:1
New content has different text for rule 'xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_rounds_password_auth'.
--- xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_rounds_password_auth
+++ xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_rounds_password_auth
@@ -10,8 +10,10 @@
In file /etc/pam.d/password-auth append rounds='xccdf_org.ssgproject.content_value_var_password_pam_unix_rounds'
to the pam_unix.so entry, as shown below:
+
password sufficient pam_unix.so ...existing_options... rounds='xccdf_org.ssgproject.content_value_var_password_pam_unix_rounds'
+
The system's default number of rounds is 5000.
[warning]:
OCIL for rule 'xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_rounds_password_auth' differs.
--- ocil:ssg-accounts_password_pam_unix_rounds_password_auth_ocil:questionnaire:1
+++ ocil:ssg-accounts_password_pam_unix_rounds_password_auth_ocil:questionnaire:1
@@ -1,6 +1,7 @@
To verify the number of rounds for the password hashing algorithm is configured, run the following command:
$ sudo grep rounds /etc/pam.d/password-auth
The output should show the following match:
+
password sufficient pam_unix.so sha512 rounds=
Is it the case that rounds is not set to <sub idref="var_password_pam_unix_rounds" /> or is commented out?
|
Note: PR updated with similar updates for intermediate, enhanced, and high profiles. |
2bb8fed
to
5fadfe2
Compare
/packit build |
/packit retest-failed |
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.
The platform value can be simplified in some rules. I also saw that some OVAL and Remediation files were duplicated from Ubuntu. It is not wrong how it was done and probably doesn't fit in the scope of this PR, but we should think in a way reduce duplication in situations like this. @dodys , could you take a look on this PR too, please?
...counts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/bash/shared.sh
Outdated
Show resolved
Hide resolved
...ts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_interval/bash/shared.sh
Outdated
Show resolved
Hide resolved
...pam/locking_out_password_attempts/accounts_passwords_pam_faillock_unlock_time/bash/shared.sh
Outdated
Show resolved
Hide resolved
...s-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_logindefs/bash/shared.sh
Outdated
Show resolved
Hide resolved
shared/templates/audit_rules_usergroup_modification/bash.template
Outdated
Show resolved
Hide resolved
🤖 A k8s content image for this PR is available at: Click here to see how to deploy itIf you alread have Compliance Operator deployed: Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: |
I believe for all those we could create/use a template instead to avoid having separate files. |
@a-skr , did you have an opportunity to see this comment from @dodys ? |
@marcusburghardt : I've seen @dodys comment, but as the comment was interrogative, I wasn't sure something more was expected in this PR. I will look into templates this week. |
By the way the "duplication" of ubuntu oval tests are actually symlinks, so there is no code duplication. If symlinks are an acceptable solution, I can factor the code more without ressorting to templates. Just tell me what you prefer. |
@marcusburghardt , @dodys : could you please review the last commit? As it is my first template, I would like a review before adding more templates to get rid of the oval symlinks and remaining code duplication. |
e1399e2
to
b36b129
Compare
@a-skr, I believe the direction is to always have templates under Thanks for working on it on this PR :) |
@dodys : can you be more specific with the indentation issue? xml and yaml are indented with two spaces, which seems similar to original files. I think I'm missing something. |
<criterion test_ref="test_accounts_password_pam_unix_remember" | ||
comment="pam_pwhistory.so is properly defined in password section of PAM file"/> | ||
comment="pam_pwhistory.so is properly defined in password section of PAM file"/> |
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.
@a-skr like here in this file
There's a lot of indentation changes.
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.
I see...
I mixed content from both ubuntu and shared oval files, but they don't use the same indentation. I will fix it with next PR update.
eea0ffa
to
f592e94
Compare
@dodys, @marcusburghardt : I think the PR is now in good shape to be merged. A pam_account_password_faillock template has been added. So far, only the rules used by Debian use the new template. If you don't mind, I prefer to refactor the remaining faillock rules in another PR. |
Could you resolve the conflicts, please? |
I will do it this week end. |
f592e94
to
a60ae94
Compare
Add some rules that were previously disabled due to prodtype.
Add some rules that were previously disabled due to prodtype.
…rd_attempts/accounts_passwords_pam_faillock_deny/bash/shared.sh Co-authored-by: Marcus Burghardt <[email protected]>
…rd_attempts/accounts_passwords_pam_faillock_interval/bash/shared.sh Co-authored-by: Marcus Burghardt <[email protected]>
…rd_attempts/accounts_passwords_pam_faillock_unlock_time/bash/shared.sh Co-authored-by: Marcus Burghardt <[email protected]>
…ng_algorithm/set_password_hashing_algorithm_logindefs/bash/shared.sh Co-authored-by: Marcus Burghardt <[email protected]>
Co-authored-by: Marcus Burghardt <[email protected]>
Co-authored-by: Marcus Burghardt <[email protected]>
Co-authored-by: Marcus Burghardt <[email protected]>
Co-authored-by: Marcus Burghardt <[email protected]>
a60ae94
to
118cf7b
Compare
note: commits amended today to solve a merge conflict. |
@a-skr some tests you touched are failing on some platforms. Do you know if that was the case already? |
Some platform (fedora, ...) were already failing before this PR. Is there is a way to run the test suite on commit bd9ef20 ? If so, we will now if I introduced issues. |
@marcusburghardt is it something you can help? |
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.
The CI tests failing for pam_faillock related rules seem legit. I have tested the rules with the master and with the changes in this PR. Only after these changes these rules are failing. These PAM related rules are complex and some rules differ a little bit based on the specific pam_faillock configuration. We should investigate if the issue is with the assessment or with the test scenarios.
{{% set module='pam_unix.so' %}} | ||
{{% set option='remember' %}} | ||
{{% set value='{{ var_password_pam_unix_remember }}' %}} | ||
{{% elif product in [ "sle12", "sle13" ] %}} |
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.
I think there is a typo here. Should it be sle15
?
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.
Thank you.
It is effectively a typo.
I will fix it ASAP.
rewrite accounts_passwords_pam_faillock_interval and accounts_passwords_pam_faillock_unlock_time to use this new template.
pam_account_password_faillock template
55c0193
to
f44e383
Compare
Code Climate has analyzed commit f44e383 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 59.4% (0.0% change). View more on Code Climate. |
I did keep the old tests unmodified. I found some bugs in the new OVAL faillock template (commit has been amended). I also found something that may be an issue with the tests: I focus on fedora to test and debug. I have this error on the test suite report:
But according to platform definitions in the test, this script should not be used with fedora? #!/bin/bash
# packages = authselect,pam
# platform = Oracle Linux 8,Oracle Linux 9,Red Hat Enterprise Linux 8,Red Hat Enterprise Linux 9
pam_files=("password-auth" "system-auth")
authselect create-profile testingProfile --base-on minimal
# --- snip --- (by the way, Is the platform definition valid? |
/packit build |
The CI job "Automatus Fedora" runs tests using RHEL 8 content on a Fedora container, the test suite does some special modification to make the tests executable. That usually works but not always. Sometimes, there are problems caused by different nature of containers - for example, there is no running dbus. Sometimes, the problem is that Fedora is different than RHEL 8. In these situations, it is necessary to run the tests locally using a virtual machine back end to determine if the fail is caused by the fedora container environment or by the actual contents of the PR. I have executed some of the tests on a RHEL 9 virtual machine backed using content built from this PR and they all pass.
Also in the logs from the GitHub job I can see this which I can't see locally
So I assume the fails aren't caused by this PR but are caused by the environment in the CI job. |
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.
I also tried with RHEL 8
jcerny@fedora:~/work/git/scap-security-guide (pr/11592)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel8 accounts_passwords_pam_faillock_deny,accounts_password_pam_retry,package_ypbind_removed,package_pam_pwquality_installed,accounts_passwords_pam_faillock_dir,accounts_password_pam_unix_remember,accounts_passwords_pam_faillock_interval,accounts_passwords_pam_faillock_unlock_time,accounts_password_pam_unix_rounds_password_auth
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2024-05-21-1426/test_suite.log
WARNING - Script argument_missing.fail.sh is not applicable on given platform
WARNING - Script correct_value.pass.sh is not applicable on given platform
WARNING - Script wrong_value.fail.sh is not applicable on given platform
WARNING - Script ubuntu_arg_missing.fail.sh is not applicable on given platform
WARNING - Script ubuntu_correct_value.pass.sh is not applicable on given platform
WARNING - Script ubuntu_wrong_value.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_expected_pam_files.pass.sh is not applicable on given platform
WARNING - Script pam_faillock_lenient_pam_files.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_multiple_pam_unix_pam_files.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_stricter_pam_files.pass.sh is not applicable on given platform
WARNING - Script ubuntu_correct.pass.sh is not applicable on given platform
WARNING - Script ubuntu_correct_pamd.pass.sh is not applicable on given platform
WARNING - Script ubuntu_empty_faillock_conf.fail.sh is not applicable on given platform
WARNING - Script ubuntu_multiple_pam_unix.fail.sh is not applicable on given platform
WARNING - Script ubuntu_wrong_value.fail.sh is not applicable on given platform
WARNING - Script ubuntu_commented_values.fail.sh is not applicable on given platform
WARNING - Script ubuntu_missing_pamd.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_expected_pam_files.pass.sh is not applicable on given platform
WARNING - Script pam_faillock_lenient_pam_files.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_multiple_pam_unix_pam_files.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_stricter_pam_files.pass.sh is not applicable on given platform
WARNING - Script ubuntu_correct.pass.sh is not applicable on given platform
WARNING - Script ubuntu_correct_pamd.pass.sh is not applicable on given platform
WARNING - Script ubuntu_empty_faillock_conf.fail.sh is not applicable on given platform
WARNING - Script ubuntu_multiple_pam_unix.fail.sh is not applicable on given platform
WARNING - Script ubuntu_wrong_value.fail.sh is not applicable on given platform
WARNING - Script ubuntu_commented_values.fail.sh is not applicable on given platform
WARNING - Script ubuntu_missing_pamd.fail.sh is not applicable on given platform
WARNING - Script ubuntu_wrong_value.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_expected_pam_files.pass.sh is not applicable on given platform
WARNING - Script pam_faillock_lenient_pam_files.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_multiple_pam_unix_pam_files.fail.sh is not applicable on given platform
WARNING - Script pam_faillock_stricter_pam_files.pass.sh is not applicable on given platform
WARNING - Script ubuntu_correct.pass.sh is not applicable on given platform
WARNING - Script ubuntu_correct_pamd.pass.sh is not applicable on given platform
WARNING - Script ubuntu_empty_faillock_conf.fail.sh is not applicable on given platform
WARNING - Script ubuntu_multiple_pam_unix.fail.sh is not applicable on given platform
WARNING - Script ubuntu_commented_values.fail.sh is not applicable on given platform
WARNING - Script ubuntu_missing_pamd.fail.sh is not applicable on given platform
WARNING - Script correct_value.pass.sh is not applicable on given platform
WARNING - Script wrong_value.fail.sh is not applicable on given platform
WARNING - Script explicit_rounds.pass.sh is not applicable on given platform
WARNING - Script less_rounds.fail.sh is not applicable on given platform
WARNING - Script wrong_control.fail.sh is not applicable on given platform
WARNING - Script default_rounds.fail.sh is not applicable on given platform
INFO - xccdf_org.ssgproject.content_rule_package_ypbind_removed
INFO - Script package-installed.fail.sh using profile (all) OK
INFO - Script package-installed-removed.pass.sh using profile (all) OK
INFO - Script package-removed.pass.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_remember
INFO - Script authselect_conflict_settings.fail.sh using profile (all) OK
INFO - Script authselect_correct_value_conf.pass.sh using profile (all) OK
INFO - Script authselect_correct_value_pam.pass.sh using profile (all) OK
INFO - Script authselect_missing_argument.fail.sh using profile (all) OK
INFO - Script authselect_missing_line.fail.sh using profile (all) OK
INFO - Script authselect_modified_pam.fail.sh using profile (all) OK
INFO - Script authselect_pam_unix_legacy_correct.pass.sh using profile (all) OK
INFO - Script authselect_pam_unix_legacy_wrong.fail.sh using profile (all) OK
INFO - Script authselect_wrong_value_conf.fail.sh using profile (all) OK
INFO - Script authselect_wrong_value_pam.fail.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny
INFO - Script authselect_modified_pam.fail.sh using profile (all) OK
INFO - Script conflicting_settings_authselect.fail.sh using profile (all) OK
INFO - Script pam_faillock_conflicting_settings.fail.sh using profile (all) OK
INFO - Script pam_faillock_expected_faillock_conf.pass.sh using profile (all) OK
INFO - Script pam_faillock_lenient_faillock_conf.fail.sh using profile (all) OK
INFO - Script pam_faillock_multiple_pam_unix_faillock_conf.fail.sh using profile (all) OK
INFO - Script pam_faillock_stricter_faillock_conf.pass.sh using profile (all) OK
INFO - Script pam_faillock_disabled.fail.sh using profile (all) OK
INFO - Script pam_faillock_not_required_pam_files.fail.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_dir
INFO - Script conflicting_settings_authselect.fail.sh using profile (all) OK
INFO - Script expected_faillock_conf.pass.sh using profile (all) OK
INFO - Script expected_pam_files.pass.sh using profile (all) OK
INFO - Script missing_dir_in_authfail.fail.sh using profile (all) OK
INFO - Script missing_dir_in_preauth.fail.sh using profile (all) OK
INFO - Script wrong_faillock_conf.fail.sh using profile (all) OK
INFO - Script wrong_pam_files.fail.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_interval
INFO - Script authselect_modified_pam.fail.sh using profile (all) OK
INFO - Script conflicting_settings_authselect.fail.sh using profile (all) OK
INFO - Script pam_faillock_conflicting_settings.fail.sh using profile (all) OK
INFO - Script pam_faillock_expected_faillock_conf.pass.sh using profile (all) OK
INFO - Script pam_faillock_lenient_faillock_conf.fail.sh using profile (all) OK
INFO - Script pam_faillock_multiple_pam_unix_faillock_conf.fail.sh using profile (all) OK
INFO - Script pam_faillock_stricter_faillock_conf.pass.sh using profile (all) OK
INFO - Script pam_faillock_disabled.fail.sh using profile (all) OK
INFO - Script pam_faillock_not_required_pam_files.fail.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_unlock_time
INFO - Script authselect_modified_pam.fail.sh using profile (all) OK
INFO - Script conflicting_settings_authselect.fail.sh using profile (all) OK
INFO - Script pam_faillock_conflicting_settings.fail.sh using profile (all) OK
INFO - Script pam_faillock_expected_faillock_conf.pass.sh using profile (all) OK
INFO - Script pam_faillock_lenient_faillock_conf.fail.sh using profile (all) OK
INFO - Script pam_faillock_multiple_pam_unix_faillock_conf.fail.sh using profile (all) OK
INFO - Script pam_faillock_stricter_faillock_conf.pass.sh using profile (all) OK
INFO - Script pam_faillock_disabled.fail.sh using profile (all) OK
INFO - Script pam_faillock_not_required_pam_files.fail.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_package_pam_pwquality_installed
INFO - Script package-installed.pass.sh using profile (all) OK
INFO - Script package-removed.fail.sh using profile (all) OK
INFO - Script package-installed-removed.fail.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_accounts_password_pam_retry
INFO - Script argument_missing.fail.sh using profile (all) OK
INFO - Script pwquality_conf_commented.fail.sh using profile (all) OK
INFO - Script pwquality_conf_conflicting_values.fail.sh using profile (all) OK
INFO - Script pwquality_conf_correct.pass.sh using profile (all) OK
INFO - Script pwquality_conf_correct_with_space.pass.sh using profile (all) OK
INFO - Script pwquality_conf_duplicate_values.pass.sh using profile (all) OK
INFO - Script pwquality_conf_overriden.fail.sh using profile (all) OK
INFO - Script pwquality_conf_wrong.fail.sh using profile (all) OK
INFO - xccdf_org.ssgproject.content_rule_accounts_password_pam_unix_rounds_password_auth
INFO - Script authselect_argument_missing.fail.sh using profile (all) OK
INFO - Script authselect_correct_value.pass.sh using profile (all) OK
INFO - Script authselect_modified_pam.fail.sh using profile (all) OK
INFO - Script authselect_wrong_control.fail.sh using profile (all) OK
INFO - Script authselect_wrong_value.fail.sh using profile (all) OK
INFO - Script authselect_default_rounds.fail.sh using profile (all) OK
conlficts have been resolved by rebase
Description: