Skip to content

Commit ed3fffa

Browse files
israel-villarclaude
andcommitted
Guard OVAL def-group for debian/ubuntu/sle products only
Wrap <def-group> inside the existing {{% if %}} block in pwhistory_remember and pwquality_enabled shared.xml files so that products without /etc/pam.d/common-password (e.g. RHEL8/UBI8) produce empty OVAL output instead of a Jinja2 undefined-variable error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4389109 commit ed3fffa

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

  • linux_os/guide/system/accounts/accounts-pam
    • locking_out_password_attempts/accounts_password_pam_pwhistory_remember/oval
    • password_quality/password_quality_pwquality/accounts_password_pam_pwquality_enabled/oval

linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_remember/oval/shared.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{{% if "debian" in product or "ubuntu" in product %}}
22
{{%- set accounts_password_pam_file = '/etc/pam.d/common-password' -%}}
3-
{{% endif %}}
43

54
<def-group>
65
<definition class="compliance" id="{{{ rule_id }}}" version="2">
@@ -56,3 +55,4 @@
5655
</ind:textfilecontent54_object>
5756

5857
</def-group>
58+
{{% endif %}}

linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_pwquality_enabled/oval/shared.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{% if 'debian' in product or 'ubuntu' in product or product in ['sle15', 'sle16'] %}}
22
{{% set configuration_files = ["common-password"] %}}
3-
{{% endif %}}
3+
44
<def-group>
55
<definition class="compliance" id="{{{ rule_id }}}" version="2">
66
{{{ oval_metadata("Check pam_pwquality module is enabled", rule_title=rule_title) }}}
@@ -35,3 +35,4 @@
3535
test_ref="password_pam_pwquality_enabled_" ~ (file | escape_id)) }}}
3636
{{% endfor %}}
3737
</def-group>
38+
{{% endif %}}

0 commit comments

Comments
 (0)