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

DISA STIG SRG mappings #4940

Merged
merged 3 commits into from
Nov 6, 2019
Merged

DISA STIG SRG mappings #4940

merged 3 commits into from
Nov 6, 2019

Conversation

mralph-rh
Copy link
Contributor

Description:

  • _Description here. Updated for SRG completion

Rationale:

@openscap-ci
Copy link
Collaborator

Can one of the admins verify this patch?

Copy link
Member

@shawndwells shawndwells left a comment

Choose a reason for hiding this comment

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

Thanks @mralph-rh! Noticed this is also your first GitHub PR -- congrats!

Left a few conversational comments about some of the mappings. Some of the mappings might be able to be moved from the generic catch-all & aligned with more specific requirements.

@@ -18,6 +18,7 @@ identifiers:

references:
ospp: FMT_SMF_EXT.1
srg: SRG-OS-000433-GPOS-00193
Copy link
Member

Choose a reason for hiding this comment

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

SRG-OS-000433-GPOS-00193 relates to ASLR:

SRG-OS-000433-GPOS-00193   The operating system must implement address space layout randomization to protect its memory from unauthorized code execution.

Binaries need to be compiled with ASLR, and for the linux kernel, this would be enabled through the kernel.randomize_va_space sysctl option. A good writeup about this can be found here:
https://linux-audit.com/linux-aslr-and-kernelrandomize_va_space-setting/

For the bpf_jit_harden, would a better mapping be the catch-all of SRG-OS-000480-GPOS-00227?

SRG-OS-000433-GPOS-00193 could be mapped to the randomize_va_space check.

@@ -21,6 +21,7 @@ identifiers:

references:
anssi: NT28(R25)
srg: SRG-OS-000132-GPOS-00067
Copy link
Member

Choose a reason for hiding this comment

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

Could argue that ptrace is a management functionality. Ack.

(docs ref: https://www.kernel.org/doc/Documentation/security/Yama.txt)

@@ -18,6 +18,7 @@ identifiers:
references:
anssi: NT28(R23)
ospp: FMT_SMF_EXT.1
srg: SRG-OS-000480-GPOS-00227
Copy link
Member

Choose a reason for hiding this comment

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

Torn about this one. perf_event_paranoid "controls use of the performance events system by unprivileged users," so seems to fit nicely with SRG-OS-000132-GPOS-00067.

What was the reasoning not to use SRG-OS-000132-GPOS-00067?

Copy link
Member

Choose a reason for hiding this comment

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

SRG-OS-000132-GPOS-00067   The operating system must separate user functionality (including user interface services) from operating system management functionality.

@@ -23,6 +23,7 @@ references:
hipaa: 164.308(a)(1)(ii)(D),164.308(a)(3),164.308(a)(4),164.310(b),164.310(c),164.312(a),164.312(e)
nist: SI-11
anssi: NT28(R23)
srg: SRG-OS-000324-GPOS-00125
Copy link
Member

Choose a reason for hiding this comment

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

SRG-OS-000324-GPOS-00125 is about executing privileged functions. Ref:

SRG-OS-000324-GPOS-00125   The operating system must prevent non-privileged users from executing privileged functions to include disabling, circumventing, or altering implemented security safeguards/countermeasures.

What about using SRG-OS-000132-GPOS-00067:

SRG-OS-000132-GPOS-00067   The operating system must separate user functionality (including user interface services) from operating system management functionality.

The nuance with SRG-OS-000132-GPOS-00067 is about separating functionality. Because dmesg_restrict is about access to kernel log buffers, could argue SRG-OS-000132-GPOS-00067 limits debug/administration functionality.

@@ -20,6 +20,7 @@ identifiers:
references:
anssi: NT28(R23)
nist: SC-39
srg: SRG-OS-000480-GPOS-00227
Copy link
Member

Choose a reason for hiding this comment

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

This seems to qualify for SRG-OS-000132-GPOS-00067:

SRG-OS-000132-GPOS-00067   The operating system must separate user functionality (including user interface services) from operating system management functionality.

ref: https://sysctl-explorer.net/kernel/kptr_restrict/
"When kptr_restrict is set to (1), kernel pointers printed using the %pK format specifier will be replaced with 0’s unless the user has CAP_SYSLOG and effective user and group ids are equal to the real ids. This is because %pK checks are done at read() time rather than open() time, so if permissions are elevated between the open() and the read() (e.g via a setuid binary) then %pK will not leak kernel pointers to unprivileged users. Note, this is a temporary solution only. The correct long-term solution is to do the permission checks at open() time. Consider removing world read permissions from files that use %pK, and using dmesg_restrict to protect against uses of %pK in dmesg(8) if leaking kernel pointer values to unprivileged users is a concern."

aka kptr_restrict ensures only admins have permissions to expose kernel addresses.

@shawndwells
Copy link
Member

@openscap-ci add to whitelist

@shawndwells
Copy link
Member

@mralph-rh many staff will be on holiday through next week. Monday is a bank holiday in Brno, @redhatrises is on PTO until next week, and I'll be out through 8-NOV. Feedback may be slow until next week.

If you decide to swap out some of the SRG mappings, you can commit them locally (git commit -a -m "updated mappings") and then push (via git push). This PR will automatically be updated with your changes.

@shawndwells
Copy link
Member

@redhatrises adding to your post-vacation queue ;)

@shawndwells shawndwells added this to the 0.1.47 milestone Oct 24, 2019
@shawndwells shawndwells added enhancement General enhancements to the project. RHEL Red Hat Enterprise Linux product related. labels Oct 24, 2019
@shawndwells
Copy link
Member

Hi @mralph-rh , wanted to checkin about the PR feedback. Your hard work is really appreciated -- doing these mappings isn't very fun. Will you be able to address the comments/feedback soon?

@mralph-rh
Copy link
Contributor Author

mralph-rh commented Nov 1, 2019 via email

@mralph-rh
Copy link
Contributor Author

mralph-rh commented Nov 1, 2019 via email

@yuumasato yuumasato modified the milestones: 0.1.47, 0.1.48 Nov 5, 2019
@redhatrises
Copy link
Contributor

ack

@redhatrises redhatrises merged commit 82ce37d into ComplianceAsCode:master Nov 6, 2019
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. RHEL Red Hat Enterprise Linux product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants