Skip to content

Use drop-ins file in /etc/login.defs.d/#14438

Open
teacup-on-rockingchair wants to merge 15 commits intoComplianceAsCode:masterfrom
teacup-on-rockingchair:sle16_login_defs
Open

Use drop-ins file in /etc/login.defs.d/#14438
teacup-on-rockingchair wants to merge 15 commits intoComplianceAsCode:masterfrom
teacup-on-rockingchair:sle16_login_defs

Conversation

@teacup-on-rockingchair
Copy link
Copy Markdown
Contributor

Description:

  • Use drop-ins file in /etc/login.defs.d/

Rationale:

  • Use drop-ins file in /etc/login.defs.d/ for remediation code

@teacup-on-rockingchair teacup-on-rockingchair added this to the 0.1.81 milestone Feb 23, 2026
@teacup-on-rockingchair teacup-on-rockingchair added Ansible Ansible remediation update. SLES SUSE Linux Enterprise Server product related. labels Feb 23, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Feb 23, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Feb 23, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@teacup-on-rockingchair teacup-on-rockingchair added OVAL OVAL update. Related to the systems assessments. Bash Bash remediation update. labels Feb 23, 2026
@svet-se svet-se self-assigned this Mar 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 6, 2026

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
OVAL for rule 'xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs' differs.
--- oval:ssg-set_password_hashing_algorithm_logindefs:def:1
+++ oval:ssg-set_password_hashing_algorithm_logindefs:def:1
@@ -1,2 +1,2 @@
 criteria AND
-criterion oval:ssg-test_set_password_hashing_algorithm_logindefs:tst:1
+criterion oval:ssg-test_password_hashing_algorithm_logindefs:tst:1

bash remediation for rule 'xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs' differs.
--- xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs
+++ xccdf_org.ssgproject.content_rule_set_password_hashing_algorithm_logindefs
@@ -7,6 +7,7 @@
 # Allow multiple algorithms, but choose the first one for remediation
 #
 var_password_hashing_algorithm="$(echo $var_password_hashing_algorithm | cut -d \| -f 1)"
+
 
 # Strip any search characters in the key arg so that the key can be replaced without
 # adding any search characters to the config file.

bash remediation for rule 'xccdf_org.ssgproject.content_rule_set_password_hashing_min_rounds_logindefs' differs.
--- xccdf_org.ssgproject.content_rule_set_password_hashing_min_rounds_logindefs
+++ xccdf_org.ssgproject.content_rule_set_password_hashing_min_rounds_logindefs
@@ -2,6 +2,8 @@
 if rpm --quiet -q kernel-core; then
 
 var_password_hashing_min_rounds_login_defs=''
+
+
 
 
 config_file=/etc/login.defs

bash remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_password_warn_age_login_defs' differs.
--- xccdf_org.ssgproject.content_rule_accounts_password_warn_age_login_defs
+++ xccdf_org.ssgproject.content_rule_accounts_password_warn_age_login_defs
@@ -2,6 +2,7 @@
 if rpm --quiet -q kernel-core && { rpm --quiet -q shadow-utils; }; then
 
 var_accounts_password_warn_age_login_defs=''
+
 
 # Strip any search characters in the key arg so that the key can be replaced without
 # adding any search characters to the config file.

bash remediation for rule 'xccdf_org.ssgproject.content_rule_ensure_logrotate_activated' differs.
--- xccdf_org.ssgproject.content_rule_ensure_logrotate_activated
+++ xccdf_org.ssgproject.content_rule_ensure_logrotate_activated
@@ -2,6 +2,8 @@
 if rpm --quiet -q kernel-core && { rpm --quiet -q logrotate; }; then
 
 LOGROTATE_CONF_FILE='/etc/logrotate.conf'
+
+
 
 
 if ! rpm -q --quiet "crontabs" ; then

@teacup-on-rockingchair
Copy link
Copy Markdown
Contributor Author

@ComplianceAsCode/oracle-maintainers, @ComplianceAsCode/red-hatters, @ComplianceAsCode/ubuntu-maintainers can you please give this one a look

Copy link
Copy Markdown
Contributor

@mpurg mpurg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition! Ubuntu datastreams look ok except for one variable in the metadata.

Comment thread shared/macros/10-ansible.jinja Outdated
contains: {{{ line_regex }}}
patterns:
- '*.defs'
register: _login_defs_has_parameter
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to make this unique.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

de9c02c 🙇 should handle it

else
echo "PASS_WARN_AGE 0" >> {{{ login_defs_path }}}
fi
echo "PASS_WARN_AGE 7" >> {{{ login_defs_drop_in_path }}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file and greater_value_dropin.pass.sh appear to be same. Please double check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

de9c02c 🙇 should handle it


{{{ ansible_instantiate_variables("var_password_hashing_min_rounds_login_defs") }}}

{{% if product == 'sle16' %}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also include slmicro6

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

de9c02c 🙇 should handle it

Comment thread shared/macros/10-oval.jinja Outdated
@openshift-ci openshift-ci Bot added the needs-rebase Used by openshift-ci bot. label Apr 28, 2026
Make sure on sle16 we use /etc to apply and verify compliance to the rule, while /usr/etc maight be use only in case /etc files do not exist
@openshift-ci openshift-ci Bot removed the needs-rebase Used by openshift-ci bot. label Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ansible Ansible remediation update. Bash Bash remediation update. OVAL OVAL update. Related to the systems assessments. SLES SUSE Linux Enterprise Server product related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants