Skip to content
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

Postfix network listening to loopback-only #4832

Merged
merged 4 commits into from
Sep 20, 2019

Conversation

70k10
Copy link
Contributor

@70k10 70k10 commented Sep 12, 2019

Description:

Add remediation and update the OVAL checks to support loopback-only inet_interface line.

Rationale:

This is a CIS requirement. Also, still accepting localhost for RHEL6 per the RHEL6 STIG so we support both that and CIS for RHEL6/7/8.

@redhatrises
Copy link
Contributor

redhatrises commented Sep 12, 2019

@70k10 Thanks for this PR! Can you make the inet_interfaces options a XCCDF variable instead of hardcoded? That way you can select the variable based off of the OS and profile.

@@ -22,7 +22,11 @@

<ind:textfilecontent54_object id="obj_postfix_network_listening_disabled" comment="inet_interfaces in /etc/postfix/main.cf should be set correctly" version="1">
<ind:filepath>/etc/postfix/main.cf</ind:filepath>
<ind:pattern operation="pattern match">^[\s]*inet_interfaces[\s]*=[\s]*localhost[\s]*$</ind:pattern>
{{% if product == "rhel6" %}}
<ind:pattern operation="pattern match">^[\s]*inet_interfaces[\s]*=[\s]*(localhost|loopback-only)[\s]*$</ind:pattern>
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of inet_interfaces[\s]*=[\s]*(localhost|loopback-only), let's make this a variable for customization sake.
See linux_os/guide/system/auditing/configure_auditd_data_retention/auditd_data_retention_flush/rule.yml and linux_os/guide/system/auditing/configure_auditd_data_retention/var_auditd_flush.var for an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing, thanks for the reference.

@70k10
Copy link
Contributor Author

70k10 commented Sep 13, 2019

@redhatrises Updated the check/remediation with a new variable. I think it is right, but scap-workbench was acting strange so it was hard to tell if the RHEL6 STIG applied the variable properly. I did see my changes in the ds-1.2.xml though.

<ind:instance datatype="int">1</ind:instance>
</ind:textfilecontent54_object>

<ind:textfilecontent54_state id="state_postfix_network_listening_disabled" version="1">
<ind:subexpression operation="equals" var_ref="var_postfix_inet_interfaces" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably should add datatype="string" here.

@redhatrises
Copy link
Contributor

@redhatrises Updated the check/remediation with a new variable. I think it is right, but scap-workbench was acting strange so it was hard to tell if the RHEL6 STIG applied the variable properly. I did see my changes in the ds-1.2.xml though.

@70k10 IIRC you need to add the datatype to the state. Also, looks like there are conflicts with cce-redhat-avail.txt.

@70k10
Copy link
Contributor Author

70k10 commented Sep 13, 2019

@redhatrises I changed the state and fixed up the CCEs. Wasn't exactly sure if the datatype was necessary there as I found another example where that was omitted.

@redhatrises redhatrises added this to the 0.1.47 milestone Sep 20, 2019
@redhatrises redhatrises added the enhancement General enhancements to the project. label Sep 20, 2019
@redhatrises redhatrises self-assigned this Sep 20, 2019
@redhatrises
Copy link
Contributor

LGTM

@redhatrises redhatrises merged commit 6d592ee into ComplianceAsCode:master Sep 20, 2019
@70k10 70k10 deleted the cis_postfix branch September 20, 2019 21:43
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancements to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants