diff --git a/.github/workflows/lint-profile.yml b/.github/workflows/lint-profile.yml index 403b88d..e173a7b 100644 --- a/.github/workflows/lint-profile.yml +++ b/.github/workflows/lint-profile.yml @@ -1,10 +1,10 @@ name: Lint & Check the Profile on: - push: - branches-ignore: - - none pull_request: + push: + branches: + - main jobs: validate: @@ -36,10 +36,6 @@ jobs: - name: Confirm git commit SHA output run: echo ${{ env.COMMIT_SHORT_SHA }} - - name: Get commit message - id: commit - run: echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.sha }})" - - name: Setup Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/verify-container.yml b/.github/workflows/verify-container.yml index 510366a..9f7399c 100644 --- a/.github/workflows/verify-container.yml +++ b/.github/workflows/verify-container.yml @@ -1,10 +1,10 @@ name: UBI9 Testing Matrix on: - push: - branches-ignore: - - none pull_request: + push: + branches: + - main jobs: validate: @@ -50,10 +50,6 @@ jobs: - name: Confirm git commit SHA output run: echo ${{ env.COMMIT_SHORT_SHA }} - - name: Get commit message - id: commit - run: echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.sha }})" - - name: Setup Ruby uses: ruby/setup-ruby@v1 with: @@ -76,7 +72,7 @@ jobs: continue-on-error: true run: bundle exec kitchen test --destroy=always ${{ matrix.suite }}-${{ env.PLATFORM }} - - name: Create our ${{ matrix.suite }} results summary + - name: Save our ${{ matrix.suite }} results summary continue-on-error: true if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} uses: mitre/saf_action@v1.5.2 @@ -85,16 +81,16 @@ jobs: - name: Save Test Result JSON if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{ github.workflow }}-${{ env.COMMIT_SHORT_SHA }}-results + name: ${{ env.PLATFORM }}_${{ matrix.suite }}.json path: spec/results/ - name: Upload ${{ matrix.suite }} to Heimdall if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} continue-on-error: true run: | - curl -# -s -F data=@spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F "filename=${{ env.COMMIT_SHORT_SHA }}-${{ env.PLATFORM }}_${{ matrix.suite }}" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }}" -H "Authorization: Api-Key ${{ secrets.HEIMDALL_UPLOAD_GROUP_KEY }}" "${{ vars.SAF_HEIMDALL_URL }}/evaluations" + curl -# -s -F data=@spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F "filename=${{ env.PLATFORM }}_${{ matrix.suite }}-${{ env.COMMIT_SHORT_SHA }}.json" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }}" -H "Authorization: Api-Key ${{ secrets.SAF_HEIMDALL_UPLOAD_KEY }}" "${{ vars.SAF_HEIMDALL_URL }}/evaluations" - name: Display our ${{ matrix.suite }} results summary if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} @@ -109,8 +105,8 @@ jobs: cat spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}-data.json | python markdown-summary.py > spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}-markdown-summary.md cat spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}-markdown-summary.md >> $GITHUB_STEP_SUMMARY - - name: Ensure the scan meets our ${{ matrix.suite }} results threshold ${{ env.PLATFORM }}_${{ matrix.suite }}.threshold.yml + - name: Ensure the scan meets our ${{ matrix.suite }} results threshold if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} uses: mitre/saf_action@v1.5.2 with: - command_string: "validate threshold -i spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F ${{ env.PLATFORM }}_${{ matrix.suite }}.threshold.yml" + command_string: "validate threshold -i spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F ubi9_${{ matrix.suite }}.threshold.yml" diff --git a/.github/workflows/verify-disa-hardened-ec2.yml b/.github/workflows/verify-disa-hardened-ec2.yml index 59edeb7..90a6366 100644 --- a/.github/workflows/verify-disa-hardened-ec2.yml +++ b/.github/workflows/verify-disa-hardened-ec2.yml @@ -1,10 +1,10 @@ name: DISA Hardened EC2 Testing Matrix on: - push: - branches-ignore: - - none pull_request: + push: + branches: + - main jobs: validate: @@ -50,10 +50,6 @@ jobs: - name: Confirm git commit SHA output run: echo ${{ env.COMMIT_SHORT_SHA }} - - name: Get commit message - id: commit - run: echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.sha }})" - - name: Setup Ruby uses: ruby/setup-ruby@v1 with: @@ -76,7 +72,8 @@ jobs: continue-on-error: true run: bundle exec kitchen test --destroy=always ${{ matrix.suite }}-${{ env.PLATFORM }} - - name: Create our ${{ matrix.suite }} results summary + - name: Save our ${{ matrix.suite }} results summary + continue-on-error: true if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} uses: mitre/saf_action@v1.5.2 with: @@ -84,16 +81,16 @@ jobs: - name: Save Test Result JSON if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{ github.workflow }}-${{ env.COMMIT_SHORT_SHA }}-results + name: ${{ env.PLATFORM }}_${{ matrix.suite }}.json path: spec/results/ - name: Upload ${{ matrix.suite }} to Heimdall if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} continue-on-error: true run: | - curl -# -s -F data=@spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F "filename=${{ env.COMMIT_SHORT_SHA }}-${{ env.PLATFORM }}_${{ matrix.suite }}" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }},'Supplemental Automation Content v1r12'" -H "Authorization: Api-Key ${{ secrets.HEIMDALL_UPLOAD_GROUP_KEY }}" "${{ vars.SAF_HEIMDALL_URL }}/evaluations" + curl -# -s -F data=@spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F "filename=${{ env.PLATFORM }}_${{ matrix.suite }}-${{ env.COMMIT_SHORT_SHA }}.json" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }}" -H "Authorization: Api-Key ${{ secrets.SAF_HEIMDALL_UPLOAD_KEY }}" "${{ vars.SAF_HEIMDALL_URL }}/evaluations" - name: Display our ${{ matrix.suite }} results summary if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} diff --git a/.github/workflows/verify-ec2.yml b/.github/workflows/verify-ec2.yml index e6b36e2..ad14527 100644 --- a/.github/workflows/verify-ec2.yml +++ b/.github/workflows/verify-ec2.yml @@ -1,10 +1,10 @@ name: EC2 Testing Matrix on: - push: - branches-ignore: - - none pull_request: + push: + branches: + - main jobs: validate: @@ -50,10 +50,6 @@ jobs: - name: Confirm git commit SHA output run: echo ${{ env.COMMIT_SHORT_SHA }} - - name: Get commit message - id: commit - run: echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.sha }})" - - name: Setup Ruby uses: ruby/setup-ruby@v1 with: @@ -85,16 +81,16 @@ jobs: - name: Save Test Result JSON if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: ${{ github.workflow }}-${{ env.COMMIT_SHORT_SHA }}-results + name: ${{ env.PLATFORM }}_${{ matrix.suite }}.json path: spec/results/ - name: Upload ${{ matrix.suite }} to Heimdall if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} continue-on-error: true run: | - curl -# -s -F data=@spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F "filename=${{ env.COMMIT_SHORT_SHA }}-${{ env.PLATFORM }}_${{ matrix.suite }}" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }}" -H "Authorization: Api-Key ${{ secrets.HEIMDALL_UPLOAD_GROUP_KEY }}" "${{ vars.SAF_HEIMDALL_URL }}/evaluations" + curl -# -s -F data=@spec/results/${{ env.PLATFORM }}_${{ matrix.suite }}.json -F "filename=${{ env.PLATFORM }}_${{ matrix.suite }}-${{ env.COMMIT_SHORT_SHA }}.json" -F "public=true" -F "evaluationTags=${{ env.COMMIT_SHORT_SHA }},${{ github.repository }},${{ github.workflow }}" -H "Authorization: Api-Key ${{ secrets.SAF_HEIMDALL_UPLOAD_KEY }}" "${{ vars.SAF_HEIMDALL_URL }}/evaluations" - name: Display our ${{ matrix.suite }} results summary if: ${{ !contains(steps.commit.outputs.message, 'only-validate-profile') }} diff --git a/.gitignore b/.gitignore index cc1ed55..f020617 100644 --- a/.gitignore +++ b/.gitignore @@ -66,5 +66,10 @@ build-iPhoneSimulator/ # VS CODE / VSCODIUM .vscode + +# delta files delta.json report.md +*xccdf.xml +check-results.txt +kitchen.local.ec2.yml \ No newline at end of file diff --git a/Gemfile b/Gemfile index 5c943b8..0073d8c 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ gem 'kitchen-ec2' gem 'kitchen-inspec' gem 'kitchen-sync' gem 'kitchen-vagrant' +gem 'parser', '3.3.0.5' gem 'pry-byebug' gem 'rake' gem 'rubocop' diff --git a/README.md b/README.md index 294d5f3..b499e38 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# (WIP) RedHat Enterprise Linux 9.x Security Technical Implementation Guide InSpec Profile +# RedHat Enterprise Linux 9.x Security Technical Implementation Guide InSpec Profile -The Redhat Enterprise Linux 9.X Security Technical Implementation Guide (RHEL8.x STIG) InSpec Profile can help programs automate their compliance checks of RedHat Enterprise Linux 7.x System to Department of Defense (DoD) requirements. +The Redhat Enterprise Linux 9.X Security Technical Implementation Guide (RHEL9.x STIG) InSpec Profile can help programs automate their compliance checks of RedHat Enterprise Linux 9.x System to Department of Defense (DoD) requirements. -- Profile Version: `0.0.1` (WIP) -- RedHat Enterprise Linux 9 Security Technical Implementation Guide v1r1 +- Profile Version: `1.2.0` +- RedHat Enterprise Linux 9 Security Technical Implementation Guide v1r2 This profile was developed to reduce the time it takes to perform a security checks based upon the STIG Guidance from the Defense Information Systems Agency (DISA) in partnership between the DISA Services Directorate (SD) and the DISA Risk Management Executive (RME) office. @@ -38,12 +38,14 @@ The RHEL9.x STIG profile checks were developed to provide technical implementati ### Source Guidance -- RedHat Enterprise Linux 9 Security Technical Implementation Guide v1r1 +- RedHat Enterprise Linux 9 Security Technical Implementation Guide v1r2 ### Current Profile Statistics The profile will be tested on every commit and every release against both `vanilla` and `hardened` ubi and ec2 images using a CI/CD pipeline. The `vanilla` images are unmodified base images sourced from Red Hat itself. The `hardened` images have had their settings configured for security according to STIG guidance. Testing both vanilla and hardened configurations of both containerized and virtual machine implementations of RHEL9 is necessary to ensure the profile works in multiple environments. +Further pipelines may be employed to test different hardening content sources (e.g., Ansible code sourced directly from DISA or Red Hat). + # Getting Started and Intended Usage 1. It is intended and recommended that InSpec and the profile be run from a **"runner"** host, either from source or a local archieve - [Running the Profile](#running-the-profile) - (such as a DevOps orchestration server, an administrative management system, or a developer's workstation/laptop) against the target [ remotely over **ssh**]. @@ -56,9 +58,9 @@ The profile will be tested on every commit and every release against both `vanil ## Intended Usage - `main` vs `releases` -1. The latest `released` version of the profile is intended for use in A&A testing, formal results to AO's and IAM's etc. Please use the `released` versions of the profile in these types of workflows. +1. The latest `released` version of the profile is intended for use in A&A testing, as well as providing formal results to Authorizing Officials and IAMs. Please use the `released` versions of the profile in these types of workflows. -2. The `main` branch is a development branch that will become the next release of the profile. The `main` branch is intended for use in _developement and testing_ merge requests for the next release of the profile, and _is not intended_ be used for formal and ongoing testing on systems. +2. The `main` branch is a development branch that will become the next release of the profile. The `main` branch is intended for use in _developing and testing_ merge requests for the next release of the profile, and _is not intended_ be used for formal and ongoing testing on systems. ## Environment Aware Testing diff --git a/controls/SV-257777.rb b/controls/SV-257777.rb index 143a7c2..0f5274d 100644 --- a/controls/SV-257777.rb +++ b/controls/SV-257777.rb @@ -13,14 +13,43 @@ desc 'fix', 'Upgrade to a supported version of RHEL 9.' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61518r925316_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257777' tag rid: 'SV-257777r925318_rule' tag stig_id: 'RHEL-09-211010' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61442r925317_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + release = os.release + + # Note that versions 9.0 and 9.2 of RHEL9 are within the EUS window at + # time of writing. + + # 9.1 is not a EUS-supported release and is no longer officially supported + # by Red Hat. The date given for the expiration for 9.1 is based on the + # RHEL9 Planning Guide diagram found on Red Hat's Life Cycle page: + # https://access.redhat.com/support/policy/updates/errata/#Life_Cycle_Dates + + EOMS_DATE = { + /^9\.0/ => '31 May 2024', + /^9\.1/ => 'April 1, 2023', + /^9\.2/ => 'May 31, 2025', + /^9\.4/ => 'May 31, 2026' + }.find { |k, _v| k.match(release) }&.last + + describe "The release \"#{release}\"" do + if EOMS_DATE.nil? + it 'is a supported release' do + expect(EOMS_DATE).not_to be_nil, "Release '#{release}' has no specified support window" + end + else + it 'is still within the support window' do + expect(Date.today).to be <= Date.parse(EOMS_DATE) + end + end + end end diff --git a/controls/SV-257778.rb b/controls/SV-257778.rb index 9fdb8b4..d3da28b 100644 --- a/controls/SV-257778.rb +++ b/controls/SV-257778.rb @@ -24,14 +24,39 @@ $ sudo dnf update' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61519r925319_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257778' tag rid: 'SV-257778r925321_rule' tag stig_id: 'RHEL-09-211015' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61443r925320_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + only_if("This control takes a long time to execute so it has been disabled through 'slow_controls'") { + !input('disable_slow_controls') + } + + if input('disconnected_system') + describe 'The system is set to a `disconnected` state and you must validate the state of the system packages manually' do + skip 'The system is set to a `disconnected` state and you must validate the state of the system packages manually' + end + else + updates = linux_update.updates + package_names = updates.map { |h| h['name'] } + + describe.one do + describe 'List of out-of-date packages' do + subject { package_names } + it { should be_empty } + end + updates.each do |update| + describe package(update['name']) do + its('version') { should eq update['version'] } + end + end + end + end end diff --git a/controls/SV-257779.rb b/controls/SV-257779.rb index a60dda7..75797b2 100644 --- a/controls/SV-257779.rb +++ b/controls/SV-257779.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must display the Standard Mandatory DOD Notice and Consent Banner before granting local or remote access to the system via a command line user logon.' desc 'Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. -System use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist. - -' +System use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist.' desc 'check', 'Verify RHEL 9 displays the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a command line user logon. Check that a banner is displayed at the command line login screen with the following command: @@ -47,15 +45,36 @@ -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details."' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61520r925322_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000023-GPOS-00006' + tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088'] tag gid: 'V-257779' tag rid: 'SV-257779r925324_rule' tag stig_id: 'RHEL-09-211020' - tag gtitle: 'SRG-OS-000023-GPOS-00006' tag fix_id: 'F-61444r925323_fix' - tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088'] - tag 'documentable' tag cci: ['CCI-000048', 'CCI-001384', 'CCI-001385', 'CCI-001386', 'CCI-001387', 'CCI-001388'] - tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 3'] + tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 3'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + banner_file = file('/etc/issue') + + describe banner_file do + it { should exist } + end + + if banner_file.exist? + + banner = banner_file.content.gsub(/[\r\n\s]/, '') + expected_banner = input('banner_message_text_cli').gsub(/[\r\n\s]/, '') + + describe 'The CLI Login Banner ' do + it 'is set to the standard banner and has the correct text' do + expect(banner).to eq(expected_banner), 'Banner does not match expected text' + end + end + end end diff --git a/controls/SV-257780.rb b/controls/SV-257780.rb index 5631de7..498eebe 100644 --- a/controls/SV-257780.rb +++ b/controls/SV-257780.rb @@ -19,14 +19,34 @@ desc 'fix', 'Install and enable the latest McAfee ENSLTP package.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61521r925325_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000191-GPOS-00080' tag gid: 'V-257780' - tag rid: 'SV-257780r925327_rule' + tag rid: 'SV-257780r939261_rule' tag stig_id: 'RHEL-09-211025' - tag gtitle: 'SRG-OS-000191-GPOS-00080' tag fix_id: 'F-61445r925326_fix' - tag 'documentable' tag cci: ['CCI-001233'] tag nist: ['SI-2 (2)'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + if input('skip_endpoint_security_tool') + impact 0.0 + describe 'Implementing the Endpoint Security for Linux Threat Prevention tool is not applicable by agreement with the approval authority of the organization.' do + skip 'Implementing the Endpoint Security for Linux Threat Prevention tool is not applicable by agreement with the approval authority of the organization.' + end + else + linux_threat_prevention_package = input('linux_threat_prevention_package') + linux_threat_prevention_service = input('linux_threat_prevention_service') + describe package(linux_threat_prevention_package) do + it { should be_installed } + end + + describe processes(linux_threat_prevention_service) do + it { should exist } + end + end end diff --git a/controls/SV-257781.rb b/controls/SV-257781.rb index 9d033b9..2d99e63 100644 --- a/controls/SV-257781.rb +++ b/controls/SV-257781.rb @@ -23,4 +23,22 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable inside the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('gui_required') + impact 0.0 + describe 'skip' do + skip 'A GUI is indicated as a requirement for this system. This control is Not Applicable.' + end + else + get_default = command('systemctl get-default').stdout.strip + + describe get_default do + it { should cmp 'multi-user.target' } + end + end end diff --git a/controls/SV-257782.rb b/controls/SV-257782.rb index 75ee961..3dcabd9 100644 --- a/controls/SV-257782.rb +++ b/controls/SV-257782.rb @@ -1,9 +1,11 @@ control 'SV-257782' do title 'RHEL 9 must enable the hardware random number generator entropy gatherer service.' - desc 'The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems. + desc 'The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems. The rngd service feeds random data from hardware device to kernel random device. Quality (nonpredictable) random number generation is important for several security functions (i.e., ciphers).' - desc 'check', 'Verify that RHEL 9 has enabled the hardware random number generator entropy gatherer service with the following command: + desc 'check', 'Note: For RHEL 9 systems running with kernel FIPS mode enabled as specified by RHEL-09-671010, this requirement is Not Applicable. + +Verify that RHEL 9 has enabled the hardware random number generator entropy gatherer service with the following command: $ systemctl is-active rngd @@ -19,14 +21,29 @@ $ sudo systemctl enable --now rngd' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61523r925331_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257782' - tag rid: 'SV-257782r925333_rule' + tag rid: 'SV-257782r942961_rule' tag stig_id: 'RHEL-09-211035' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61447r925332_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('use_fips') == true + impact 0.0 + describe 'N/A' do + skip 'For RHEL 9 running with kernel FIPS mode enabled, this requirement is Not Applicable.' + end + else + describe service('rngd') do + it { should be_enabled } + it { should be_running } + end + end end diff --git a/controls/SV-257783.rb b/controls/SV-257783.rb index 3b81d83..37ec7bb 100644 --- a/controls/SV-257783.rb +++ b/controls/SV-257783.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-001665'] tag nist: ['SC-24'] + tag 'host' + + only_if('Control not applicable within a container without sudo enabled', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + describe service('systemd-journald') do + it { should be_enabled } + it { should be_running } + end end diff --git a/controls/SV-257784.rb b/controls/SV-257784.rb index 3c7add4..b7633a9 100644 --- a/controls/SV-257784.rb +++ b/controls/SV-257784.rb @@ -1,8 +1,11 @@ control 'SV-257784' do title 'The systemd Ctrl-Alt-Delete burst key sequence in RHEL 9 must be disabled.' - desc 'A locally logged-on user who presses Ctrl-Alt-Delete when at the console can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In a graphical user environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken. - -' + desc 'A locally logged-on user who presses Ctrl-Alt-Delete when at the +console can reboot the system. If accidentally pressed, as could happen in the +case of a mixed OS environment, this can create the risk of short-term loss of +availability of systems due to unintentional reboot. In a graphical user +environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is +reduced because the user will be prompted before any action is taken.' desc 'check', 'Verify RHEL 9 is configured to not reboot the system when Ctrl-Alt-Delete is pressed seven times within two seconds with the following command: $ grep -i ctrl /etc/systemd/system.conf @@ -10,24 +13,32 @@ CtrlAltDelBurstAction=none If the "CtrlAltDelBurstAction" is not set to "none", commented out, or is missing, this is a finding.' - desc 'fix', 'Configure the system to disable the CtrlAltDelBurstAction by added or modifying the following line in the "/etc/systemd/system.conf" configuration file: + desc 'fix', 'Configure the system to disable the CtrlAltDelBurstAction by added or +modifying the following line in the "/etc/systemd/system.conf" configuration +file: -CtrlAltDelBurstAction=none + CtrlAltDelBurstAction=none -Reload the daemon for this change to take effect. + Reload the daemon for this change to take effect. -$ sudo systemctl daemon-reload' + $ sudo systemctl daemon-reload' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61525r925337_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000324-GPOS-00125' tag gid: 'V-257784' tag rid: 'SV-257784r925339_rule' tag stig_id: 'RHEL-09-211045' - tag gtitle: 'SRG-OS-000324-GPOS-00125' tag fix_id: 'F-61449r925338_fix' - tag satisfies: ['SRG-OS-000324-GPOS-00125', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-002235'] tag nist: ['CM-6 b', 'AC-6 (10)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe parse_config_file('/etc/systemd/system.conf') do + its('Manager') { should include('CtrlAltDelBurstAction' => 'none') } + end end diff --git a/controls/SV-257785.rb b/controls/SV-257785.rb index 770601c..c5cb4b3 100644 --- a/controls/SV-257785.rb +++ b/controls/SV-257785.rb @@ -1,8 +1,6 @@ control 'SV-257785' do title 'The x86 Ctrl-Alt-Delete key sequence must be disabled on RHEL 9.' - desc 'A locally logged-on user who presses Ctrl-Alt-Delete when at the console can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In a graphical user environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken. - -' + desc 'A locally logged-on user who presses Ctrl-Alt-Delete when at the console can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In a graphical user environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken.' desc 'check', 'Verify RHEL 9 is not configured to reboot the system when Ctrl-Alt-Delete is pressed with the following command: $ sudo systemctl status ctrl-alt-del.target @@ -18,15 +16,28 @@ $ sudo systemctl mask --now ctrl-alt-del.target' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61526r925340_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000324-GPOS-00125' tag gid: 'V-257785' tag rid: 'SV-257785r925342_rule' tag stig_id: 'RHEL-09-211050' - tag gtitle: 'SRG-OS-000324-GPOS-00125' tag fix_id: 'F-61450r925341_fix' - tag satisfies: ['SRG-OS-000324-GPOS-00125', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-002235'] tag nist: ['CM-6 b', 'AC-6 (10)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + c = systemd_service('ctrl-alt-del.target') + + describe.one do + describe c do + its('params.LoadState') { should eq 'masked' } + end + describe c do + its('params.LoadState') { should eq 'not-found' } + end + end end diff --git a/controls/SV-257786.rb b/controls/SV-257786.rb index 18f5b75..b42cec1 100644 --- a/controls/SV-257786.rb +++ b/controls/SV-257786.rb @@ -1,8 +1,12 @@ control 'SV-257786' do title 'RHEL 9 debug-shell systemd service must be disabled.' - desc 'The debug-shell requires no authentication and provides root privileges to anyone who has physical access to the machine. While this feature is disabled by default, masking it adds an additional layer of assurance that it will not be enabled via a dependency in systemd. This also prevents attackers with physical access from trivially bypassing security on the machine through valid troubleshooting configurations and gaining root access when the system is rebooted. - -' + desc 'The debug-shell requires no authentication and provides root +privileges to anyone who has physical access to the machine. While this +feature is disabled by default, masking it adds an additional layer of +assurance that it will not be enabled via a dependency in systemd. This also +prevents attackers with physical access from trivially bypassing security on +the machine through valid troubleshooting configurations and gaining root +access when the system is rebooted.' desc 'check', 'Verify RHEL 9 is configured to mask the debug-shell systemd service with the following command: $ sudo systemctl status debug-shell.service @@ -14,19 +18,32 @@ If the "debug-shell.service" is loaded and not masked, this is a finding.' desc 'fix', 'Configure RHEL 9 to mask the debug-shell systemd service with the following command: -$ sudo systemctl disable --now debug-shell.target -$ sudo systemctl mask --now debug-shell.target' +$ sudo systemctl disable --now debug-shell.service +$ sudo systemctl mask --now debug-shell.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61527r925343_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000324-GPOS-00125' tag gid: 'V-257786' - tag rid: 'SV-257786r925345_rule' + tag rid: 'SV-257786r943026_rule' tag stig_id: 'RHEL-09-211055' - tag gtitle: 'SRG-OS-000324-GPOS-00125' - tag fix_id: 'F-61451r925344_fix' - tag satisfies: ['SRG-OS-000324-GPOS-00125', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' + tag fix_id: 'F-61451r943025_fix' tag cci: ['CCI-000366', 'CCI-002235'] tag nist: ['CM-6 b', 'AC-6 (10)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + d = systemd_service('debug-shell.service') + + describe.one do + describe d do + its('params.LoadState') { should eq 'masked' } + end + describe d do + its('params.LoadState') { should eq 'not-found' } + end + end end diff --git a/controls/SV-257787.rb b/controls/SV-257787.rb index 4cd49ed..50aa781 100644 --- a/controls/SV-257787.rb +++ b/controls/SV-257787.rb @@ -38,4 +38,36 @@ tag 'documentable' tag cci: ['CCI-000213'] tag nist: ['AC-3'] + tag 'host' + + only_if('Control not applicable within a container without sudo enabled', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + grubfile = file(input('grub_conf_path')) + grub_userfile = file(input('grub_user_conf_path')) + + describe grubfile do + it { should exist } + end + + describe grub_userfile do + it { should exist } + end + + if grubfile.exist? && grub_userfile.exist? + password_set = file(grubfile).content.lines.select { |line| line.match(/password_pbkdf2\s+\w+\s+\$\{\w+\}/) } + + describe 'The GRUB bootloader superuser password' do + it "should be set in the GRUB config file (\'#{grubfile}\')" do + expect(password_set).to_not be_empty, "No bootloader superuser password set in \'#{grubfile}\'" + end + + grub_envar = password_set.first.match(/\$\{(?\w+)\}/).captures.first + password_encrypted = file(grub_userfile).content.match(/#{grub_envar}=grub.pbkdf2/) + it "should be encrypted in the user config file (\'#{grub_userfile}\')" do + expect(password_encrypted).to eq(true), "GRUB password environment variable not set to an encrypted value in \'#{grub_userfile}\'" + end + end + end end diff --git a/controls/SV-257788.rb b/controls/SV-257788.rb index 5adf397..c877470 100644 --- a/controls/SV-257788.rb +++ b/controls/SV-257788.rb @@ -23,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container without sudo enabled', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + grubby = command('grubby --info=ALL').stdout + + describe parse_config(grubby) do + its('args') { should_not include 'systemd.confirm_spawn' } + end end diff --git a/controls/SV-257789.rb b/controls/SV-257789.rb index d4470ca..7950f72 100644 --- a/controls/SV-257789.rb +++ b/controls/SV-257789.rb @@ -11,7 +11,7 @@ The is the actual account name different from common names like root, admin, or administrator. If superusers contains easily guessable usernames, this is a finding.' - desc 'fix', %q(Configure RHEL 9 to have a unique username for the grub superuser account. + desc 'fix', 'Configure RHEL 9 to have a unique username for the grub superuser account. Edit the "/etc/grub.d/01_users" file and add or modify the following lines in the "### BEGIN /etc/grub.d/01_users ###" section: @@ -20,17 +20,41 @@ Once the superuser account has been added, update the grub.cfg file by running: -$ sudo grubby --update-kernel=ALL') +$ sudo grubby --update-kernel=ALL' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61530r925352_chk' + tag check_id: 'C-61530r943053_chk' tag severity: 'high' tag gid: 'V-257789' - tag rid: 'SV-257789r925354_rule' + tag rid: 'SV-257789r943055_rule' tag stig_id: 'RHEL-09-212020' tag gtitle: 'SRG-OS-000080-GPOS-00048' - tag fix_id: 'F-61454r925353_fix' + tag fix_id: 'F-61454r943054_fix' tag 'documentable' tag cci: ['CCI-000213'] tag nist: ['AC-3'] + tag 'host' + + only_if('Control not applicable within a container without sudo enabled', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + grubfile = file(input('grub_conf_path')) + + describe grubfile do + it { should exist } + end + + superusers_account = grubfile.content.match(/set superusers="(?\w+)"/) + + describe 'The GRUB superuser' do + it "should be set in the GRUB config file (\'#{grubfile}\')" do + expect(superusers_account).to_not be_nil, "No superuser account set in \'#{grubfile}\'" + end + unless superusers_account.nil? + it 'should not contain easily guessable usernames' do + expect(input('disallowed_grub_superusers')).to_not include(superusers_account[:superusers_account]), "Superuser account is set to easily guessable username \'#{superusers_account[:superusers_account]}\'" + end + end + end end diff --git a/controls/SV-257790.rb b/controls/SV-257790.rb index 72a1c16..c475ab3 100644 --- a/controls/SV-257790.rb +++ b/controls/SV-257790.rb @@ -23,4 +23,16 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + grubfile = file(input('grub_conf_path')) + + describe file(grubfile) do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257791.rb b/controls/SV-257791.rb index 08fb490..b1bf459 100644 --- a/controls/SV-257791.rb +++ b/controls/SV-257791.rb @@ -23,4 +23,16 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + grubfile = file(input('grub_conf_path')) + + describe file(grubfile) do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257792.rb b/controls/SV-257792.rb index 1a65ae0..fc66133 100644 --- a/controls/SV-257792.rb +++ b/controls/SV-257792.rb @@ -38,4 +38,19 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-001084'] tag nist: ['CM-6 b', 'SC-3'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + grub_stdout = command('grubby --info=ALL').stdout + setting = /vsyscall\s*=\s*none/ + + describe 'GRUB config' do + it 'should disable vsyscall' do + expect(parse_config(grub_stdout)['args']).to match(setting), 'Current GRUB configuration does not disable this setting' + expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates' + end + end end diff --git a/controls/SV-257793.rb b/controls/SV-257793.rb index 5e6421d..9f94890 100644 --- a/controls/SV-257793.rb +++ b/controls/SV-257793.rb @@ -1,8 +1,6 @@ control 'SV-257793' do title 'RHEL 9 must clear the page allocator to prevent use-after-free attacks.' - desc 'Poisoning writes an arbitrary value to freed pages, so any modification or reference to that page after being freed or before being initialized will be detected and prevented. This prevents many types of use-after-free vulnerabilities at little performance cost. Also prevents leak of data and detection of corrupted memory. - -' + desc 'Poisoning writes an arbitrary value to freed pages, so any modification or reference to that page after being freed or before being initialized will be detected and prevented. This prevents many types of use-after-free vulnerabilities at little performance cost. Also prevents leak of data and detection of corrupted memory.' desc 'check', %q(Verify that GRUB 2 is configured to enable page poisoning to mitigate use-after-free vulnerabilities. Check that the current GRUB 2 configuration has page poisoning enabled with the following command: @@ -27,15 +25,28 @@ GRUB_CMDLINE_LINUX="page_poison=1"' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61534r925364_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' + tag satisfies: ['SRG-OS-000134-GPOS-00068', 'SRG-OS-000433-GPOS-00192', 'SRG-OS-000480-GPOS-00227'] tag gid: 'V-257793' tag rid: 'SV-257793r925366_rule' tag stig_id: 'RHEL-09-212040' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61458r925365_fix' - tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000134-GPOS-00068'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-001084'] - tag nist: ['CM-6 b', 'SC-3'] + tag cci: ['CCI-001084', 'CCI-000366'] + tag nist: ['SC-3', 'CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + grub_stdout = command('grubby --info=ALL').stdout + setting = /page_poison\s*=\s*1/ + + describe 'GRUB config' do + it 'should enable page poisoning' do + expect(parse_config(grub_stdout)['args']).to match(setting), 'Current GRUB configuration does not disable this setting' + expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates' + end + end end diff --git a/controls/SV-257794.rb b/controls/SV-257794.rb index c5e2cbc..9b0c166 100644 --- a/controls/SV-257794.rb +++ b/controls/SV-257794.rb @@ -4,9 +4,7 @@ Poisoning writes an arbitrary value to freed pages, so any modification or reference to that page after being freed or before being initialized will be detected and prevented. This prevents many types of use-after-free vulnerabilities at little performance cost. Also prevents leak of data and detection of corrupted memory. -SLAB objects are blocks of physically contiguous memory. SLUB is the unqueued SLAB allocator. - -' +SLAB objects are blocks of physically contiguous memory. SLUB is the unqueued SLAB allocator.' desc 'check', %q(Verify that GRUB 2 is configured to enable poisoning of SLUB/SLAB objects to mitigate use-after-free vulnerabilities with the following commands: Check that the current GRUB 2 configuration has poisoning of SLUB/SLAB objects enabled: @@ -31,15 +29,28 @@ GRUB_CMDLINE_LINUX="slub_debug=P"' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61535r925367_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000433-GPOS-00192' + tag satisfies: ['SRG-OS-000134-GPOS-00068', 'SRG-OS-000433-GPOS-00192'] tag gid: 'V-257794' tag rid: 'SV-257794r925369_rule' tag stig_id: 'RHEL-09-212045' - tag gtitle: 'SRG-OS-000433-GPOS-00192' tag fix_id: 'F-61459r925368_fix' - tag satisfies: ['SRG-OS-000433-GPOS-00192', 'SRG-OS-000134-GPOS-00068'] - tag 'documentable' tag cci: ['CCI-001084', 'CCI-002824'] tag nist: ['SC-3', 'SI-16'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + grub_stdout = command('grubby --info=ALL').stdout + setting = /slub_debug\s*=\s*P/ + + describe 'GRUB config' do + it 'should enable page poisoning' do + expect(parse_config(grub_stdout)['args']).to match(setting), 'Current GRUB configuration does not disable this setting' + expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates' + end + end end diff --git a/controls/SV-257795.rb b/controls/SV-257795.rb index e5c72bc..a4ca347 100644 --- a/controls/SV-257795.rb +++ b/controls/SV-257795.rb @@ -1,8 +1,6 @@ control 'SV-257795' do title 'RHEL 9 must enable mitigations against processor-based vulnerabilities.' - desc 'Kernel page-table isolation is a kernel feature that mitigates the Meltdown security vulnerability and hardens the kernel against attempts to bypass kernel address space layout randomization (KASLR). - -' + desc 'Kernel page-table isolation is a kernel feature that mitigates the Meltdown security vulnerability and hardens the kernel against attempts to bypass kernel address space layout randomization (KASLR).' desc 'check', 'Verify RHEL 9 enables kernel page-table isolation with the following command: $ sudo grubby --info=ALL | grep pti @@ -27,15 +25,27 @@ GRUB_CMDLINE_LINUX="pti=on"' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61536r925370_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000433-GPOS-00193' tag gid: 'V-257795' tag rid: 'SV-257795r925372_rule' tag stig_id: 'RHEL-09-212050' - tag gtitle: 'SRG-OS-000433-GPOS-00193' tag fix_id: 'F-61460r925371_fix' - tag satisfies: ['SRG-OS-000433-GPOS-00193', 'SRG-OS-000095-GPOS-00049'] - tag 'documentable' tag cci: ['CCI-000381', 'CCI-002824'] tag nist: ['CM-7 a', 'SI-16'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + grub_stdout = command('grubby --info=ALL').stdout + setting = /pti\s*=\s*on/ + + describe 'GRUB config' do + it 'should enable page poisoning' do + expect(parse_config(grub_stdout)['args']).to match(setting), 'Current GRUB configuration does not disable this setting' + expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates' + end + end end diff --git a/controls/SV-257796.rb b/controls/SV-257796.rb index cb95eed..c0443ca 100644 --- a/controls/SV-257796.rb +++ b/controls/SV-257796.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must enable auditing of processes that start prior to the audit daemon.' desc 'Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. -If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created. - -' +If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created.' desc 'check', 'Verify that GRUB 2 is configured to enable auditing of processes that start prior to the audit daemon with the following commands: Check that the current GRUB 2 configuration enabled auditing: @@ -31,15 +29,28 @@ GRUB_CMDLINE_LINUX="audit=1"' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61537r925373_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000254-GPOS-00095'] tag gid: 'V-257796' tag rid: 'SV-257796r925375_rule' tag stig_id: 'RHEL-09-212055' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61461r925374_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000254-GPOS-00095'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001464', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AU-14 (1)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001464', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'AU-14 (1)', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + grub_stdout = command('grubby --info=ALL').stdout + setting = /audit\s*=\s*1/ + + describe 'GRUB config' do + it 'should enable page poisoning' do + expect(parse_config(grub_stdout)['args']).to match(setting), 'Current GRUB configuration does not disable this setting' + expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates' + end + end end diff --git a/controls/SV-257797.rb b/controls/SV-257797.rb index b046efc..ff1bb78 100644 --- a/controls/SV-257797.rb +++ b/controls/SV-257797.rb @@ -6,14 +6,12 @@ There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. -Restricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a nonprivileged user. - -' +Restricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a nonprivileged user.' desc 'check', %q(Verify RHEL 9 is configured to restrict access to the kernel message buffer with the following commands: Check the status of the kernel.dmesg_restrict kernel parameter. -$ sysctl kernel.dmesg_restrict +$ sudo sysctl kernel.dmesg_restrict kernel.dmesg_restrict = 1 @@ -37,15 +35,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61538r925376_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000132-GPOS-00067' tag gid: 'V-257797' - tag rid: 'SV-257797r925378_rule' + tag rid: 'SV-257797r942965_rule' tag stig_id: 'RHEL-09-213010' - tag gtitle: 'SRG-OS-000132-GPOS-00067' tag fix_id: 'F-61462r925377_fix' - tag satisfies: ['SRG-OS-000132-GPOS-00067', 'SRG-OS-000138-GPOS-00069'] - tag 'documentable' - tag cci: ['CCI-001082', 'CCI-001090'] - tag nist: ['SC-2', 'SC-4'] + tag cci: ['CCI-001090', 'CCI-001082'] + tag nist: ['SC-4', 'SC-2'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.dmesg_restrict' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257798.rb b/controls/SV-257798.rb index 80ddb9e..81007a1 100644 --- a/controls/SV-257798.rb +++ b/controls/SV-257798.rb @@ -6,14 +6,12 @@ There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. -Setting the kernel.perf_event_paranoid kernel parameter to "2" prevents attackers from gaining additional system information as a nonprivileged user. - -' +Setting the kernel.perf_event_paranoid kernel parameter to "2" prevents attackers from gaining additional system information as a nonprivileged user.' desc 'check', %q(Verify RHEL 9 is configured to prevent kernel profiling by nonprivileged users with the following commands: Check the status of the kernel.perf_event_paranoid kernel parameter. -$sysctl kernel.perf_event_paranoid +$ sudo sysctl kernel.perf_event_paranoid kernel.perf_event_paranoid = 2 @@ -36,15 +34,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61539r925379_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000132-GPOS-00067' tag gid: 'V-257798' - tag rid: 'SV-257798r925381_rule' + tag rid: 'SV-257798r942967_rule' tag stig_id: 'RHEL-09-213015' - tag gtitle: 'SRG-OS-000132-GPOS-00067' tag fix_id: 'F-61463r925380_fix' - tag satisfies: ['SRG-OS-000132-GPOS-00067', 'SRG-OS-000138-GPOS-00069'] - tag 'documentable' - tag cci: ['CCI-001082', 'CCI-001090'] - tag nist: ['SC-2', 'SC-4'] + tag cci: ['CCI-001090', 'CCI-001082'] + tag nist: ['SC-4', 'SC-2'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.perf_event_paranoid' + value = 2 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257799.rb b/controls/SV-257799.rb index f6ac2e7..f44ec1e 100644 --- a/controls/SV-257799.rb +++ b/controls/SV-257799.rb @@ -2,14 +2,12 @@ title 'RHEL 9 must prevent the loading of a new kernel for later execution.' desc 'Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. -Disabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images. - -' +Disabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images.' desc 'check', %q(Verify RHEL 9 is configured to disable kernel image loading. Check the status of the kernel.kexec_load_disabled kernel parameter with the following command: -$ sysctl kernel.kexec_load_disabled +$ sudo sysctl kernel.kexec_load_disabled kernel.kexec_load_disabled = 1 @@ -31,15 +29,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61540r925382_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257799' - tag rid: 'SV-257799r925384_rule' + tag rid: 'SV-257799r942969_rule' tag stig_id: 'RHEL-09-213020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61464r925383_fix' - tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000366-GPOS-00153'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-001749'] - tag nist: ['CM-6 b', 'CM-5 (3)'] + tag cci: ['CCI-001749', 'CCI-000366'] + tag nist: ['CM-5 (3)', 'CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.kexec_load_disabled' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257800.rb b/controls/SV-257800.rb index 6923cb2..7133ee3 100644 --- a/controls/SV-257800.rb +++ b/controls/SV-257800.rb @@ -1,11 +1,9 @@ control 'SV-257800' do title 'RHEL 9 must restrict exposed kernel pointer addresses access.' - desc 'Exposing kernel pointers (through procfs or "seq_printf()") exposes kernel writeable structures, which may contain functions pointers. If a write vulnerability occurs in the kernel, allowing write access to any of this structure, the kernel can be compromised. This option disallows any program without the CAP_SYSLOG capability to get the addresses of kernel pointers by replacing them with "0". - -' + desc 'Exposing kernel pointers (through procfs or "seq_printf()") exposes kernel writeable structures, which may contain functions pointers. If a write vulnerability occurs in the kernel, allowing write access to any of this structure, the kernel can be compromised. This option disallows any program without the CAP_SYSLOG capability to get the addresses of kernel pointers by replacing them with "0".' desc 'check', %q(Verify the runtime status of the kernel.kptr_restrict kernel parameter with the following command: -$ sysctl kernel.kptr_restrict +$ sudo sysctl kernel.kptr_restrict kernel.kptr_restrict = 1 @@ -25,15 +23,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61541r925385_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000132-GPOS-00067' tag gid: 'V-257800' - tag rid: 'SV-257800r925387_rule' + tag rid: 'SV-257800r942971_rule' tag stig_id: 'RHEL-09-213025' - tag gtitle: 'SRG-OS-000132-GPOS-00067' tag fix_id: 'F-61465r925386_fix' - tag satisfies: ['SRG-OS-000132-GPOS-00067', 'SRG-OS-000433-GPOS-00192', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001082', 'CCI-002824'] tag nist: ['CM-6 b', 'SC-2', 'SI-16'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.kptr_restrict' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257801.rb b/controls/SV-257801.rb index 31d3185..cfdd057 100644 --- a/controls/SV-257801.rb +++ b/controls/SV-257801.rb @@ -1,8 +1,6 @@ control 'SV-257801' do title 'RHEL 9 must enable kernel parameters to enforce discretionary access control on hardlinks.' - desc 'By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigates vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat(). - -' + desc 'By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigates vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat().' desc 'check', %q(Verify RHEL 9 is configured to enable DAC on hardlinks. Check the status of the fs.protected_hardlinks kernel parameter with the following command: @@ -31,15 +29,42 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61542r925388_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000312-GPOS-00123' + tag satisfies: ['SRG-OS-000312-GPOS-00122', 'SRG-OS-000312-GPOS-00123', 'SRG-OS-000312-GPOS-00124', 'SRG-OS-000324-GPOS-00125'] tag gid: 'V-257801' tag rid: 'SV-257801r925390_rule' tag stig_id: 'RHEL-09-213030' - tag gtitle: 'SRG-OS-000312-GPOS-00123' tag fix_id: 'F-61466r925389_fix' - tag satisfies: ['SRG-OS-000312-GPOS-00123', 'SRG-OS-000324-GPOS-00125'] - tag 'documentable' tag cci: ['CCI-002165', 'CCI-002235'] tag nist: ['AC-3 (4)', 'AC-6 (10)'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'fs.protected_hardlinks' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257802.rb b/controls/SV-257802.rb index a54074f..753e166 100644 --- a/controls/SV-257802.rb +++ b/controls/SV-257802.rb @@ -1,8 +1,6 @@ control 'SV-257802' do title 'RHEL 9 must enable kernel parameters to enforce discretionary access control on symlinks.' - desc "By enabling the fs.protected_symlinks kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the user identifier (UID) of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat(). - -" + desc "By enabling the fs.protected_symlinks kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the user identifier (UID) of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat()." desc 'check', %q(Verify RHEL 9 is configured to enable DAC on symlinks. Check the status of the fs.protected_symlinks kernel parameter with the following command: @@ -31,15 +29,42 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61543r925391_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000312-GPOS-00123' + tag satisfies: ['SRG-OS-000312-GPOS-00122', 'SRG-OS-000312-GPOS-00123', 'SRG-OS-000312-GPOS-00124', 'SRG-OS-000324-GPOS-00125'] tag gid: 'V-257802' tag rid: 'SV-257802r925393_rule' tag stig_id: 'RHEL-09-213035' - tag gtitle: 'SRG-OS-000312-GPOS-00123' tag fix_id: 'F-61467r925392_fix' - tag satisfies: ['SRG-OS-000312-GPOS-00123', 'SRG-OS-000324-GPOS-00125'] - tag 'documentable' tag cci: ['CCI-002165', 'CCI-002235'] tag nist: ['AC-3 (4)', 'AC-6 (10)'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'fs.protected_symlinks' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257803.rb b/controls/SV-257803.rb index ec46e1b..520a1c6 100644 --- a/controls/SV-257803.rb +++ b/controls/SV-257803.rb @@ -3,7 +3,7 @@ desc 'A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers trying to debug problems.' desc 'check', %q(Verify RHEL 9 disables storing core dumps with the following commands: -$ sysctl kernel.core_pattern +$ sudo sysctl kernel.core_pattern kernel.core_pattern = |/bin/false @@ -27,14 +27,42 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61544r925394_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257803' - tag rid: 'SV-257803r925396_rule' + tag rid: 'SV-257803r942973_rule' tag stig_id: 'RHEL-09-213040' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61468r925395_fix' - tag 'documentable' tag cci: ['CCI-000366'] + tag legacy: [] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.core_pattern' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257804.rb b/controls/SV-257804.rb index c205c96..b49f992 100644 --- a/controls/SV-257804.rb +++ b/controls/SV-257804.rb @@ -14,14 +14,22 @@ blacklist atm' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61545r925397_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257804' tag rid: 'SV-257804r925399_rule' tag stig_id: 'RHEL-09-213045' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61469r925398_fix' - tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe kernel_module('atm') do + it { should be_disabled } + it { should be_blacklisted } + end end diff --git a/controls/SV-257805.rb b/controls/SV-257805.rb index 1f12c33..0d765f7 100644 --- a/controls/SV-257805.rb +++ b/controls/SV-257805.rb @@ -14,14 +14,22 @@ blacklist can' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61546r925400_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257805' tag rid: 'SV-257805r925402_rule' tag stig_id: 'RHEL-09-213050' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61470r925401_fix' - tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe kernel_module('can') do + it { should be_disabled } + it { should be_blacklisted } + end end diff --git a/controls/SV-257806.rb b/controls/SV-257806.rb index f046642..b135490 100644 --- a/controls/SV-257806.rb +++ b/controls/SV-257806.rb @@ -10,18 +10,26 @@ If the command does not return any output, or the line is commented out, and use of firewire-core is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.' desc 'fix', 'To configure the system to prevent the firewire-core kernel module from being loaded, add the following line to the file /etc/modprobe.d/firewire-core.conf (or create firewire-core.conf if it does not exist): -install firewire-core /bin/true +install firewire-core /bin/false blacklist firewire-core' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61547r925403_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257806' - tag rid: 'SV-257806r928942_rule' + tag rid: 'SV-257806r942955_rule' tag stig_id: 'RHEL-09-213055' - tag gtitle: 'SRG-OS-000095-GPOS-00049' - tag fix_id: 'F-61471r928942_fix' - tag 'documentable' + tag fix_id: 'F-61471r942954_fix' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe kernel_module('firewire_core') do + it { should be_disabled } + it { should be_blacklisted } + end end diff --git a/controls/SV-257807.rb b/controls/SV-257807.rb index 0db80c7..a9d2b99 100644 --- a/controls/SV-257807.rb +++ b/controls/SV-257807.rb @@ -1,10 +1,17 @@ control 'SV-257807' do title 'RHEL 9 must disable the Stream Control Transmission Protocol (SCTP) kernel module.' - desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + desc 'It is detrimental for operating systems to provide, or install by +default, functionality exceeding requirements or mission objectives. These +unnecessary capabilities or services are often overlooked and therefore may +remain unsecured. They increase the risk to the platform by providing +additional attack vectors. -Failing to disconnect unused protocols can result in a system compromise. + Failing to disconnect unused protocols can result in a system compromise. -The Stream Control Transmission Protocol (SCTP) is a transport layer protocol, designed to support the idea of message-oriented communication, with several streams of messages within one connection. Disabling SCTP protects the system against exploitation of any flaws in its implementation.' + The Stream Control Transmission Protocol (SCTP) is a transport layer +protocol, designed to support the idea of message-oriented communication, with +several streams of messages within one connection. Disabling SCTP protects the +system against exploitation of any flaws in its implementation.' desc 'check', 'Verify that RHEL 9 disables the ability to load the sctp kernel module with the following command: $ sudo grep -r sctp /etc/modprobe.conf /etc/modprobe.d/* @@ -18,14 +25,21 @@ blacklist sctp' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61548r925406_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257807' tag rid: 'SV-257807r925408_rule' tag stig_id: 'RHEL-09-213060' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61472r925407_fix' - tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe kernel_module('sctp') do + it { should be_disabled } + it { should be_blacklisted } + end end diff --git a/controls/SV-257808.rb b/controls/SV-257808.rb index 91d0716..1063940 100644 --- a/controls/SV-257808.rb +++ b/controls/SV-257808.rb @@ -18,14 +18,22 @@ blacklist tipc' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61549r925409_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257808' tag rid: 'SV-257808r925411_rule' tag stig_id: 'RHEL-09-213065' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61473r925410_fix' - tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe kernel_module('tipc') do + it { should be_disabled } + it { should be_blacklisted } + end end diff --git a/controls/SV-257809.rb b/controls/SV-257809.rb index 2057ed2..3d952d2 100644 --- a/controls/SV-257809.rb +++ b/controls/SV-257809.rb @@ -1,11 +1,9 @@ control 'SV-257809' do title 'RHEL 9 must implement address space layout randomization (ASLR) to protect its memory from unauthorized code execution.' - desc "Address space layout randomization (ASLR) makes it more difficult for an attacker to predict the location of attack code they have introduced into a process' address space during an attempt at exploitation. Additionally, ASLR makes it more difficult for an attacker to know the location of existing code in order to repurpose it using return oriented programming (ROP) techniques. - -" + desc "Address space layout randomization (ASLR) makes it more difficult for an attacker to predict the location of attack code they have introduced into a process' address space during an attempt at exploitation. Additionally, ASLR makes it more difficult for an attacker to know the location of existing code in order to repurpose it using return oriented programming (ROP) techniques." desc 'check', %q(Verify RHEL 9 is implementing ASLR with the following command: -$ sysctl kernel.randomize_va_space +$ sudo sysctl kernel.randomize_va_space kernel.randomize_va_space = 2 @@ -26,15 +24,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61550r925412_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000433-GPOS-00193' tag gid: 'V-257809' - tag rid: 'SV-257809r925414_rule' + tag rid: 'SV-257809r942975_rule' tag stig_id: 'RHEL-09-213070' - tag gtitle: 'SRG-OS-000433-GPOS-00193' tag fix_id: 'F-61474r925413_fix' - tag satisfies: ['SRG-OS-000433-GPOS-00193', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-002824'] - tag nist: ['CM-6 b', 'SI-16'] + tag cci: ['CCI-002824', 'CCI-000366'] + tag nist: ['SI-16', 'CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.randomize_va_space' + value = 2 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257810.rb b/controls/SV-257810.rb index 51635eb..c3df650 100644 --- a/controls/SV-257810.rb +++ b/controls/SV-257810.rb @@ -1,11 +1,9 @@ control 'SV-257810' do title 'RHEL 9 must disable access to network bpf system call from nonprivileged processes.' - desc 'Loading and accessing the packet filters programs and maps using the bpf() system call has the potential of revealing sensitive information about the kernel state. - -' + desc 'Loading and accessing the packet filters programs and maps using the bpf() system call has the potential of revealing sensitive information about the kernel state.' desc 'check', %q(Verify RHEL 9 prevents privilege escalation thru the kernel by disabling access to the bpf system call with the following commands: -$ sysctl kernel.unprivileged_bpf_disabled +$ sudo sysctl kernel.unprivileged_bpf_disabled kernel.unprivileged_bpf_disabled = 1 @@ -26,15 +24,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61551r925415_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000132-GPOS-00067' tag gid: 'V-257810' - tag rid: 'SV-257810r925417_rule' + tag rid: 'SV-257810r942977_rule' tag stig_id: 'RHEL-09-213075' - tag gtitle: 'SRG-OS-000132-GPOS-00067' tag fix_id: 'F-61475r925416_fix' - tag satisfies: ['SRG-OS-000132-GPOS-00067', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001082'] tag nist: ['CM-6 b', 'SC-2'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.unprivileged_bpf_disabled' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257811.rb b/controls/SV-257811.rb index bc9465b..8ff05ab 100644 --- a/controls/SV-257811.rb +++ b/controls/SV-257811.rb @@ -5,7 +5,7 @@ ' desc 'check', %q(Verify RHEL 9 restricts usage of ptrace to descendant processes with the following commands: -$ sysctl kernel.yama.ptrace_scope +$ sudo sysctl kernel.yama.ptrace_scope kernel.yama.ptrace_scope = 1 @@ -26,10 +26,10 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61552r925418_chk' + tag check_id: 'C-61552r942978_chk' tag severity: 'medium' tag gid: 'V-257811' - tag rid: 'SV-257811r925420_rule' + tag rid: 'SV-257811r942979_rule' tag stig_id: 'RHEL-09-213080' tag gtitle: 'SRG-OS-000132-GPOS-00067' tag fix_id: 'F-61476r925419_fix' @@ -37,4 +37,33 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-001082'] tag nist: ['CM-6 b', 'SC-2'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'kernel.yama.ptrace_scope' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257812.rb b/controls/SV-257812.rb index 7af4be2..19c2a0b 100644 --- a/controls/SV-257812.rb +++ b/controls/SV-257812.rb @@ -17,14 +17,22 @@ ProcessSizeMax=0' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61553r925421_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257812' tag rid: 'SV-257812r925423_rule' tag stig_id: 'RHEL-09-213085' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61477r925422_fix' - tag 'documentable' tag cci: ['CCI-000366'] + tag legacy: [] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe parse_config_file('/etc/systemd/coredump.conf') do + its('Coredump.ProcessSizeMax') { should cmp '0' } + end end diff --git a/controls/SV-257813.rb b/controls/SV-257813.rb index 8aeb336..c5af858 100644 --- a/controls/SV-257813.rb +++ b/controls/SV-257813.rb @@ -15,14 +15,22 @@ Storage=none' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61554r925424_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257813' tag rid: 'SV-257813r925426_rule' tag stig_id: 'RHEL-09-213090' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61478r925425_fix' - tag 'documentable' tag cci: ['CCI-000366'] + tag legacy: [] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe parse_config_file('/etc/systemd/coredump.conf') do + its('Coredump.Storage') { should cmp 'none' } + end end diff --git a/controls/SV-257814.rb b/controls/SV-257814.rb index 26f404f..96ffd4a 100644 --- a/controls/SV-257814.rb +++ b/controls/SV-257814.rb @@ -17,14 +17,42 @@ * hard core 0' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61555r925427_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257814' tag rid: 'SV-257814r925429_rule' tag stig_id: 'RHEL-09-213095' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61479r925428_fix' - tag 'documentable' tag cci: ['CCI-000366'] + tag legacy: [] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + setting = 'core' + expected_value = input('core_dump_expected_value') + + limits_files = command('ls /etc/security/limits.d/*.conf').stdout.strip.split + limits_files.append('/etc/security/limits.conf') + + # make sure that at least one limits.conf file has the correct setting + globally_set = limits_files.any? { |lf| !limits_conf(lf).read_params['*'].nil? && limits_conf(lf).read_params['*'].include?(['hard', setting.to_s, expected_value.to_s]) } + + # make sure that no limits.conf file has a value that contradicts the global set + failing_files = limits_files.select { |lf| + limits_conf(lf).read_params.values.flatten(1).any? { |l| + l[1].eql?(setting) && !l[2].to_i.eql?(expected_value) + } + } + describe 'Limits files' do + it 'should disallow core dumps by default' do + expect(globally_set).to eq(true), "No correct global ('*') setting found" + end + it 'should not have any conflicting settings' do + expect(failing_files).to be_empty, "Files with incorrect '#{setting}' settings:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257815.rb b/controls/SV-257815.rb index a37f31b..98bb7ca 100644 --- a/controls/SV-257815.rb +++ b/controls/SV-257815.rb @@ -21,14 +21,29 @@ $ sudo systemctl daemon-reload' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61556r925430_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257815' tag rid: 'SV-257815r925432_rule' tag stig_id: 'RHEL-09-213100' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61480r925431_fix' - tag 'documentable' tag cci: ['CCI-000366'] + tag legacy: [] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + s = systemd_service('systemd-coredump.socket') + + describe.one do + describe s do + its('params.LoadState') { should eq 'masked' } + end + describe s do + its('params.LoadState') { should eq 'not-found' } + end + end end diff --git a/controls/SV-257816.rb b/controls/SV-257816.rb index d1067db..f394390 100644 --- a/controls/SV-257816.rb +++ b/controls/SV-257816.rb @@ -5,7 +5,7 @@ Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is Not Applicable. -$ sysctl user.max_user_namespaces +$ sudo sysctl user.max_user_namespaces user.max_user_namespaces = 0 @@ -28,14 +28,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61557r925433_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257816' - tag rid: 'SV-257816r925435_rule' + tag rid: 'SV-257816r942981_rule' tag stig_id: 'RHEL-09-213105' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61481r925434_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'user.max_user_namespaces' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257817.rb b/controls/SV-257817.rb index d768505..0317000 100644 --- a/controls/SV-257817.rb +++ b/controls/SV-257817.rb @@ -15,14 +15,25 @@ $ sudo grubby --update-kernel=ALL --remove-args=noexec' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61558r925436_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000433-GPOS-00192' tag gid: 'V-257817' tag rid: 'SV-257817r925438_rule' tag stig_id: 'RHEL-09-213110' - tag gtitle: 'SRG-OS-000433-GPOS-00192' tag fix_id: 'F-61482r925437_fix' - tag 'documentable' tag cci: ['CCI-002824'] tag nist: ['SI-16'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + dmesg_nx_conf = command('dmesg | grep \'[NX|DX]*protection\'').stdout.match(/:\s+(\S+)$/).captures.first + + describe 'The no-execution bit flag' do + it 'should be set in kernel messages' do + expect(dmesg_nx_conf).to eq('active'), "dmesg does not show NX protection set to 'active'" + end + end end diff --git a/controls/SV-257818.rb b/controls/SV-257818.rb index 0b39e89..3ec9870 100644 --- a/controls/SV-257818.rb +++ b/controls/SV-257818.rb @@ -43,4 +43,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe service('kdump') do + it { should_not be_running } + its('params.LoadState') { should cmp 'masked' } + its('params.UnitFileState') { should cmp 'masked' } + end end diff --git a/controls/SV-257819.rb b/controls/SV-257819.rb index 96fb1be..aba6900 100644 --- a/controls/SV-257819.rb +++ b/controls/SV-257819.rb @@ -57,4 +57,23 @@ tag 'documentable' tag cci: ['CCI-001749'] tag nist: ['CM-5 (3)'] + tag 'host' + tag 'container' + + rpm_gpg_file = input('rpm_gpg_file') + rpm_gpg_keys = input('rpm_gpg_keys') + + describe file(rpm_gpg_file) do + it { should exist } + end + rpm_gpg_keys.each do |k, v| + describe command('rpm -q --queryformat "%{SUMMARY}\\n" gpg-pubkey | grep -i "red hat"') do + its('stdout') { should include k.to_s } + end + next unless file(rpm_gpg_file).exist? + + describe command("gpg -q --keyid-format short --with-fingerprint #{rpm_gpg_file}") do + its('stdout') { should include v } + end + end end diff --git a/controls/SV-257820.rb b/controls/SV-257820.rb index 08d236d..7c61518 100644 --- a/controls/SV-257820.rb +++ b/controls/SV-257820.rb @@ -31,4 +31,10 @@ tag 'documentable' tag cci: ['CCI-001749'] tag nist: ['CM-5 (3)'] + tag 'host', 'container' + + describe 'DNF configuration should enforce GPG signature checking' do + subject { parse_config_file('/etc/dnf/dnf.conf').params['main'] } + its('gpgcheck') { should cmp 1 } + end end diff --git a/controls/SV-257821.rb b/controls/SV-257821.rb index 5697de8..2e10267 100644 --- a/controls/SV-257821.rb +++ b/controls/SV-257821.rb @@ -21,14 +21,18 @@ localpkg_gpgcheck=1' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61562r925448_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000366-GPOS-00153' tag gid: 'V-257821' tag rid: 'SV-257821r925450_rule' tag stig_id: 'RHEL-09-214020' - tag gtitle: 'SRG-OS-000366-GPOS-00153' tag fix_id: 'F-61486r925449_fix' - tag 'documentable' tag cci: ['CCI-001749'] tag nist: ['CM-5 (3)'] + tag 'host' + tag 'container' + + describe parse_config_file('/etc/dnf/dnf.conf') do + its('main.localpkg_gpgcheck') { should match(/True|1|yes/i) } + end end diff --git a/controls/SV-257822.rb b/controls/SV-257822.rb index f730161..cd93bd4 100644 --- a/controls/SV-257822.rb +++ b/controls/SV-257822.rb @@ -27,4 +27,25 @@ tag 'documentable' tag cci: ['CCI-001749'] tag nist: ['CM-5 (3)'] + tag 'host', 'container' + + repo_def_files = command('ls /etc/yum.repos.d/*.repo').stdout.split("\n") + + if repo_def_files.empty? + describe 'No repos found in /etc/yum.repos.d/*.repo' do + skip 'No repos found in /etc/yum.repos.d/*.repo' + end + else + # pull out all repo definitions from all files into one big hash + repos = repo_def_files.map { |file| parse_config_file(file).params }.inject(&:merge) + + # check big hash for repos that fail the test condition + failing_repos = repos.keys.reject { |repo_name| repos[repo_name]['gpgcheck'] == '1' } + + describe 'All repositories' do + it 'should be configured to verify digital signatures' do + expect(failing_repos).to be_empty, "Misconfigured repositories:\n\t- #{failing_repos.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257823.rb b/controls/SV-257823.rb index cfbc1a4..f2dacee 100644 --- a/controls/SV-257823.rb +++ b/controls/SV-257823.rb @@ -30,4 +30,13 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + misconfigured_files = command("rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != \"c\"'").stdout.strip.split("\n") + + describe 'All system file hashes' do + it 'should match vendor hashes' do + expect(misconfigured_files).to be_empty, "Misconfigured files:\n\t- #{misconfigured_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257824.rb b/controls/SV-257824.rb index b6d2879..16f625c 100644 --- a/controls/SV-257824.rb +++ b/controls/SV-257824.rb @@ -15,14 +15,18 @@ clean_requirements_on_remove=1' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61565r925457_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000437-GPOS-00194' tag gid: 'V-257824' tag rid: 'SV-257824r925459_rule' tag stig_id: 'RHEL-09-214035' - tag gtitle: 'SRG-OS-000437-GPOS-00194' tag fix_id: 'F-61489r925458_fix' - tag 'documentable' tag cci: ['CCI-002617'] tag nist: ['SI-2 (6)'] + tag 'host' + tag 'container' + + describe parse_config_file('/etc/dnf/dnf.conf') do + its('main.clean_requirements_on_remove') { should match(/1|True|yes/i) } + end end diff --git a/controls/SV-257825.rb b/controls/SV-257825.rb index df29ae8..19fcd8c 100644 --- a/controls/SV-257825.rb +++ b/controls/SV-257825.rb @@ -25,4 +25,9 @@ tag 'documentable' tag cci: ['CCI-001749'] tag nist: ['CM-5 (3)'] + tag 'host', 'container' + + describe package('subscription-manager') do + it { should be_installed } + end end diff --git a/controls/SV-257826.rb b/controls/SV-257826.rb index fe40323..0583294 100644 --- a/controls/SV-257826.rb +++ b/controls/SV-257826.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must not have a File Transfer Protocol (FTP) server package installed.' desc 'The FTP service provides an unencrypted remote access that does not provide for the confidentiality and integrity of user passwords or the remote session. If a privileged user were to log on using this service, the privileged user password could be compromised. SSH or other encrypted file transfer methods must be used in place of this service. -Removing the "vsftpd" package decreases the risk of accidental activation. - -' +Removing the "vsftpd" package decreases the risk of accidental activation.' desc 'check', 'Verify that RHEL 9 does not have a File Transfer Protocol (FTP) server package installed with the following command: $ sudo dnf list --installed | grep ftp @@ -15,15 +13,24 @@ $ sudo dnf remove vsftpd' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61567r925463_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000074-GPOS-00042' tag gid: 'V-257826' tag rid: 'SV-257826r925465_rule' tag stig_id: 'RHEL-09-215015' - tag gtitle: 'SRG-OS-000074-GPOS-00042' tag fix_id: 'F-61491r925464_fix' - tag satisfies: ['SRG-OS-000074-GPOS-00042', 'SRG-OS-000095-GPOS-00049', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000197', 'CCI-000366', 'CCI-000381'] - tag nist: ['IA-5 (1) (c)', 'CM-6 b', 'CM-7 a'] + tag cci: ['CCI-000366', 'CCI-000197', 'CCI-000381'] + tag nist: ['CM-6 b', 'IA-5 (1) (c)', 'CM-7 a'] + tag 'host' + tag 'container' + + if input('ftp_required') + describe package('vsftpd') do + it { should be_installed } + end + else + describe package('vsftpd') do + it { should_not be_installed } + end + end end diff --git a/controls/SV-257827.rb b/controls/SV-257827.rb index 3b124d0..58c4361 100644 --- a/controls/SV-257827.rb +++ b/controls/SV-257827.rb @@ -1,8 +1,6 @@ control 'SV-257827' do title 'RHEL 9 must not have the sendmail package installed.' - desc 'The sendmail software was not developed with security in mind, and its design prevents it from being effectively contained by SELinux. Postfix must be used instead. - -' + desc 'The sendmail software was not developed with security in mind, and its design prevents it from being effectively contained by SELinux. Postfix must be used instead.' desc 'check', 'Verify that the sendmail package is not installed with the following command: $ sudo dnf list --installed sendmail @@ -15,15 +13,18 @@ $ sudo dnf remove sendmail' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61568r925466_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257827' tag rid: 'SV-257827r925468_rule' tag stig_id: 'RHEL-09-215020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61492r925467_fix' - tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000095-GPOS-00049'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-000381'] - tag nist: ['CM-6 b', 'CM-7 a'] + tag cci: ['CCI-000381', 'CCI-000366'] + tag nist: ['CM-7 a', 'CM-6 b'] + tag 'host' + tag 'container' + + describe package('sendmail') do + it { should_not be_installed } + end end diff --git a/controls/SV-257828.rb b/controls/SV-257828.rb index ed787aa..bda89ee 100644 --- a/controls/SV-257828.rb +++ b/controls/SV-257828.rb @@ -23,4 +23,9 @@ tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host', 'container' + + describe package('nfs-utils') do + it { should_not be_installed } + end end diff --git a/controls/SV-257829.rb b/controls/SV-257829.rb index 167a3b0..b5748f7 100644 --- a/controls/SV-257829.rb +++ b/controls/SV-257829.rb @@ -25,4 +25,9 @@ tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host', 'container' + + describe package('ypserv') do + it { should_not be_installed } + end end diff --git a/controls/SV-257830.rb b/controls/SV-257830.rb index be7f3c8..52b8327 100644 --- a/controls/SV-257830.rb +++ b/controls/SV-257830.rb @@ -13,14 +13,19 @@ $ sudo dnf remove rsh-server' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61571r925475_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' + tag satisfies: ['SRG-OS-000095-GPOS-00049', 'SRG-OS-000074-GPOS-00042'] tag gid: 'V-257830' tag rid: 'SV-257830r925477_rule' tag stig_id: 'RHEL-09-215035' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61495r925476_fix' - tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + tag 'container' + + describe package('rsh-server') do + it { should_not be_installed } + end end diff --git a/controls/SV-257831.rb b/controls/SV-257831.rb index 0dcae95..690e1e4 100644 --- a/controls/SV-257831.rb +++ b/controls/SV-257831.rb @@ -17,14 +17,18 @@ $ sudo dnf remove telnet-server' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61572r925478_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257831' tag rid: 'SV-257831r925480_rule' tag stig_id: 'RHEL-09-215040' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61496r925479_fix' - tag 'documentable' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + tag 'container' + + describe package('telnet-server') do + it { should_not be_installed } + end end diff --git a/controls/SV-257832.rb b/controls/SV-257832.rb index 2b70af0..bd0d50f 100644 --- a/controls/SV-257832.rb +++ b/controls/SV-257832.rb @@ -4,9 +4,7 @@ Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations (e.g., key missions, functions). -The gssproxy package is a proxy for GSS API credential handling and could expose secrets on some networks. It is not needed for normal function of the OS. - -' +The gssproxy package is a proxy for GSS API credential handling and could expose secrets on some networks. It is not needed for normal function of the OS.' desc 'check', 'Verify that the gssproxy package is not installed with the following command: $ sudo dnf list --installed gssproxy @@ -19,15 +17,24 @@ $ sudo dnf remove gssproxy' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61573r925481_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257832' tag rid: 'SV-257832r925483_rule' tag stig_id: 'RHEL-09-215045' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61497r925482_fix' - tag satisfies: ['SRG-OS-000095-GPOS-00049', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-000381'] - tag nist: ['CM-6 b', 'CM-7 a'] + tag cci: ['CCI-000381', 'CCI-000366'] + tag nist: ['CM-7 a', 'CM-6 b'] + tag 'host' + tag 'container' + + if input('gssproxy_required') + describe package('gssproxy') do + it { should be_installed } + end + else + describe package('gssproxy') do + it { should_not be_installed } + end + end end diff --git a/controls/SV-257833.rb b/controls/SV-257833.rb index 1aeaddb..bfeab37 100644 --- a/controls/SV-257833.rb +++ b/controls/SV-257833.rb @@ -1,12 +1,18 @@ control 'SV-257833' do title 'RHEL 9 must not have the iprutils package installed.' - desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + desc 'It is detrimental for operating systems to provide, or install by +default, functionality exceeding requirements or mission objectives. These +unnecessary capabilities or services are often overlooked and therefore may +remain unsecured. They increase the risk to the platform by providing +additional attack vectors. -Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). + Operating systems are capable of providing a wide variety of functions and +services. Some of the functions and services, provided by default, may not be +necessary to support essential organizational operations (e.g., key missions, +functions). -The iprutils package provides a suite of utilities to manage and configure SCSI devices supported by the ipr SCSI storage device driver. - -' + The iprutils package provides a suite of utilities to manage and configure +SCSI devices supported by the ipr SCSI storage device driver.' desc 'check', 'Verify that the iprutils package is not installed with the following command: $ sudo dnf list --installed iprutils @@ -19,15 +25,24 @@ $ sudo dnf remove iprutils' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61574r925484_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257833' tag rid: 'SV-257833r925486_rule' tag stig_id: 'RHEL-09-215050' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61498r925485_fix' - tag satisfies: ['SRG-OS-000095-GPOS-00049', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-000381'] tag nist: ['CM-6 b', 'CM-7 a'] + tag 'host' + tag 'container' + + if input('iprutils_required') + describe package('iprutils') do + it { should be_installed } + end + else + describe package('iprutils') do + it { should_not be_installed } + end + end end diff --git a/controls/SV-257834.rb b/controls/SV-257834.rb index 184abdc..05fd26a 100644 --- a/controls/SV-257834.rb +++ b/controls/SV-257834.rb @@ -1,12 +1,21 @@ control 'SV-257834' do title 'RHEL 9 must not have the tuned package installed.' - desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + desc 'It is detrimental for operating systems to provide, or install by +default, functionality exceeding requirements or mission objectives. These +unnecessary capabilities or services are often overlooked and therefore may +remain unsecured. They increase the risk to the platform by providing +additional attack vectors. -Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). + Operating systems are capable of providing a wide variety of functions and +services. Some of the functions and services, provided by default, may not be +necessary to support essential organizational operations (e.g., key missions, +functions). -The tuned package contains a daemon that tunes the system settings dynamically. It does so by monitoring the usage of several system components periodically. Based on that information, components will then be put into lower or higher power savings modes to adapt to the current usage. The tuned package is not needed for normal OS operations. - -' + The tuned package contains a daemon that tunes the system settings +dynamically. It does so by monitoring the usage of several system components +periodically. Based on that information, components will then be put into lower +or higher power savings modes to adapt to the current usage. The tuned package +is not needed for normal OS operations.' desc 'check', 'Verify that the tuned package is not installed with the following command: $ sudo dnf list --installed tuned @@ -19,15 +28,24 @@ $ sudo dnf remove tuned' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61575r925487_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257834' tag rid: 'SV-257834r925489_rule' tag stig_id: 'RHEL-09-215055' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61499r925488_fix' - tag satisfies: ['SRG-OS-000095-GPOS-00049', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-000381'] tag nist: ['CM-6 b', 'CM-7 a'] + tag 'host' + tag 'container' + + if input('tuned_required') + describe package('tuned') do + it { should be_installed } + end + else + describe package('tuned') do + it { should_not be_installed } + end + end end diff --git a/controls/SV-257835.rb b/controls/SV-257835.rb index e1ac75a..b242179 100644 --- a/controls/SV-257835.rb +++ b/controls/SV-257835.rb @@ -23,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + if input('tftp_required') + describe package('tftp-server') do + it { should be_installed } + end + else + describe package('tftp-server') do + it { should_not be_installed } + end + end end diff --git a/controls/SV-257836.rb b/controls/SV-257836.rb index cc96cdd..ec25f25 100644 --- a/controls/SV-257836.rb +++ b/controls/SV-257836.rb @@ -25,4 +25,9 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe package('quagga') do + it { should_not be_installed } + end end diff --git a/controls/SV-257837.rb b/controls/SV-257837.rb index 11c293f..055e4b7 100644 --- a/controls/SV-257837.rb +++ b/controls/SV-257837.rb @@ -20,14 +20,20 @@ $ sudo systemctl set-default multi-user.target' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61578r925496_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257837' tag rid: 'SV-257837r925498_rule' tag stig_id: 'RHEL-09-215070' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61502r925497_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + input('remove_xorg_x11_server_packages').each do |p| + describe package(p) do + it { should_not be_installed } + end + end end diff --git a/controls/SV-257838.rb b/controls/SV-257838.rb index e1ebd22..1d61ac3 100644 --- a/controls/SV-257838.rb +++ b/controls/SV-257838.rb @@ -1,8 +1,6 @@ control 'SV-257838' do title 'RHEL 9 must have the openssl-pkcs11 package installed.' - desc 'Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. The DOD CAC with DOD-approved PKI is an example of multifactor authentication. - -' + desc 'Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. The DOD CAC with DOD-approved PKI is an example of multifactor authentication.' desc 'check', 'Verify that RHEL 9 has the openssl-pkcs11 package installed with the following command: $ sudo dnf list --installed openssl-pkcs11 @@ -18,15 +16,28 @@ $ sudo dnf install openssl-pkcs11' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61579r925499_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000105-GPOS-00052' tag gid: 'V-257838' tag rid: 'SV-257838r925501_rule' tag stig_id: 'RHEL-09-215075' - tag gtitle: 'SRG-OS-000105-GPOS-00052' tag fix_id: 'F-61503r925500_fix' - tag satisfies: ['SRG-OS-000105-GPOS-00052', 'SRG-OS-000375-GPOS-00160', 'SRG-OS-000376-GPOS-00161', 'SRG-OS-000377-GPOS-00162'] - tag 'documentable' - tag cci: ['CCI-000765', 'CCI-001948', 'CCI-001953', 'CCI-001954'] - tag nist: ['IA-2 (1)', 'IA-2 (11)', 'IA-2 (12)', 'IA-2 (12)'] + tag cci: ['CCI-001948', 'CCI-000765', 'CCI-001953', 'CCI-001954'] + tag nist: ['IA-2 (11)', 'IA-2 (1)', 'IA-2 (12)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('smart_card_enabled') + describe package('openssl-pkcs11') do + it { should be_installed } + end + else + impact 0.0 + describe 'The system is not smartcard enabled thus this control is Not Applicable' do + skip 'The system is not using Smartcards / PIVs to fulfil the MFA requirement, this control is Not Applicable.' + end + end end diff --git a/controls/SV-257839.rb b/controls/SV-257839.rb index 23d8090..e4d0c12 100644 --- a/controls/SV-257839.rb +++ b/controls/SV-257839.rb @@ -25,4 +25,9 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe package('gnutls-utils') do + it { should be_installed } + end end diff --git a/controls/SV-257840.rb b/controls/SV-257840.rb index f2fe09a..cf11e2e 100644 --- a/controls/SV-257840.rb +++ b/controls/SV-257840.rb @@ -25,4 +25,9 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe package('nss-tools') do + it { should be_installed } + end end diff --git a/controls/SV-257841.rb b/controls/SV-257841.rb index 467b0e2..49c53db 100644 --- a/controls/SV-257841.rb +++ b/controls/SV-257841.rb @@ -15,14 +15,21 @@ $ sudo dnf install rng-tools' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61582r925508_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257841' tag rid: 'SV-257841r925510_rule' tag stig_id: 'RHEL-09-215090' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61506r925509_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe package('rng-tools') do + it { should be_installed } + end end diff --git a/controls/SV-257842.rb b/controls/SV-257842.rb index 5dcc528..e62bab6 100644 --- a/controls/SV-257842.rb +++ b/controls/SV-257842.rb @@ -7,7 +7,7 @@ Verify that the "s-nail" package is installed on the system: -$ sudo dnf list --installed mailx +$ sudo dnf list --installed s-nail s-nail.x86_64 14.9.22-6.el9 @@ -17,14 +17,22 @@ $ sudo dnf install s-nail' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61583r925511_chk' + tag check_id: 'C-61583r942958_chk' tag severity: 'medium' tag gid: 'V-257842' - tag rid: 'SV-257842r925513_rule' + tag rid: 'SV-257842r942959_rule' tag stig_id: 'RHEL-09-215095' tag gtitle: 'SRG-OS-000363-GPOS-00150' tag fix_id: 'F-61507r925512_fix' tag 'documentable' tag cci: ['CCI-001744'] tag nist: ['CM-3 (5)'] + tag 'host' + tag 'container' + + mail_package = input('mail_package') + + describe package(mail_package) do + it { should be_installed } + end end diff --git a/controls/SV-257843.rb b/controls/SV-257843.rb index 95aaec4..efef840 100644 --- a/controls/SV-257843.rb +++ b/controls/SV-257843.rb @@ -11,14 +11,45 @@ desc 'fix', 'Migrate the "/home" directory onto a separate file system/partition.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61584r925514_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257843' tag rid: 'SV-257843r925516_rule' tag stig_id: 'RHEL-09-231010' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61508r925515_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable inside a container; the host manages the container filesystem') { + !virtualization.system.eql?('docker') + } + + ignore_shells = input('non_interactive_shells').join('|') + homes = users.where { uid >= 1000 && !shell.match(ignore_shells) }.homes + root_device = etc_fstab.where { mount_point == '/' }.device_name + + if input('separate_filesystem_exempt') + impact 0.0 + describe 'This system is not required to have separate filesystems for each mount point' do + skip 'The system is managing filesystems and space via other mechanisms; this requirement is Not Applicable' + end + else + homes.each do |home| + pn_parent = Pathname.new(home).parent.to_s + home_device = etc_fstab.where { mount_point == pn_parent }.device_name + + describe "The '#{pn_parent}' mount point" do + subject { home_device } + + it 'is not on the same partition as the root partition' do + is_expected.not_to equal(root_device) + end + + it 'has its own partition' do + is_expected.not_to be_empty + end + end + end + end end diff --git a/controls/SV-257844.rb b/controls/SV-257844.rb index a592dfa..85354b9 100644 --- a/controls/SV-257844.rb +++ b/controls/SV-257844.rb @@ -11,14 +11,25 @@ desc 'fix', 'Migrate the "/tmp" path onto a separate file system.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61585r925517_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257844' tag rid: 'SV-257844r925519_rule' tag stig_id: 'RHEL-09-231015' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61509r925518_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe mount('/tmp') do + it { should be_mounted } + end + + describe etc_fstab.where { mount_point == '/tmp' } do + it { should exist } + end end diff --git a/controls/SV-257845.rb b/controls/SV-257845.rb index d398572..7083b46 100644 --- a/controls/SV-257845.rb +++ b/controls/SV-257845.rb @@ -11,14 +11,25 @@ desc 'fix', 'Migrate the "/var" path onto a separate file system.' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61586r925520_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257845' tag rid: 'SV-257845r925522_rule' tag stig_id: 'RHEL-09-231020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61510r925521_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe mount('/var') do + it { should be_mounted } + end + + describe etc_fstab.where { mount_point == '/var' } do + it { should exist } + end end diff --git a/controls/SV-257846.rb b/controls/SV-257846.rb index 8e6612c..d3a9a52 100644 --- a/controls/SV-257846.rb +++ b/controls/SV-257846.rb @@ -11,14 +11,25 @@ desc 'fix', 'Migrate the "/var/log" path onto a separate file system.' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61587r925523_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257846' tag rid: 'SV-257846r925525_rule' tag stig_id: 'RHEL-09-231025' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61511r925524_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe mount('/var/log') do + it { should be_mounted } + end + + describe etc_fstab.where { mount_point == '/var/log' } do + it { should exist } + end end diff --git a/controls/SV-257847.rb b/controls/SV-257847.rb index 26d2cf7..4b98e39 100644 --- a/controls/SV-257847.rb +++ b/controls/SV-257847.rb @@ -1,8 +1,6 @@ control 'SV-257847' do title 'RHEL 9 must use a separate file system for the system audit data path.' - desc 'Placing "/var/log/audit" in its own partition enables better separation between audit files and other system files, and helps ensure that auditing cannot be halted due to the partition running out of space. - -' + desc 'Placing "/var/log/audit" in its own partition enables better separation between audit files and other system files, and helps ensure that auditing cannot be halted due to the partition running out of space.' desc 'check', 'Verify that a separate file system/partition has been created for the system audit data path with the following command: Note: /var/log/audit is used as the example as it is a common location. @@ -15,15 +13,27 @@ desc 'fix', 'Migrate the system audit data path onto a separate file system.' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61588r925526_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000341-GPOS-00132' tag gid: 'V-257847' tag rid: 'SV-257847r925528_rule' tag stig_id: 'RHEL-09-231030' - tag gtitle: 'SRG-OS-000341-GPOS-00132' tag fix_id: 'F-61512r925527_fix' - tag satisfies: ['SRG-OS-000341-GPOS-00132', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001849'] tag nist: ['CM-6 b', 'AU-4'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_data_path = command("dirname #{auditd_conf.log_file}").stdout.strip + + describe mount(audit_data_path) do + it { should be_mounted } + end + + describe etc_fstab.where { mount_point == audit_data_path } do + it { should exist } + end end diff --git a/controls/SV-257848.rb b/controls/SV-257848.rb index 8c5f342..7ffe332 100644 --- a/controls/SV-257848.rb +++ b/controls/SV-257848.rb @@ -11,14 +11,25 @@ desc 'fix', 'Migrate the "/var/tmp" path onto a separate file system.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61589r925529_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257848' tag rid: 'SV-257848r925531_rule' tag stig_id: 'RHEL-09-231035' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61513r925530_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe mount('/var/tmp') do + it { should be_mounted } + end + + describe etc_fstab.where { mount_point == '/var/tmp' } do + it { should exist } + end end diff --git a/controls/SV-257849.rb b/controls/SV-257849.rb index fc345c9..e25fd63 100644 --- a/controls/SV-257849.rb +++ b/controls/SV-257849.rb @@ -1,8 +1,6 @@ control 'SV-257849' do title 'RHEL 9 file system automount function must be disabled unless required.' - desc 'An authentication process resists replay attacks if it is impractical to achieve a successful authentication by recording and replaying a previous authentication message. - -' + desc 'An authentication process resists replay attacks if it is impractical to achieve a successful authentication by recording and replaying a previous authentication message.' desc 'check', 'Verify that RHEL 9 file system automount function has been disabled with the following command: $ sudo systemctl is-enabled autofs @@ -17,15 +15,36 @@ $ sudo systemctl mask --now autofs.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61590r925532_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000114-GPOS-00059' tag gid: 'V-257849' tag rid: 'SV-257849r925534_rule' tag stig_id: 'RHEL-09-231040' - tag gtitle: 'SRG-OS-000114-GPOS-00059' tag fix_id: 'F-61514r925533_fix' - tag satisfies: ['SRG-OS-000114-GPOS-00059', 'SRG-OS-000378-GPOS-00163', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958'] - tag nist: ['CM-6 b', 'IA-3', 'IA-3'] + tag cci: ['CCI-000778', 'CCI-000366', 'CCI-001958'] + tag nist: ['IA-3', 'CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('autofs_required') == true + describe systemd_service('autofs.service') do + it { should be_running } + it { should be_enabled } + it { should be_installed } + end + elsif package('autofs').installed? + describe systemd_service('autofs.service') do + it { should_not be_running } + it { should_not be_enabled } + it { should_not be_installed } + end + else + impact 0.0 + describe 'The autofs service is not installed' do + skip 'The autofs service is not installed, this control is Not Applicable.' + end + end end diff --git a/controls/SV-257850.rb b/controls/SV-257850.rb index abb4976..8e1ab37 100644 --- a/controls/SV-257850.rb +++ b/controls/SV-257850.rb @@ -25,4 +25,37 @@ tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + interactive_users = passwd.where { + uid.to_i >= 1000 && shell !~ /nologin/ + } + + interactive_user_homedirs = interactive_users.homes.map { |home_path| + home_path.match(%r{^(.*)/.*$}).captures.first + }.uniq + + option = 'nosuid' + + mounted_on_root = interactive_user_homedirs.select { |dir| dir == '/' } + not_configured = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.configured? } + option_not_set = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.mount_options.flatten.include?(option) } + + describe 'All interactive user home directories' do + it "should not be mounted under root ('/')" do + expect(mounted_on_root).to be_empty, "Home directories mounted on root ('/'):\n\t- #{mounted_on_root.join("\n\t- ")}" + end + it 'should be configured in /etc/fstab' do + expect(not_configured).to be_empty, "Unconfigured home directories:\n\t- #{not_configured.join("\n\t- ")}" + end + if (option_not_set - not_configured).nil? + it "should have the '#{option}' mount option set" do + expect(option_not_set - not_configured).to be_empty, "Mounted home directories without '#{option}' set:\n\t- #{not_configured.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257851.rb b/controls/SV-257851.rb index bbcfb15..c6d34d1 100644 --- a/controls/SV-257851.rb +++ b/controls/SV-257851.rb @@ -1,8 +1,6 @@ control 'SV-257851' do title 'RHEL 9 must prevent files with the setuid and setgid bit set from being executed on file systems that contain user home directories.' - desc 'The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -' + desc 'The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.' desc 'check', 'Verify "/home" is mounted with the "nosuid" option with the following command: Note: If a separate file system has not been created for the user home directories (user home directories are mounted under "/"), this is automatically a finding, as the "nosuid" option cannot be used on the "/" system. @@ -15,15 +13,45 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/home" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61592r925538_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257851' tag rid: 'SV-257851r925540_rule' tag stig_id: 'RHEL-09-231050' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61516r925539_fix' - tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001764'] tag nist: ['CM-6 b', 'CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + interactive_users = passwd.where { + uid.to_i >= 1000 && shell !~ /nologin/ + } + + interactive_user_homedirs = interactive_users.homes.map { |home_path| + home_path.match(%r{^(.*)/.*$}).captures.first + }.uniq + + option = 'nosuid' + + mounted_on_root = interactive_user_homedirs.select { |dir| dir == '/' } + not_configured = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.configured? } + option_not_set = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.mount_options.flatten.include?(option) } + + describe 'All interactive user home directories' do + it "should not be mounted under root ('/')" do + expect(mounted_on_root).to be_empty, "Home directories mounted on root ('/'):\n\t- #{mounted_on_root.join("\n\t- ")}" + end + it 'should be configured in /etc/fstab' do + expect(not_configured).to be_empty, "Unconfigured home directories:\n\t- #{not_configured.join("\n\t- ")}" + end + if (option_not_set - not_configured).nil? + it "should have the '#{option}' mount option set" do + expect(option_not_set - not_configured).to be_empty, "Mounted home directories without '#{option}' set:\n\t- #{not_configured.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257852.rb b/controls/SV-257852.rb index a5083b5..d0b4fac 100644 --- a/controls/SV-257852.rb +++ b/controls/SV-257852.rb @@ -13,14 +13,45 @@ desc 'fix', 'Modify "/etc/fstab" to use the "noexec" option on the "/home" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61593r925541_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257852' tag rid: 'SV-257852r925543_rule' tag stig_id: 'RHEL-09-231055' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61517r925542_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + interactive_users = passwd.where { + uid.to_i >= 1000 && shell !~ /nologin/ + } + + interactive_user_homedirs = interactive_users.homes.map { |home_path| + home_path.match(%r{^(.*)/.*$}).captures.first + }.uniq + + option = 'noexec' + + mounted_on_root = interactive_user_homedirs.select { |dir| dir == '/' } + not_configured = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.configured? } + option_not_set = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.mount_options.flatten.include?(option) } + + describe 'All interactive user home directories' do + it "should not be mounted under root ('/')" do + expect(mounted_on_root).to be_empty, "Home directories mounted on root ('/'):\n\t- #{mounted_on_root.join("\n\t- ")}" + end + it 'should be configured in /etc/fstab' do + expect(not_configured).to be_empty, "Unconfigured home directories:\n\t- #{not_configured.join("\n\t- ")}" + end + if (option_not_set - not_configured).nil? + it "should have the '#{option}' mount option set" do + expect(option_not_set - not_configured).to be_empty, "Mounted home directories without '#{option}' set:\n\t- #{not_configured.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257853.rb b/controls/SV-257853.rb index bd2fdff..4184683 100644 --- a/controls/SV-257853.rb +++ b/controls/SV-257853.rb @@ -25,4 +25,31 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + nfs_mounts = etc_fstab.where { file_system_type == 'nfs' } + + if nfs_mounts.entries.empty? + impact 0.0 + describe 'Not Applicable' do + skip 'No NFS mounts are configured; this control is Not Applicable' + end + else + describe 'NFS mounts' do + it 'should have the "sec" option defined as "krb5p:krb5i:krb5"' do + nfs_mounts.each do |nfs_mount| + expect(nfs_mount.mount_options.join).to match(/sec=\w*krb5p:krb5i:krb5\w*/) + end + end + it 'should not have the "sec" option defined as "sys"' do + nfs_mounts.each do |nfs_mount| + expect(nfs_mount.mount_options.join).not_to match(/sec=\w*sys\w*/) + end + end + end + end end diff --git a/controls/SV-257854.rb b/controls/SV-257854.rb index 457c8ab..ec2bc8e 100644 --- a/controls/SV-257854.rb +++ b/controls/SV-257854.rb @@ -13,14 +13,35 @@ desc 'fix', 'Update each NFS mounted file system to use the "nodev" option on file systems that are being imported via NFS.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61595r925547_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257854' tag rid: 'SV-257854r925549_rule' tag stig_id: 'RHEL-09-231065' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61519r925548_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + option = 'nodev' + nfs_file_systems = etc_fstab.nfs_file_systems.params + failing_mounts = nfs_file_systems.reject { |mnt| mnt['mount_options'].include?(option) } + + if nfs_file_systems.empty? + describe 'No NFS' do + it 'is mounted' do + expect(nfs_file_systems).to be_empty + end + end + else + describe 'Any mounted Network File System (NFS)' do + it "should have '#{option}' set" do + expect(failing_mounts).to be_empty, "NFS without '#{option}' set:\n\t- #{failing_mounts.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257855.rb b/controls/SV-257855.rb index b9c2081..9914b41 100644 --- a/controls/SV-257855.rb +++ b/controls/SV-257855.rb @@ -13,14 +13,35 @@ desc 'fix', 'Update each NFS mounted file system to use the "noexec" option on file systems that are being imported via NFS.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61596r925550_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257855' tag rid: 'SV-257855r925552_rule' tag stig_id: 'RHEL-09-231070' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61520r925551_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + option = 'noexec' + nfs_file_systems = etc_fstab.nfs_file_systems.params + failing_mounts = nfs_file_systems.reject { |mnt| mnt['mount_options'].include?(option) } + + if nfs_file_systems.empty? + describe 'No NFS' do + it 'is mounted' do + expect(nfs_file_systems).to be_empty + end + end + else + describe 'Any mounted Network File System (NFS)' do + it "should have '#{option}' set" do + expect(failing_mounts).to be_empty, "NFS without '#{option}' set:\n\t- #{failing_mounts.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257856.rb b/controls/SV-257856.rb index 4444e20..1728cb1 100644 --- a/controls/SV-257856.rb +++ b/controls/SV-257856.rb @@ -13,14 +13,35 @@ desc 'fix', 'Update each NFS mounted file system to use the "nosuid" option on file systems that are being imported via NFS.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61597r925553_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257856' tag rid: 'SV-257856r925555_rule' tag stig_id: 'RHEL-09-231075' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61521r925554_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + option = 'nosuid' + nfs_file_systems = etc_fstab.nfs_file_systems.params + failing_mounts = nfs_file_systems.reject { |mnt| mnt['mount_options'].include?(option) } + + if nfs_file_systems.empty? + describe 'No NFS' do + it 'is mounted' do + expect(nfs_file_systems).to be_empty + end + end + else + describe 'Any mounted Network File System (NFS)' do + it "should have '#{option}' set" do + expect(failing_mounts).to be_empty, "NFS without '#{option}' set:\n\t- #{failing_mounts.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257857.rb b/controls/SV-257857.rb index dfc5086..b6614d5 100644 --- a/controls/SV-257857.rb +++ b/controls/SV-257857.rb @@ -8,17 +8,46 @@ UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat noauto,owner,ro,nosuid,nodev,noexec 0 0 If a file system found in "/etc/fstab" refers to removable media and it does not have the "noexec" option set, this is a finding.' - desc 'fix', 'Configure the "/etc/fstab" to use the "noexec" option on file systems that are associated with removable media.' + desc 'fix', 'Configure the "/etc/fstab" to use the "noexec" option on +file systems that are associated with removable media.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61598r925556_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257857' tag rid: 'SV-257857r925558_rule' tag stig_id: 'RHEL-09-231080' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61522r925557_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + option = 'noexec' + file_systems = etc_fstab.params + non_removable_media = input('non_removable_media_fs') + mounted_removeable_media = file_systems.reject { |mnt| non_removable_media.include?(mnt['mount_point']) } + failing_mounts = mounted_removeable_media.reject { |mnt| mnt['mount_options'].include?(option) } + + # be very explicit about why this one was a finding since we do not know which mounts are removeable media without the user telling us + rem_media_msg = "NOTE: Some mounted devices are not indicated to be non-removable media (you may need to update the 'non_removable_media_fs' input to check if these are truly subject to this requirement)\n" + + # there should either be no mounted removable media (which should be a requirement anyway), OR + # all removeable media should be mounted with noexec + if mounted_removeable_media.empty? + describe 'No removeable media' do + it 'are mounted' do + expect(mounted_removeable_media).to be_empty + end + end + else + describe 'Any mounted removeable media' do + it "should have '#{option}' set" do + expect(failing_mounts).to be_empty, "#{rem_media_msg}\nRemoveable media without '#{option}' set:\n\t- #{failing_mounts.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257858.rb b/controls/SV-257858.rb index dab610e..6009977 100644 --- a/controls/SV-257858.rb +++ b/controls/SV-257858.rb @@ -8,17 +8,46 @@ UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat noauto,owner,ro,nosuid,nodev,noexec 0 0 If a file system found in "/etc/fstab" refers to removable media and it does not have the "nodev" option set, this is a finding.' - desc 'fix', 'Configure the "/etc/fstab" to use the "nodev" option on file systems that are associated with removable media.' + desc 'fix', 'Configure the "/etc/fstab" to use the "nodev" option on +file systems that are associated with removable media.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61599r925559_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257858' tag rid: 'SV-257858r925561_rule' tag stig_id: 'RHEL-09-231085' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61523r925560_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + option = 'nodev' + file_systems = etc_fstab.params + non_removable_media = input('non_removable_media_fs') + mounted_removeable_media = file_systems.reject { |mnt| non_removable_media.include?(mnt['mount_point']) } + failing_mounts = mounted_removeable_media.reject { |mnt| mnt['mount_options'].include?(option) } + + # be very explicit about why this one was a finding since we do not know which mounts are removeable media without the user telling us + rem_media_msg = "NOTE: Some mounted devices are not indicated to be non-removable media (you may need to update the 'non_removable_media_fs' input to check if these are truly subject to this requirement)\n" + + # there should either be no mounted removable media (which should be a requirement anyway), OR + # all removeable media should be mounted with nodev + if mounted_removeable_media.empty? + describe 'No removeable media' do + it 'are mounted' do + expect(mounted_removeable_media).to be_empty + end + end + else + describe 'Any mounted removeable media' do + it "should have '#{option}' set" do + expect(failing_mounts).to be_empty, "#{rem_media_msg}\nRemoveable media without '#{option}' set:\n\t- #{failing_mounts.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257859.rb b/controls/SV-257859.rb index 667272a..c60d9fc 100644 --- a/controls/SV-257859.rb +++ b/controls/SV-257859.rb @@ -8,17 +8,46 @@ UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat noauto,owner,ro,nosuid,nodev,noexec 0 0 If a file system found in "/etc/fstab" refers to removable media and it does not have the "nosuid" option set, this is a finding.' - desc 'fix', 'Configure the "/etc/fstab" to use the "nosuid" option on file systems that are associated with removable media.' + desc 'fix', 'Configure the "/etc/fstab" to use the "nosuid" option on +file systems that are associated with removable media.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61600r925562_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257859' tag rid: 'SV-257859r925564_rule' tag stig_id: 'RHEL-09-231090' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61524r925563_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + option = 'nosuid' + file_systems = etc_fstab.params + non_removable_media = input('non_removable_media_fs') + mounted_removeable_media = file_systems.reject { |mnt| non_removable_media.include?(mnt['mount_point']) } + failing_mounts = mounted_removeable_media.reject { |mnt| mnt['mount_options'].include?(option) } + + # be very explicit about why this one was a finding since we do not know which mounts are removeable media without the user telling us + rem_media_msg = "NOTE: Some mounted devices are not indicated to be non-removable media (you may need to update the 'non_removable_media_fs' input to check if these are truly subject to this requirement)\n" + + # there should either be no mounted removable media (which should be a requirement anyway), OR + # all removeable media should be mounted with nosuid + if mounted_removeable_media.empty? + describe 'No removeable media' do + it 'are mounted' do + expect(mounted_removeable_media).to be_empty + end + end + else + describe 'Any mounted removeable media' do + it "should have '#{option}' set" do + expect(failing_mounts).to be_empty, "#{rem_media_msg}\nRemoveable media without '#{option}' set:\n\t- #{failing_mounts.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257860.rb b/controls/SV-257860.rb index 850b8f2..5f96509 100644 --- a/controls/SV-257860.rb +++ b/controls/SV-257860.rb @@ -23,4 +23,24 @@ tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + directory = '/boot' + parameter = 'nodev' + + if file('/sys/firmware/efi').exist? + impact 0.0 + describe 'System running UEFI' do + skip 'The System is running UEFI, this control is Not Applicable.' + end + else + describe mount(directory) do + it { should be_mounted } + its('options') { should include parameter } + end + end end diff --git a/controls/SV-257861.rb b/controls/SV-257861.rb index 0640bfe..2585193 100644 --- a/controls/SV-257861.rb +++ b/controls/SV-257861.rb @@ -1,8 +1,6 @@ control 'SV-257861' do title 'RHEL 9 must prevent files with the setuid and setgid bit set from being executed on the /boot directory.' - desc 'The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -' + desc 'The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.' desc 'check', %q(Note: For systems that use UEFI, this requirement is Not Applicable. Verify the /boot directory is mounted with the "nosuid" option with the following command: @@ -15,15 +13,29 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/boot" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61602r925568_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257861' tag rid: 'SV-257861r925570_rule' tag stig_id: 'RHEL-09-231100' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61526r925569_fix' - tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001764'] tag nist: ['CM-6 b', 'CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if file('/sys/firmware/efi').exist? + impact 0.0 + describe 'System running UEFI' do + skip 'The System is running UEFI, this control is Not Applicable.' + end + else + describe mount('/boot') do + it { should be_mounted } + its('options') { should include 'nosuid' } + end + end end diff --git a/controls/SV-257862.rb b/controls/SV-257862.rb index 9f4b6ff..6c91560 100644 --- a/controls/SV-257862.rb +++ b/controls/SV-257862.rb @@ -1,8 +1,6 @@ control 'SV-257862' do title 'RHEL 9 must prevent files with the setuid and setgid bit set from being executed on the /boot/efi directory.' - desc 'The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -' + desc 'The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.' desc 'check', %q(Note: For systems that use BIOS, this requirement is Not Applicable. Verify the /boot/efi directory is mounted with the "nosuid" option with the following command: @@ -15,15 +13,29 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/boot/efi" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61603r925571_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257862' tag rid: 'SV-257862r925573_rule' tag stig_id: 'RHEL-09-231105' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61527r925572_fix' - tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001764'] tag nist: ['CM-6 b', 'CM-7 (2)'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if file('/sys/firmware/efi').exist? + describe mount('/boot/efi') do + it { should be_mounted } + its('options') { should include 'nosuid' } + end + else + impact 0.0 + describe 'System running BIOS' do + skip 'The System is running a BIOS, this control is Not Applicable.' + end + end end diff --git a/controls/SV-257863.rb b/controls/SV-257863.rb index 86c51cd..e35666e 100644 --- a/controls/SV-257863.rb +++ b/controls/SV-257863.rb @@ -13,14 +13,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nodev" option on the "/dev/shm" file system.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61604r925574_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257863' tag rid: 'SV-257863r925576_rule' tag stig_id: 'RHEL-09-231110' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61528r925575_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/dev/shm' + option = 'nodev' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257864.rb b/controls/SV-257864.rb index baacdef..e92a2ed 100644 --- a/controls/SV-257864.rb +++ b/controls/SV-257864.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "noexec" option on the "/dev/shm" file system.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61605r925577_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257864' tag rid: 'SV-257864r925579_rule' tag stig_id: 'RHEL-09-231115' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61529r925578_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/dev/shm' + option = 'noexec' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257865.rb b/controls/SV-257865.rb index a23e8e8..b1e8a7d 100644 --- a/controls/SV-257865.rb +++ b/controls/SV-257865.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/dev/shm" file system.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61606r925580_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257865' tag rid: 'SV-257865r925582_rule' tag stig_id: 'RHEL-09-231120' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61530r925581_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/dev/shm' + option = 'nosuid' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257866.rb b/controls/SV-257866.rb index 9e98e08..35fd0a4 100644 --- a/controls/SV-257866.rb +++ b/controls/SV-257866.rb @@ -13,14 +13,39 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nodev" option on the "/tmp" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61607r925583_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257866' tag rid: 'SV-257866r925585_rule' tag stig_id: 'RHEL-09-231125' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61531r925584_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/tmp' + option = 'nodev' + mount_option_enabled = input('mount_tmp_options')[option] + + if mount_option_enabled + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end + else + describe mount(path) do + its('options') { should_not include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should_not include option } + end + end end diff --git a/controls/SV-257867.rb b/controls/SV-257867.rb index 528b6bf..85ab284 100644 --- a/controls/SV-257867.rb +++ b/controls/SV-257867.rb @@ -11,14 +11,39 @@ desc 'fix', 'Modify "/etc/fstab" to use the "noexec" option on the "/tmp" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61608r925586_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257867' tag rid: 'SV-257867r925588_rule' tag stig_id: 'RHEL-09-231130' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61532r925587_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/tmp' + option = 'noexec' + mount_option_enabled = input('mount_tmp_options')[option] + + if mount_option_enabled + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end + else + describe mount(path) do + its('options') { should_not include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should_not include option } + end + end end diff --git a/controls/SV-257868.rb b/controls/SV-257868.rb index 5e51d29..f960d2f 100644 --- a/controls/SV-257868.rb +++ b/controls/SV-257868.rb @@ -11,14 +11,39 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/tmp" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61609r925589_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257868' tag rid: 'SV-257868r925591_rule' tag stig_id: 'RHEL-09-231135' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61533r925590_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/tmp' + option = 'nosuid' + mount_option_enabled = input('mount_tmp_options')[option] + + if mount_option_enabled + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end + else + describe mount(path) do + its('options') { should_not include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should_not include option } + end + end end diff --git a/controls/SV-257869.rb b/controls/SV-257869.rb index 8b58191..d8df35d 100644 --- a/controls/SV-257869.rb +++ b/controls/SV-257869.rb @@ -23,4 +23,31 @@ tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var' + option = 'nodev' + mount_option_enabled = input('mount_tmp_options')[option] + + if mount_option_enabled + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end + else + describe mount(path) do + its('options') { should_not include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should_not include option } + end + end end diff --git a/controls/SV-257870.rb b/controls/SV-257870.rb index 05ceb6b..ed56d09 100644 --- a/controls/SV-257870.rb +++ b/controls/SV-257870.rb @@ -13,14 +13,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nodev" option on the "/var/log" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61611r925595_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257870' tag rid: 'SV-257870r925597_rule' tag stig_id: 'RHEL-09-231145' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61535r925596_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/log' + option = 'nodev' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257871.rb b/controls/SV-257871.rb index 462f797..b748454 100644 --- a/controls/SV-257871.rb +++ b/controls/SV-257871.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "noexec" option on the "/var/log" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61612r925598_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257871' tag rid: 'SV-257871r925600_rule' tag stig_id: 'RHEL-09-231150' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61536r925599_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/log' + option = 'noexec' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257872.rb b/controls/SV-257872.rb index daf525e..131ad9f 100644 --- a/controls/SV-257872.rb +++ b/controls/SV-257872.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/var/log" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61613r925601_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257872' tag rid: 'SV-257872r925603_rule' tag stig_id: 'RHEL-09-231155' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61537r925602_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/log' + option = 'nosuid' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257873.rb b/controls/SV-257873.rb index 0a9d7ae..b15371c 100644 --- a/controls/SV-257873.rb +++ b/controls/SV-257873.rb @@ -13,14 +13,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nodev" option on the "/var/log/audit" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61614r925604_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257873' tag rid: 'SV-257873r925606_rule' tag stig_id: 'RHEL-09-231160' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61538r925605_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/log/audit' + option = 'nodev' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257874.rb b/controls/SV-257874.rb index 40ee559..0559c87 100644 --- a/controls/SV-257874.rb +++ b/controls/SV-257874.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "noexec" option on the "/var/log/audit" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61615r925607_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257874' tag rid: 'SV-257874r925609_rule' tag stig_id: 'RHEL-09-231165' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61539r925608_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/log/audit' + option = 'noexec' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257875.rb b/controls/SV-257875.rb index 3853937..120d29d 100644 --- a/controls/SV-257875.rb +++ b/controls/SV-257875.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/var/log/audit" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61616r925610_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257875' tag rid: 'SV-257875r925612_rule' tag stig_id: 'RHEL-09-231170' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61540r925611_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/log/audit' + option = 'nosuid' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257876.rb b/controls/SV-257876.rb index e224fd4..a04f1ec 100644 --- a/controls/SV-257876.rb +++ b/controls/SV-257876.rb @@ -13,14 +13,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nodev" option on the "/var/tmp" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61617r925613_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257876' tag rid: 'SV-257876r925615_rule' tag stig_id: 'RHEL-09-231175' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61541r925614_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/tmp' + option = 'nodev' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257877.rb b/controls/SV-257877.rb index 343ed40..32bb8b0 100644 --- a/controls/SV-257877.rb +++ b/controls/SV-257877.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "noexec" option on the "/var/tmp" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61618r925616_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257877' tag rid: 'SV-257877r925618_rule' tag stig_id: 'RHEL-09-231180' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61542r925617_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/tmp' + option = 'noexec' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257878.rb b/controls/SV-257878.rb index cecdfaa..38e55c0 100644 --- a/controls/SV-257878.rb +++ b/controls/SV-257878.rb @@ -11,14 +11,28 @@ desc 'fix', 'Modify "/etc/fstab" to use the "nosuid" option on the "/var/tmp" directory.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61619r925619_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000368-GPOS-00154' tag gid: 'V-257878' tag rid: 'SV-257878r925621_rule' tag stig_id: 'RHEL-09-231185' - tag gtitle: 'SRG-OS-000368-GPOS-00154' tag fix_id: 'F-61543r925620_fix' - tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + path = '/var/tmp' + option = 'nosuid' + + describe mount(path) do + its('options') { should include option } + end + + describe etc_fstab.where { mount_point == path } do + its('mount_options.flatten') { should include option } + end end diff --git a/controls/SV-257879.rb b/controls/SV-257879.rb index 112c869..72c1811 100644 --- a/controls/SV-257879.rb +++ b/controls/SV-257879.rb @@ -2,9 +2,7 @@ title 'RHEL 9 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at rest protection.' desc 'RHEL 9 systems handling data requiring "data at rest" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. -Selection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields). - -' +Selection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields).' desc 'check', 'Verify RHEL 9 prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption. Note: If there is a documented and approved reason for not having data-at-rest encryption, this requirement is Not Applicable. @@ -23,15 +21,41 @@ To encrypt an entire partition, dedicate a partition for encryption in the partition layout.' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61620r925622_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000405-GPOS-00184' + tag satisfies: ['SRG-OS-000185-GPOS-00079', 'SRG-OS-000404-GPOS-00183', 'SRG-OS-000405-GPOS-00184'] tag gid: 'V-257879' tag rid: 'SV-257879r925624_rule' tag stig_id: 'RHEL-09-231190' - tag gtitle: 'SRG-OS-000405-GPOS-00184' tag fix_id: 'F-61544r925623_fix' - tag satisfies: ['SRG-OS-000405-GPOS-00184', 'SRG-OS-000185-GPOS-00079', 'SRG-OS-000404-GPOS-00183'] - tag 'documentable' tag cci: ['CCI-001199', 'CCI-002475', 'CCI-002476'] - tag nist: ['SC-28', 'SC-28 (1)', 'SC-28 (1)'] + tag nist: ['SC-28', 'SC-28 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers (disk encryption and data-at-rest implementation is handled on the host)', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + all_args = command('blkid').stdout.strip.split("\n").map { |s| s.sub(/^"(.*)"$/, '\1') } + + def describe_and_skip(message) + describe message do + skip message + end + end + + # TODO: This should really have a resource + if input('data_at_rest_exempt') == true + impact 0.0 + describe_and_skip('Data At Rest Requirements have been set to Not Applicabe by the `data_at_rest_exempt` input.') + elsif all_args.empty? + # TODO: Determine if this is an NA vs and NR or even a pass + describe_and_skip('Command blkid did not return and non-psuedo block devices.') + else + all_args.each do |args| + describe args do + it { should match(/\bcrypto_LUKS\b/) } + end + end + end end diff --git a/controls/SV-257880.rb b/controls/SV-257880.rb index 73c332f..b5a893f 100644 --- a/controls/SV-257880.rb +++ b/controls/SV-257880.rb @@ -1,10 +1,17 @@ control 'SV-257880' do title 'RHEL 9 must disable mounting of cramfs.' - desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. + desc 'It is detrimental for operating systems to provide, or install by +default, functionality exceeding requirements or mission objectives. These +unnecessary capabilities or services are often overlooked and therefore may +remain unsecured. They increase the risk to the platform by providing +additional attack vectors. -Removing support for unneeded filesystem types reduces the local attack surface of the server. + Removing support for unneeded filesystem types reduces the local attack +surface of the server. -Compressed ROM/RAM file system (or cramfs) is a read-only file system designed for simplicity and space-efficiency. It is mainly used in embedded and small-footprint systems.' + Compressed ROM/RAM file system (or cramfs) is a read-only file system +designed for simplicity and space-efficiency. It is mainly used in embedded +and small-footprint systems.' desc 'check', 'Verify that RHEL 9 disables the ability to load the cramfs kernel module with the following command: $ sudo grep -r cramfs /etc/modprobe.conf /etc/modprobe.d/* @@ -14,18 +21,25 @@ If the command does not return any output, or the line is commented out, and use of cramfs is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.' desc 'fix', 'To configure the system to prevent the cramfs kernel module from being loaded, add the following line to the file /etc/modprobe.d/blacklist.conf (or create blacklist.conf if it does not exist): -install tipc /bin/false +install cramfs /bin/false blacklist cramfs' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61621r925625_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-257880' - tag rid: 'SV-257880r925627_rule' + tag rid: 'SV-257880r942957_rule' tag stig_id: 'RHEL-09-231195' - tag gtitle: 'SRG-OS-000095-GPOS-00049' - tag fix_id: 'F-61545r925626_fix' - tag 'documentable' + tag fix_id: 'F-61545r942956_fix' tag cci: ['CCI-000381'] tag nist: ['CM-7 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe kernel_module('cramfs') do + it { should be_disabled } + it { should be_blacklisted } + end end diff --git a/controls/SV-257881.rb b/controls/SV-257881.rb index 276dde8..31db8ac 100644 --- a/controls/SV-257881.rb +++ b/controls/SV-257881.rb @@ -3,22 +3,38 @@ desc 'The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.' - desc 'check', %q(Verify all non-root local partitions are mounted with the "nodev" option with the following command: + desc 'check', %q(Verify all non-root local partitions are mounted with the "nodev" option +with the following command: -$ sudo mount | grep '^/dev\S* on /\S' | grep --invert-match 'nodev' + $ sudo mount | grep '^/dev\S* on /\S' | grep --invert-match 'nodev' -If any output is produced, this is a finding.) - desc 'fix', 'Configure the "/etc/fstab" to use the "nodev" option on all non-root local partitions.' + If any output is produced, this is a finding.) + desc 'fix', 'Configure the "/etc/fstab" to use the "nodev" option on all +non-root local partitions.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61622r925628_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257881' tag rid: 'SV-257881r925630_rule' tag stig_id: 'RHEL-09-231200' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61546r925629_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + option = 'nodev' + + mount_stdout = command('mount').stdout.lines + failing_mount_points = mount_stdout.select { |mp| mp.match(%r{^/dev\S*\s+on\s+/\S}) }.reject { |mp| mp.match(/\(.*#{option}.*\)/) } + + describe "All mounted devices outside of '/dev' directory" do + it "should be mounted with the '#{option}' option" do + expect(failing_mount_points).to be_empty, "Failing devices:\n\t- #{failing_mount_points.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257882.rb b/controls/SV-257882.rb index a67b4c4..559fabd 100644 --- a/controls/SV-257882.rb +++ b/controls/SV-257882.rb @@ -15,14 +15,22 @@ $ sudo chmod 755 [FILE]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61623r925631_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000259-GPOS-00100' tag gid: 'V-257882' tag rid: 'SV-257882r925633_rule' tag stig_id: 'RHEL-09-232010' - tag gtitle: 'SRG-OS-000259-GPOS-00100' tag fix_id: 'F-61547r925632_fix' - tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + failing_files = command("find -L #{input('system_command_dirs').join(' ')} -perm /0022 -exec ls -d {} \\;").stdout.split("\n") + + describe 'System commands' do + it "should have mode '0755' or less permissive" do + expect(failing_files).to be_empty, "Files with excessive permissions:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257883.rb b/controls/SV-257883.rb index 85503c9..66ec86b 100644 --- a/controls/SV-257883.rb +++ b/controls/SV-257883.rb @@ -15,14 +15,30 @@ $ sudo chmod 755 [DIRECTORY]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61624r925634_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000259-GPOS-00100' tag gid: 'V-257883' tag rid: 'SV-257883r925636_rule' tag stig_id: 'RHEL-09-232015' - tag gtitle: 'SRG-OS-000259-GPOS-00100' tag fix_id: 'F-61548r925635_fix' - tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + permissions_for_libs = input('permissions_for_libs') + + overly_permissive_libs = input('system_libraries').select { |lib| + file(lib).more_permissive_than?(permissions_for_libs) + } + + describe 'System libraries' do + it "should not have permissions set higher than #{permissions_for_libs}" do + fail_msg = "Overly permissive system libraries:\n\t- #{overly_permissive_libs.join("\n\t- ")}" + expect(overly_permissive_libs).to be_empty, fail_msg + end + end end diff --git a/controls/SV-257884.rb b/controls/SV-257884.rb index bd63ec5..f27ab6f 100644 --- a/controls/SV-257884.rb +++ b/controls/SV-257884.rb @@ -13,14 +13,22 @@ $ sudo chmod 755 [FILE]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61625r925637_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000259-GPOS-00100' tag gid: 'V-257884' tag rid: 'SV-257884r925639_rule' tag stig_id: 'RHEL-09-232020' - tag gtitle: 'SRG-OS-000259-GPOS-00100' tag fix_id: 'F-61549r925638_fix' - tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + failing_files = command("find -L #{input('system_libraries').join(' ')} -perm /0022 -type f -exec ls -d {} \\;").stdout.split("\n") + + describe 'System libraries' do + it "should have mode '0755' or less permissive" do + expect(failing_files).to be_empty, "Files with excessive permissions:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257885.rb b/controls/SV-257885.rb index e579566..21e9361 100644 --- a/controls/SV-257885.rb +++ b/controls/SV-257885.rb @@ -15,14 +15,19 @@ $ sudo chmod 0755 /var/log' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61626r925640_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000206-GPOS-00084' tag gid: 'V-257885' tag rid: 'SV-257885r925642_rule' tag stig_id: 'RHEL-09-232025' - tag gtitle: 'SRG-OS-000206-GPOS-00084' tag fix_id: 'F-61550r925641_fix' - tag 'documentable' tag cci: ['CCI-001314'] tag nist: ['SI-11 b'] + tag 'host' + tag 'container' + + describe directory('/var/log') do + it { should exist } + it { should_not be_more_permissive_than('0755') } + end end diff --git a/controls/SV-257886.rb b/controls/SV-257886.rb index 137f890..68478cb 100644 --- a/controls/SV-257886.rb +++ b/controls/SV-257886.rb @@ -15,14 +15,26 @@ $ sudo chmod 0640 /var/log/messages' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61627r925643_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000206-GPOS-00084' tag gid: 'V-257886' tag rid: 'SV-257886r925645_rule' tag stig_id: 'RHEL-09-232030' - tag gtitle: 'SRG-OS-000206-GPOS-00084' tag fix_id: 'F-61551r925644_fix' - tag 'documentable' tag cci: ['CCI-001314'] tag nist: ['SI-11 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe.one do + describe file('/var/log/messages') do + it { should_not be_more_permissive_than('0640') } + end + describe file('/var/log/messages') do + it { should_not exist } + end + end end diff --git a/controls/SV-257887.rb b/controls/SV-257887.rb index 14e045a..a5b008c 100644 --- a/controls/SV-257887.rb +++ b/controls/SV-257887.rb @@ -25,14 +25,27 @@ Replace "[audit_tool]" with each audit tool that has a more permissive mode than 0755.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61628r925646_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000256-GPOS-00097' tag gid: 'V-257887' tag rid: 'SV-257887r925648_rule' tag stig_id: 'RHEL-09-232035' - tag gtitle: 'SRG-OS-000256-GPOS-00097' tag fix_id: 'F-61552r925647_fix' - tag 'documentable' tag cci: ['CCI-001493'] - tag nist: ['AU-9 a'] + tag nist: ['AU-9', 'AU-9 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_tools = input('audit_tools') + + failing_tools = audit_tools.select { |at| file(at).more_permissive_than?(input('audit_tool_mode')) } + + describe 'Audit executables' do + it "should be no more permissive than '#{input('audit_tool_mode')}'" do + expect(failing_tools).to be_empty, "Failing tools:\n\t- #{failing_tools.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257888.rb b/controls/SV-257888.rb index 68d96d4..5c9eca6 100644 --- a/controls/SV-257888.rb +++ b/controls/SV-257888.rb @@ -27,4 +27,16 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + cron_dirs = command('find /etc/cron* -type d').stdout.split("\n") + mode = input('expected_modes')['cron_dirs'] + + non_compliant_cron_dirs = cron_dirs.select { |dir| file(dir).more_permissive_than?(mode) } + + describe 'All cron directories' do + it "have a mode of '#{mode}' or less permissive" do + expect(non_compliant_cron_dirs).to be_empty, "Failing directories:\n\t- #{non_compliant_cron_dirs.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257889.rb b/controls/SV-257889.rb index fad50c2..6c4e9cd 100644 --- a/controls/SV-257889.rb +++ b/controls/SV-257889.rb @@ -1,6 +1,8 @@ control 'SV-257889' do title 'All RHEL 9 local initialization files must have mode 0740 or less permissive.' - desc "Local initialization files are used to configure the user's shell environment upon logon. Malicious modification of these files could compromise accounts upon logon." + desc "Local initialization files are used to configure the user's shell +environment upon logon. Malicious modification of these files could compromise +accounts upon logon." desc 'check', 'Verify that all local initialization files have a mode of "0740" or less permissive with the following command: Note: The example will be for the "wadea" user, who has a home directory of "/home/wadea". @@ -19,14 +21,31 @@ $ sudo chmod 0740 /home/wadea/.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61630r925652_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257889' tag rid: 'SV-257889r925654_rule' tag stig_id: 'RHEL-09-232045' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61554r925653_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + ignore_shells = input('non_interactive_shells').join('|') + + homedirs = users.where { !shell.match(ignore_shells) && (uid >= 1000 || uid.zero?) }.homes + ifiles = command("find #{homedirs.join(' ')} -xdev -maxdepth 1 -name '.*' -type f").stdout.split("\n") + + expected_mode = input('initialization_file_mode') + failing_files = ifiles.select { |ifile| file(ifile).more_permissive_than?(expected_mode) } + + describe 'All RHEL 8 local initialization files' do + it "must have mode '#{expected_mode}' or less permissive" do + expect(failing_files).to be_empty, "Failing files:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257890.rb b/controls/SV-257890.rb index 2fc0713..1c48d0d 100644 --- a/controls/SV-257890.rb +++ b/controls/SV-257890.rb @@ -1,6 +1,7 @@ control 'SV-257890' do title 'All RHEL 9 local interactive user home directories must have mode 0750 or less permissive.' - desc 'Excessive permissions on local interactive user home directories may allow unauthorized access to user files by other users.' + desc 'Excessive permissions on local interactive user home directories may +allow unauthorized access to user files by other users.' desc 'check', %q(Verify the assigned home directory of all local interactive users has a mode of "0750" or less permissive with the following command: Note: This may miss interactive users that have been assigned a privileged user identifier (UID). Evidence of interactive use may be obtained from a number of log files containing system logon information. @@ -17,14 +18,41 @@ $ sudo chmod 0750 /home/wadea) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61631r925655_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257890' tag rid: 'SV-257890r925657_rule' tag stig_id: 'RHEL-09-232050' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61555r925656_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + exempt_home_users = input('exempt_home_users') + expected_mode = input('expected_modes')['home_dirs'] + uid_min = login_defs.read_params['UID_MIN'].to_i + uid_min = 1000 if uid_min.nil? + + iuser_entries = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) } + + if !iuser_entries.users.nil? && !iuser_entries.users.empty? + failing_homedirs = iuser_entries.homes.select { |home| + file(home).more_permissive_than?(expected_mode) + } + describe 'All non-exempt interactive user account home directories on the system' do + it "should not be more permissive than '#{expected_mode}'" do + expect(failing_homedirs).to be_empty, "Failing home directories:\n\t- #{failing_homedirs.join("\n\t- ")}" + end + end + else + describe 'No non-exempt interactive user accounts' do + it 'were detected on the system' do + expect(true).to eq(true) + end + end + end end diff --git a/controls/SV-257891.rb b/controls/SV-257891.rb index 7487413..f2eba3f 100644 --- a/controls/SV-257891.rb +++ b/controls/SV-257891.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/group' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257892.rb b/controls/SV-257892.rb index 71cbd00..773de18 100644 --- a/controls/SV-257892.rb +++ b/controls/SV-257892.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/group-' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257893.rb b/controls/SV-257893.rb index ad0ef58..58b6860 100644 --- a/controls/SV-257893.rb +++ b/controls/SV-257893.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/gshadow' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257894.rb b/controls/SV-257894.rb index 5edc86f..46ef5ca 100644 --- a/controls/SV-257894.rb +++ b/controls/SV-257894.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/gshadow-' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257895.rb b/controls/SV-257895.rb index d8b5939..9ae0f49 100644 --- a/controls/SV-257895.rb +++ b/controls/SV-257895.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/passwd' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257896.rb b/controls/SV-257896.rb index 90a0e7d..1fbc0c6 100644 --- a/controls/SV-257896.rb +++ b/controls/SV-257896.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/passwd-' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257897.rb b/controls/SV-257897.rb index bbb9e9b..f217c70 100644 --- a/controls/SV-257897.rb +++ b/controls/SV-257897.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/shadow-' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257898.rb b/controls/SV-257898.rb index f5d97f4..20f9c80 100644 --- a/controls/SV-257898.rb +++ b/controls/SV-257898.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/group') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257899.rb b/controls/SV-257899.rb index 4c6226a..c030075 100644 --- a/controls/SV-257899.rb +++ b/controls/SV-257899.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/group') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257900.rb b/controls/SV-257900.rb index 10b80ca..f267cca 100644 --- a/controls/SV-257900.rb +++ b/controls/SV-257900.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/group-') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257901.rb b/controls/SV-257901.rb index 1eeef6d..19457b9 100644 --- a/controls/SV-257901.rb +++ b/controls/SV-257901.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/group-') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257902.rb b/controls/SV-257902.rb index f582c68..382b94d 100644 --- a/controls/SV-257902.rb +++ b/controls/SV-257902.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/gshadow') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257903.rb b/controls/SV-257903.rb index 5f19d71..4325ed1 100644 --- a/controls/SV-257903.rb +++ b/controls/SV-257903.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/gshadow') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257904.rb b/controls/SV-257904.rb index 78ae72b..41d899f 100644 --- a/controls/SV-257904.rb +++ b/controls/SV-257904.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/gshadow-') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257905.rb b/controls/SV-257905.rb index e977446..f1bb306 100644 --- a/controls/SV-257905.rb +++ b/controls/SV-257905.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/gshadow-') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257906.rb b/controls/SV-257906.rb index edf384c..e0e3064 100644 --- a/controls/SV-257906.rb +++ b/controls/SV-257906.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/passwd') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257907.rb b/controls/SV-257907.rb index 05edef4..cf2e8ed 100644 --- a/controls/SV-257907.rb +++ b/controls/SV-257907.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/passwd') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257908.rb b/controls/SV-257908.rb index c1e22d8..5d23716 100644 --- a/controls/SV-257908.rb +++ b/controls/SV-257908.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/passwd-') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257909.rb b/controls/SV-257909.rb index 9e80361..735bbda 100644 --- a/controls/SV-257909.rb +++ b/controls/SV-257909.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/passwd-') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257910.rb b/controls/SV-257910.rb index 340ad2f..efa7526 100644 --- a/controls/SV-257910.rb +++ b/controls/SV-257910.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/shadow') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257911.rb b/controls/SV-257911.rb index f442ba6..dd19514 100644 --- a/controls/SV-257911.rb +++ b/controls/SV-257911.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/shadow') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257912.rb b/controls/SV-257912.rb index 3ab2985..e4b9436 100644 --- a/controls/SV-257912.rb +++ b/controls/SV-257912.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/shadow-') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257913.rb b/controls/SV-257913.rb index dcd00e2..ab64b6f 100644 --- a/controls/SV-257913.rb +++ b/controls/SV-257913.rb @@ -23,4 +23,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe file('/etc/shadow-') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257914.rb b/controls/SV-257914.rb index 381bcee..be8487f 100644 --- a/controls/SV-257914.rb +++ b/controls/SV-257914.rb @@ -15,14 +15,19 @@ $ sudo chown root /var/log' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61655r925727_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000206-GPOS-00084' tag gid: 'V-257914' tag rid: 'SV-257914r925729_rule' tag stig_id: 'RHEL-09-232170' - tag gtitle: 'SRG-OS-000206-GPOS-00084' tag fix_id: 'F-61579r925728_fix' - tag 'documentable' tag cci: ['CCI-001314'] tag nist: ['SI-11 b'] + tag 'host' + tag 'container' + + describe directory('/var/log') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257915.rb b/controls/SV-257915.rb index 7a20d17..b930da6 100644 --- a/controls/SV-257915.rb +++ b/controls/SV-257915.rb @@ -15,14 +15,19 @@ $ sudo chgrp root /var/log' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61656r925730_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000206-GPOS-00084' tag gid: 'V-257915' tag rid: 'SV-257915r925732_rule' tag stig_id: 'RHEL-09-232175' - tag gtitle: 'SRG-OS-000206-GPOS-00084' tag fix_id: 'F-61580r925731_fix' - tag 'documentable' tag cci: ['CCI-001314'] tag nist: ['SI-11 b'] + tag 'host' + tag 'container' + + describe directory('/var/log') do + it { should exist } + its('group') { should eq 'root' } + end end diff --git a/controls/SV-257916.rb b/controls/SV-257916.rb index 836be0a..6613a4a 100644 --- a/controls/SV-257916.rb +++ b/controls/SV-257916.rb @@ -15,14 +15,26 @@ $ sudo chown root /var/log/messages' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61657r925733_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000206-GPOS-00084' tag gid: 'V-257916' tag rid: 'SV-257916r925735_rule' tag stig_id: 'RHEL-09-232180' - tag gtitle: 'SRG-OS-000206-GPOS-00084' tag fix_id: 'F-61581r925734_fix' - tag 'documentable' tag cci: ['CCI-001314'] tag nist: ['SI-11 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe.one do + describe file('/var/log/messages') do + it { should be_owned_by 'root' } + end + describe file('/var/log/messages') do + it { should_not exist } + end + end end diff --git a/controls/SV-257917.rb b/controls/SV-257917.rb index eef7e22..cc73280 100644 --- a/controls/SV-257917.rb +++ b/controls/SV-257917.rb @@ -15,14 +15,26 @@ $ sudo chgrp root /var/log/messages' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61658r925736_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000206-GPOS-00084' tag gid: 'V-257917' tag rid: 'SV-257917r925738_rule' tag stig_id: 'RHEL-09-232185' - tag gtitle: 'SRG-OS-000206-GPOS-00084' tag fix_id: 'F-61582r925737_fix' - tag 'documentable' tag cci: ['CCI-001314'] tag nist: ['SI-11 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe.one do + describe file('/var/log/messages') do + its('group') { should be_in input('var_log_messages_group') } + end + describe file('/var/log/messages') do + it { should_not exist } + end + end end diff --git a/controls/SV-257918.rb b/controls/SV-257918.rb index eed7a17..de34165 100644 --- a/controls/SV-257918.rb +++ b/controls/SV-257918.rb @@ -10,19 +10,28 @@ If any system commands are found to not be owned by root, this is a finding.' desc 'fix', 'Configure the system commands to be protected from unauthorized access. -Run the following command, replacing "[FILE]" with any system command file not owned by "root". + Run the following command, replacing "[FILE]" with any system command +file not owned by "root". -$ sudo chown root [FILE]' + $ sudo chown root [FILE]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61659r925739_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000259-GPOS-00100' tag gid: 'V-257918' tag rid: 'SV-257918r925741_rule' tag stig_id: 'RHEL-09-232190' - tag gtitle: 'SRG-OS-000259-GPOS-00100' tag fix_id: 'F-61583r925740_fix' - tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + failing_files = command("find -L #{input('system_command_dirs').join(' ')} ! -user root -exec ls -d {} \\;").stdout.split("\n") + + describe 'System commands' do + it 'should be owned by root' do + expect(failing_files).to be_empty, "Files not owned by root:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257919.rb b/controls/SV-257919.rb index e30d72c..6cc8967 100644 --- a/controls/SV-257919.rb +++ b/controls/SV-257919.rb @@ -10,19 +10,28 @@ If any system commands are returned and is not group-owned by a required system account, this is a finding.' desc 'fix', 'Configure the system commands to be protected from unauthorized access. -Run the following command, replacing "[FILE]" with any system command file not group-owned by "root" or a required system account. + Run the following command, replacing "[FILE]" with any system command +file not group-owned by "root" or a required system account. -$ sudo chgrp root [FILE]' + $ sudo chgrp root [FILE]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61660r925742_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000259-GPOS-00100' tag gid: 'V-257919' tag rid: 'SV-257919r925744_rule' tag stig_id: 'RHEL-09-232195' - tag gtitle: 'SRG-OS-000259-GPOS-00100' tag fix_id: 'F-61584r925743_fix' - tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + failing_files = command("find -L #{input('system_command_dirs').join(' ')} ! -group root -exec ls -d {} \\;").stdout.split("\n") + + describe 'System commands' do + it 'should be group-owned by root' do + expect(failing_files).to be_empty, "Files not group-owned by root:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257920.rb b/controls/SV-257920.rb index c7fc959..8e4857d 100644 --- a/controls/SV-257920.rb +++ b/controls/SV-257920.rb @@ -8,21 +8,31 @@ $ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -user root -exec ls -l {} \\; If any system-wide shared library file is not owned by root, this is a finding.' - desc 'fix', 'Configure the system-wide shared library files (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. + desc 'fix', 'Configure the system-wide shared library files (/lib, /lib64, /usr/lib and +/usr/lib64) to be protected from unauthorized access. -Run the following command, replacing "[FILE]" with any library file not owned by "root". + Run the following command, replacing "[FILE]" with any library file not +owned by "root". -$ sudo chown root [FILE]' + $ sudo chown root [FILE]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61661r925745_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000259-GPOS-00100' tag gid: 'V-257920' tag rid: 'SV-257920r925747_rule' tag stig_id: 'RHEL-09-232200' - tag gtitle: 'SRG-OS-000259-GPOS-00100' tag fix_id: 'F-61585r925746_fix' - tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + failing_files = command("find -L #{input('system_libraries').join(' ')} ! -user root -exec ls -d {} \\;").stdout.split("\n") + + describe 'System libraries' do + it 'should be owned by root' do + expect(failing_files).to be_empty, "Files not owned by root:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257921.rb b/controls/SV-257921.rb index c520864..0353a9e 100644 --- a/controls/SV-257921.rb +++ b/controls/SV-257921.rb @@ -8,21 +8,31 @@ $ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -group root -exec ls -l {} \\; If any system-wide shared library file is returned and is not group-owned by a required system account, this is a finding.' - desc 'fix', 'Configure the system-wide shared library files (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. + desc 'fix', 'Configure the system-wide shared library files (/lib, /lib64, /usr/lib and +/usr/lib64) to be protected from unauthorized access. -Run the following command, replacing "[FILE]" with any library file not group-owned by "root". + Run the following command, replacing "[FILE]" with any library file not +group-owned by "root". -$ sudo chgrp root [FILE]' + $ sudo chgrp root [FILE]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61662r925748_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000259-GPOS-00100' tag gid: 'V-257921' tag rid: 'SV-257921r925750_rule' tag stig_id: 'RHEL-09-232205' - tag gtitle: 'SRG-OS-000259-GPOS-00100' tag fix_id: 'F-61586r925749_fix' - tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + failing_files = command("find -L #{input('system_libraries').join(' ')} ! -group root -exec ls -d {} \\;").stdout.split("\n") + + describe 'System libraries' do + it 'should be group-owned by root' do + expect(failing_files).to be_empty, "Files not group-owned by root:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257922.rb b/controls/SV-257922.rb index c98887a..adbea83 100644 --- a/controls/SV-257922.rb +++ b/controls/SV-257922.rb @@ -8,11 +8,9 @@ $ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -user root -type d -exec stat -c "%n %U" '{}' \; If any system-wide shared library directory is not owned by root, this is a finding.) - desc 'fix', 'Configure the system-wide shared library directories within (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. + desc 'fix', 'Configure the system-wide shared library directories within (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. Run the following command, replacing "[DIRECTORY]" with any library directory not owned by "root". -Run the following command, replacing "[DIRECTORY]" with any library directory not owned by "root". - -$ sudo chown root [DIRECTORY]' + $ sudo chown root [DIRECTORY]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' tag check_id: 'C-61663r925751_chk' @@ -25,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + non_root_owned_libs = input('system_libraries').reject { |lib| file(lib).owned_by?('root') } + + describe 'System libraries' do + it 'should be owned by root' do + fail_msg = "Libs not owned by root:\n\t- #{non_root_owned_libs.join("\n\t- ")}" + expect(non_root_owned_libs).to be_empty, fail_msg + end + end end diff --git a/controls/SV-257923.rb b/controls/SV-257923.rb index eecfa5b..85307e1 100644 --- a/controls/SV-257923.rb +++ b/controls/SV-257923.rb @@ -3,16 +3,14 @@ desc 'If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.' - desc 'check', %q(Verify the system-wide shared library directories are group-owned by "root" with the following command: + desc 'check', %q(Verify the system-wide shared library directories are group-owned + by "root" with the following command: -$ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -group root -type d -exec stat -c "%n %G" '{}' \; + $ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -group root -type d -exec stat -c "%n %G" '{}' \; -If any system-wide shared library directory is returned and is not group-owned by a required system account, this is a finding.) - desc 'fix', 'Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. - -Run the following command, replacing "[DIRECTORY]" with any library directory not group-owned by "root". - -$ sudo chgrp root [DIRECTORY]' + If any system-wide shared library directory is returned and is not group-owned + by a required system account, this is a finding.) + desc 'fix', 'Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. Run the following command, replacing "[DIRECTORY]" with any library directory not group-owned by "root". $ sudo chgrp root [DIRECTORY]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' tag check_id: 'C-61664r925754_chk' @@ -25,4 +23,17 @@ tag 'documentable' tag cci: ['CCI-001499'] tag nist: ['CM-5 (6)'] + tag 'host' + tag 'container' + + non_root_owned_libs = input('system_libraries').filter { |lib| + !input('required_system_accounts').include?(file(lib).group) + } + + describe 'System libraries' do + it 'should be owned by a required system account' do + fail_msg = "Libs not group-owned by a system account:\n\t- #{non_root_owned_libs.join("\n\t- ")}" + expect(non_root_owned_libs).to be_empty, fail_msg + end + end end diff --git a/controls/SV-257924.rb b/controls/SV-257924.rb index d627ac0..51ffaec 100644 --- a/controls/SV-257924.rb +++ b/controls/SV-257924.rb @@ -25,14 +25,28 @@ Replace "[audit_tool]" with each audit tool not owned by "root".' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61665r925757_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000256-GPOS-00097' + tag satisfies: ['SRG-OS-000256-GPOS-00097', 'SRG-OS-000257-GPOS-00098', 'SRG-OS-000258-GPOS-00099'] tag gid: 'V-257924' tag rid: 'SV-257924r925759_rule' tag stig_id: 'RHEL-09-232220' - tag gtitle: 'SRG-OS-000256-GPOS-00097' tag fix_id: 'F-61589r925758_fix' - tag 'documentable' tag cci: ['CCI-001493'] - tag nist: ['AU-9 a'] + tag nist: ['AU-9', 'AU-9 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_tools = ['/sbin/auditctl', '/sbin/aureport', '/sbin/ausearch', '/sbin/autrace', '/sbin/auditd', '/sbin/rsyslogd', '/sbin/augenrules'] + + failing_tools = audit_tools.reject { |at| file(at).owned_by?('root') } + + describe 'Audit executables' do + it 'should be owned by root' do + expect(failing_tools).to be_empty, "Failing tools:\n\t- #{failing_tools.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257925.rb b/controls/SV-257925.rb index a529648..1847e33 100644 --- a/controls/SV-257925.rb +++ b/controls/SV-257925.rb @@ -25,14 +25,28 @@ Replace "[audit_tool]" with each audit tool not group-owned by "root".' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61666r925760_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000256-GPOS-00097' + tag satisfies: ['SRG-OS-000256-GPOS-00097', 'SRG-OS-000257-GPOS-00098', 'SRG-OS-000258-GPOS-00099'] tag gid: 'V-257925' tag rid: 'SV-257925r925762_rule' tag stig_id: 'RHEL-09-232225' - tag gtitle: 'SRG-OS-000256-GPOS-00097' tag fix_id: 'F-61590r925761_fix' - tag 'documentable' tag cci: ['CCI-001493'] - tag nist: ['AU-9 a'] + tag nist: ['AU-9', 'AU-9 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_tools = ['/sbin/auditctl', '/sbin/aureport', '/sbin/ausearch', '/sbin/autrace', '/sbin/auditd', '/sbin/rsyslogd', '/sbin/augenrules'] + + failing_tools = audit_tools.reject { |at| file(at).group == 'root' } + + describe 'Audit executables' do + it 'should be group owned by root' do + expect(failing_tools).to be_empty, "Failing tools:\n\t- #{failing_tools.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257926.rb b/controls/SV-257926.rb index 8c904f7..d83cde9 100644 --- a/controls/SV-257926.rb +++ b/controls/SV-257926.rb @@ -29,4 +29,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + crontabs = command('stat -c "%U %n" /etc/cron*').stdout.split("\n") + + failing_crontabs = crontabs.reject { |c| file(c.split[1]).owned_by?('root') } + + describe 'Crontabs' do + it 'should be owned by root' do + expect(failing_crontabs).to be_empty, "Failing crontabs:\n\t- #{failing_crontabs.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257927.rb b/controls/SV-257927.rb index bcc8c19..1781d5f 100644 --- a/controls/SV-257927.rb +++ b/controls/SV-257927.rb @@ -29,4 +29,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + crontabs = command('stat -c "%U %n" /etc/cron*').stdout.split("\n") + + failing_crontabs = crontabs.reject { |c| file(c.split[1]).grouped_into?('root') } + + describe 'Crontabs' do + it 'should be group owned by root' do + expect(failing_crontabs).to be_empty, "Failing crontabs:\n\t- #{failing_crontabs.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257928.rb b/controls/SV-257928.rb index c9ac2aa..fd3ed28 100644 --- a/controls/SV-257928.rb +++ b/controls/SV-257928.rb @@ -2,9 +2,7 @@ title 'All RHEL 9 world-writable directories must be owned by root, sys, bin, or an application user.' desc 'If a world-writable directory is not owned by root, sys, bin, or an application user identifier (UID), unauthorized users may be able to modify files created by others. -The only authorized public directories are those temporary directories supplied with the system or those designed to be temporary file repositories. The setting is normally reserved for directories used by the system and by users for temporary file storage, (e.g., /tmp), and for directories requiring global read/write access. - -' +The only authorized public directories are those temporary directories supplied with the system or those designed to be temporary file repositories. The setting is normally reserved for directories used by the system and by users for temporary file storage, (e.g., /tmp), and for directories requiring global read/write access.' desc 'check', 'Verify that world writable directories are owned by root, a system account, or an application account with the following command. It will discover and print world-writable directories that are not owned by root. Run it once for each local partition [PART]: $ sudo find PART -xdev -type d -perm -0002 -uid +0 -print @@ -17,15 +15,25 @@ $ sudo chown root [Public Directory]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61669r925769_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257928' tag rid: 'SV-257928r925771_rule' tag stig_id: 'RHEL-09-232240' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61593r925770_fix' - tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000138-GPOS-00069'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001090'] tag nist: ['CM-6 b', 'SC-4'] + tag 'host' + tag 'container' + + partitions = etc_fstab.params.map { |partition| partition['mount_point'] }.uniq + + cmd = "find #{partitions.join(' ')} -xdev -type d -perm -0002 -uid +999 -print" + failing_dirs = command(cmd).stdout.split("\n").uniq + + describe 'Any world-writeable directories' do + it 'should be owned by system accounts' do + expect(failing_dirs).to be_empty, "Failing directories:\n\t- #{failing_dirs.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257929.rb b/controls/SV-257929.rb index 3af072f..f5b507a 100644 --- a/controls/SV-257929.rb +++ b/controls/SV-257929.rb @@ -19,14 +19,33 @@ $ chmod a+t [World-Writable Directory]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61670r925772_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000138-GPOS-00069' tag gid: 'V-257929' tag rid: 'SV-257929r925774_rule' tag stig_id: 'RHEL-09-232245' - tag gtitle: 'SRG-OS-000138-GPOS-00069' tag fix_id: 'F-61594r925773_fix' - tag 'documentable' tag cci: ['CCI-001090'] tag nist: ['SC-4'] + tag 'host' + tag 'container' + + partitions = etc_fstab.params.map { |partition| partition['mount_point'] }.uniq + + ww_dirs = command("find #{partitions} -type d \\( -perm -0002 -a ! -perm -1000 \\) -print 2>/dev/null").stdout.split("\n") + + if ww_dirs.empty? + describe 'List of world-writable directories on the target' do + subject { ww_dirs } + it { should be_empty } + end + else + non_sticky_ww_dirs = ww_dirs.reject { |dir| file(dir).sticky? } + describe 'All world-writeable directories' do + it 'should have the sticky bit set' do + fail_msg = "Public directories without sticky bit:\n\t- #{non_sticky_ww_dirs.join("\n\t- ")}" + expect(non_sticky_ww_dirs).to be_empty, fail_msg + end + end + end end diff --git a/controls/SV-257930.rb b/controls/SV-257930.rb index 8cb6f37..a6690f2 100644 --- a/controls/SV-257930.rb +++ b/controls/SV-257930.rb @@ -1,6 +1,8 @@ control 'SV-257930' do title 'All RHEL 9 local files and directories must have a valid group owner.' - desc 'Files without a valid group owner may be unintentionally inherited if a group is assigned the same Group Identifier (GID) as the GID of the files without a valid group owner.' + desc 'Files without a valid group owner may be unintentionally inherited if +a group is assigned the same Group Identifier (GID) as the GID of the files +without a valid group owner.' desc 'check', "Verify all local files and directories on RHEL 9 have a valid group with the following command: $ df --local -P | awk {'if (NR!=1) print $6'} | sudo xargs -I '{}' find '{}' -xdev -nogroup @@ -11,14 +13,34 @@ $ sudo chgrp ' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61671r925775_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257930' tag rid: 'SV-257930r925777_rule' tag stig_id: 'RHEL-09-232250' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61595r925776_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + if input('disable_slow_controls') + describe 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute.' do + skip 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute. You must enable this control for a full accredidation for production.' + end + else + + failing_files = Set[] + + command('grep -v "nodev" /proc/filesystems | awk \'NF{ print $NF }\'') + .stdout.strip.split("\n").each do |fs| + failing_files += command("find / -xdev -xautofs -fstype #{fs} -nogroup").stdout.strip.split("\n") + end + + describe 'All files on RHEL 8' do + it 'should have a group' do + expect(failing_files).to be_empty, "Files with no group:\n\t- #{failing_files.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257931.rb b/controls/SV-257931.rb index d53e708..beba684 100644 --- a/controls/SV-257931.rb +++ b/controls/SV-257931.rb @@ -11,14 +11,34 @@ $ sudo chown ' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61672r925778_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257931' tag rid: 'SV-257931r925780_rule' tag stig_id: 'RHEL-09-232255' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61596r925779_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + if input('disable_slow_controls') + describe 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute.' do + skip 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute. You must enable this control for a full accredidation for production.' + end + else + + failing_files = Set[] + + command('grep -v "nodev" /proc/filesystems | awk \'NF{ print $NF }\'') + .stdout.strip.split("\n").each do |fs| + failing_files += command("find / -xdev -xautofs -fstype #{fs} -nouser").stdout.strip.split("\n") + end + + describe 'All files on RHEL 8' do + it 'should have an owner' do + expect(failing_files).to be_empty, "Files with no owner:\n\t- #{failing_files.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257932.rb b/controls/SV-257932.rb index 4ee76db..33b0fc4 100644 --- a/controls/SV-257932.rb +++ b/controls/SV-257932.rb @@ -35,4 +35,23 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + exempt_device_files = input('exempt_device_files') + + device_labeled_files = command("find #{input('device_file_locations').join(' ')} -context *:device_t:* \( -type c -o -type b \) -printf \"%p\t%Z\n\"").stdout.split("\n") - exempt_device_files + unlabeled_files = command("find #{input('device_file_locations').join(' ')} -context *:unlabeled_t:* \( -type c -o -type b \) -printf \"%p\t%Z\n\"").stdout.split("\n") - exempt_device_files + + describe 'All device files' do + it 'should not be incorrectly labeled as device_t' do + expect(device_labeled_files).to be_empty, "Device files incorrectly labeled as device_t:\n\t- #{device_labeled_files.join("\n\t- ")}" + end + it 'should not be incorrectly labeled as unlabeled_t' do + expect(unlabeled_files).to be_empty, "Device files incorrectly labeled as unlabeled_t:\n\t- #{unlabeled_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257933.rb b/controls/SV-257933.rb index 1e79398..802d445 100644 --- a/controls/SV-257933.rb +++ b/controls/SV-257933.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/crontab' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257934.rb b/controls/SV-257934.rb index e785b12..b27952a 100644 --- a/controls/SV-257934.rb +++ b/controls/SV-257934.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/shadow' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-257935.rb b/controls/SV-257935.rb index e2f8689..91b9641 100644 --- a/controls/SV-257935.rb +++ b/controls/SV-257935.rb @@ -6,9 +6,7 @@ Remote access is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. -RHEL 9 functionality (e.g., SSH) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets). - -' +RHEL 9 functionality (e.g., SSH) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets).' desc 'check', 'Run the following command to determine if the firewalld package is installed with the following command: $ sudo dnf list --installed firewalld @@ -23,15 +21,29 @@ $ sudo dnf install firewalld' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61676r925790_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000096-GPOS-00050' tag gid: 'V-257935' tag rid: 'SV-257935r928954_rule' tag stig_id: 'RHEL-09-251010' - tag gtitle: 'SRG-OS-000096-GPOS-00050' tag fix_id: 'F-61600r925791_fix' - tag satisfies: ['SRG-OS-000096-GPOS-00050', 'SRG-OS-000297-GPOS-00115', 'SRG-OS-000298-GPOS-00116', 'SRG-OS-000480-GPOS-00227', 'SRG-OS-000480-GPOS-00232'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-000382', 'CCI-002314', 'CCI-002322'] - tag nist: ['CM-6 b', 'CM-7 b', 'AC-17 (1)', 'AC-17 (9)'] + tag cci: ['CCI-002314', 'CCI-000366', 'CCI-000382', 'CCI-002322'] + tag nist: ['AC-17 (1)', 'CM-6 b', 'CM-7 b', 'AC-17 (9)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + alternate_firewall_tool = input('alternate_firewall_tool') + + if alternate_firewall_tool != '' + describe package(alternate_firewall_tool) do + it { should be_installed } + end + else + describe package('firewalld') do + it { should be_installed } + end + end end diff --git a/controls/SV-257936.rb b/controls/SV-257936.rb index 58751bc..7309134 100644 --- a/controls/SV-257936.rb +++ b/controls/SV-257936.rb @@ -6,9 +6,7 @@ Remote access is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. -RHEL 9 functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets). - -' +RHEL 9 functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets).' desc 'check', 'Verify that "firewalld" is active with the following command: $ systemctl is-active firewalld @@ -21,15 +19,31 @@ $ sudo systemctl enable --now firewalld' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61677r925793_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000096-GPOS-00050' tag gid: 'V-257936' tag rid: 'SV-257936r925795_rule' tag stig_id: 'RHEL-09-251015' - tag gtitle: 'SRG-OS-000096-GPOS-00050' tag fix_id: 'F-61601r925794_fix' - tag satisfies: ['SRG-OS-000096-GPOS-00050', 'SRG-OS-000297-GPOS-00115', 'SRG-OS-000480-GPOS-00227', 'SRG-OS-000480-GPOS-00232'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-000382', 'CCI-002314'] - tag nist: ['CM-6 b', 'CM-7 b', 'AC-17 (1)'] + tag cci: ['CCI-002314', 'CCI-000366', 'CCI-000382'] + tag nist: ['AC-17 (1)', 'CM-6 b', 'CM-7 b'] + + only_if('This requirment is Not Applicable in the container, the container management platform manages the firewall service', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('external_firewall') + message = 'This system uses an externally managed firewall service, verify with the system administrator that the firewall is configured to requirements' + describe message do + skip message + end + else + describe package('firewalld') do + it { should be_installed } + end + describe firewalld do + it { should be_installed } + it { should be_running } + end + end end diff --git a/controls/SV-257937.rb b/controls/SV-257937.rb index 43edf93..6925202 100644 --- a/controls/SV-257937.rb +++ b/controls/SV-257937.rb @@ -41,14 +41,34 @@ $ sudo firewall-cmd --reload' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61678r925796_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' + tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155', 'SRG-OS-000480-GPOS-00232'] tag gid: 'V-257937' tag rid: 'SV-257937r925798_rule' tag stig_id: 'RHEL-09-251020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61602r925797_fix' - tag 'documentable' - tag cci: ['CCI-000366'] - tag nist: ['CM-6 b'] + tag cci: ['CCI-001764', 'CCI-000366'] + tag nist: ['CM-7 (2)', 'CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe service('firewalld') do + it { should be_running } + end + + describe firewalld do + its('zone') { should_not be_empty } + end + + failing_zones = firewalld.zone.reject { |fz| firewalld.zone(fz).target == 'DROP' } + + describe 'All firewall zones' do + it 'should be configured to drop all incoming network packets unless explicitly accepted' do + expect(failing_zones).to be_empty, "Failing zones:\n\t- #{failing_zones.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257938.rb b/controls/SV-257938.rb index 8a6986f..bfb2003 100644 --- a/controls/SV-257938.rb +++ b/controls/SV-257938.rb @@ -34,4 +34,15 @@ tag 'documentable' tag cci: ['CCI-000382', 'CCI-002314'] tag nist: ['CM-7 b', 'AC-17 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe firewalld do + its('ports.flatten') { should be_in input('approved_ppsm_clsa')['ports'] } + its('protocols.flatten') { should be_in input('approved_ppsm_clsa')['protocols'] } + its('services.flatten') { should be_in input('approved_ppsm_clsa')['services'] } + end end diff --git a/controls/SV-257939.rb b/controls/SV-257939.rb index 6bad804..2074783 100644 --- a/controls/SV-257939.rb +++ b/controls/SV-257939.rb @@ -18,14 +18,21 @@ Establish rate-limiting rules based on organization-defined types of DoS attacks on impacted network interfaces.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61680r925802_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000420-GPOS-00186' tag gid: 'V-257939' tag rid: 'SV-257939r925804_rule' tag stig_id: 'RHEL-09-251030' - tag gtitle: 'SRG-OS-000420-GPOS-00186' tag fix_id: 'F-61604r925803_fix' - tag 'documentable' tag cci: ['CCI-002385'] - tag nist: ['SC-5 a'] + tag nist: ['SC-5', 'SC-5 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe parse_config_file('/etc/firewalld/firewalld.conf') do + its('FirewallBackend') { should eq 'nftables' } + end end diff --git a/controls/SV-257940.rb b/controls/SV-257940.rb index f07f329..1e7288c 100644 --- a/controls/SV-257940.rb +++ b/controls/SV-257940.rb @@ -29,14 +29,28 @@ $ sudo firewall-cmd --reload" impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61681r925805_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000096-GPOS-00050' tag gid: 'V-257940' tag rid: 'SV-257940r925807_rule' tag stig_id: 'RHEL-09-251035' - tag gtitle: 'SRG-OS-000096-GPOS-00050' tag fix_id: 'F-61605r925806_fix' - tag 'documentable' tag cci: ['CCI-000382'] tag nist: ['CM-7 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + firewalld_properties = input('firewalld_properties') + + describe firewalld do + it { should be_running } + end + describe firewalld do + its('ports') { should cmp [firewalld_properties['ports']] } + its('protocols') { should cmp [firewalld_properties['protocols']] } + its('services') { should cmp [firewalld_properties['services']] } + end end diff --git a/controls/SV-257941.rb b/controls/SV-257941.rb index 47a7dc7..9762a34 100644 --- a/controls/SV-257941.rb +++ b/controls/SV-257941.rb @@ -8,21 +8,35 @@ $ ip link | grep -i promisc If network interfaces are found on the system in promiscuous mode and their use has not been approved by the ISSO and documented, this is a finding.' - desc 'fix', 'Configure network interfaces to turn off promiscuous mode unless approved by the ISSO and documented. + desc 'fix', 'Configure network interfaces to turn off promiscuous mode unless approved +by the ISSO and documented. -Set the promiscuous mode of an interface to off with the following command: + Set the promiscuous mode of an interface to off with the following command: -$ sudo ip link set dev multicast off promisc off' + $ sudo ip link set dev multicast off promisc off' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61682r925808_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257941' tag rid: 'SV-257941r925810_rule' tag stig_id: 'RHEL-09-251040' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61606r925809_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('promiscuous_mode_permitted') + describe command('ip link | grep -i promisc') do + its('stdout.strip') { should_not match(/^$/) } + end + else + describe command('ip link | grep -i promisc') do + its('stdout.strip') { should match(/^$/) } + end + end end diff --git a/controls/SV-257942.rb b/controls/SV-257942.rb index 0a9bc76..2301bd2 100644 --- a/controls/SV-257942.rb +++ b/controls/SV-257942.rb @@ -24,14 +24,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61683r925811_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257942' tag rid: 'SV-257942r925813_rule' tag stig_id: 'RHEL-09-251045' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61607r925812_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.core.bpf_jit_harden' + value = 2 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257943.rb b/controls/SV-257943.rb index 18d36a7..e4f14f9 100644 --- a/controls/SV-257943.rb +++ b/controls/SV-257943.rb @@ -25,4 +25,9 @@ tag 'documentable' tag cci: ['CCI-001891'] tag nist: ['AU-8 (1) (a)'] + tag 'host', 'container' + + describe package('chrony') do + it { should be_installed } + end end diff --git a/controls/SV-257944.rb b/controls/SV-257944.rb index 92a98aa..b6c3c07 100644 --- a/controls/SV-257944.rb +++ b/controls/SV-257944.rb @@ -25,4 +25,10 @@ tag 'documentable' tag cci: ['CCI-001891'] tag nist: ['AU-8 (1) (a)'] + tag 'host', 'container' + + describe service('chronyd') do + it { should be_enabled } + it { should be_running } + end end diff --git a/controls/SV-257945.rb b/controls/SV-257945.rb index 1b50075..fc27f59 100644 --- a/controls/SV-257945.rb +++ b/controls/SV-257945.rb @@ -6,9 +6,7 @@ Depending on the infrastructure being used the "pool" directive may not be supported. -Authoritative time sources include the United States Naval Observatory (USNO) time servers, a time server designated for the appropriate DOD network (NIPRNet/SIPRNet), and/or the Global Positioning System (GPS). - -' +Authoritative time sources include the United States Naval Observatory (USNO) time servers, a time server designated for the appropriate DOD network (NIPRNet/SIPRNet), and/or the Global Positioning System (GPS).' desc 'check', 'Verify RHEL 9 is securely comparing internal information system clocks at least every 24 hours with an NTP server with the following commands: $ sudo grep maxpoll /etc/chrony.conf @@ -28,15 +26,56 @@ server [ntp.server.name] iburst maxpoll 16' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61686r925820_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000355-GPOS-00143' + tag satisfies: ['SRG-OS-000355-GPOS-00143', 'SRG-OS-000356-GPOS-00144', 'SRG-OS-000359-GPOS-00146'] tag gid: 'V-257945' tag rid: 'SV-257945r925822_rule' tag stig_id: 'RHEL-09-252020' - tag gtitle: 'SRG-OS-000355-GPOS-00143' tag fix_id: 'F-61610r925821_fix' - tag satisfies: ['SRG-OS-000355-GPOS-00143', 'SRG-OS-000356-GPOS-00144', 'SRG-OS-000359-GPOS-00146'] - tag 'documentable' - tag cci: ['CCI-001890', 'CCI-001891', 'CCI-002046'] - tag nist: ['AU-8 b', 'AU-8 (1) (a)', 'AU-8 (1) (b)'] + tag cci: ['CCI-001891', 'CCI-001890', 'CCI-002046'] + tag nist: ['AU-8 (1) (a)', 'AU-8 b', 'AU-8 (1) (b)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + time_sources = ntp_conf('/etc/chrony.conf').server + + # Cover case when a single server is defined and resource returns a string and not an array + time_sources = [time_sources] if time_sources.is_a? String + + unless time_sources.nil? + max_poll_values = time_sources.map { |val| + val.match?(/.*maxpoll.*/) ? val.gsub(/.*maxpoll\s+(\d+)(\s+.*|$)/, '\1').to_i : 10 + } + end + + # Verify the "chrony.conf" file is configured to an authoritative DoD time source by running the following command: + + describe ntp_conf('/etc/chrony.conf') do + its('server') { should_not be_nil } + end + + unless ntp_conf('/etc/chrony.conf').server.nil? + if ntp_conf('/etc/chrony.conf').server.is_a? String + describe ntp_conf('/etc/chrony.conf') do + its('server') { should match input('authoritative_timeserver') } + end + end + + if ntp_conf('/etc/chrony.conf').server.is_a? Array + describe ntp_conf('/etc/chrony.conf') do + its('server.join') { should match input('authoritative_timeserver') } + end + end + end + # All time sources must contain valid maxpoll entries + unless time_sources.nil? + describe 'chronyd maxpoll values (99=maxpoll absent)' do + subject { max_poll_values } + it { should all be < 17 } + end + end end diff --git a/controls/SV-257946.rb b/controls/SV-257946.rb index 0dc8ef3..76a8889 100644 --- a/controls/SV-257946.rb +++ b/controls/SV-257946.rb @@ -1,8 +1,6 @@ control 'SV-257946' do title 'RHEL 9 must disable the chrony daemon from acting as a server.' - desc 'Minimizing the exposure of the server functionality of the chrony daemon diminishes the attack surface. - -' + desc 'Minimizing the exposure of the server functionality of the chrony daemon diminishes the attack surface.' desc 'check', 'Verify RHEL 9 disables the chrony daemon from acting as a server with the following command: $ grep -w port /etc/chrony.conf @@ -15,15 +13,23 @@ port 0' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61687r925823_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000096-GPOS-00050' tag gid: 'V-257946' tag rid: 'SV-257946r925825_rule' tag stig_id: 'RHEL-09-252025' - tag gtitle: 'SRG-OS-000096-GPOS-00050' tag fix_id: 'F-61611r925824_fix' - tag satisfies: ['SRG-OS-000096-GPOS-00050', 'SRG-OS-000095-GPOS-00049'] - tag 'documentable' tag cci: ['CCI-000381', 'CCI-000382'] tag nist: ['CM-7 a', 'CM-7 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/chrony.conf').exist?) + } + + chrony_conf = ntp_conf('/etc/chrony.conf') + + describe chrony_conf do + its('port') { should cmp 0 } + end end diff --git a/controls/SV-257947.rb b/controls/SV-257947.rb index 5e4bc36..3eddf6e 100644 --- a/controls/SV-257947.rb +++ b/controls/SV-257947.rb @@ -1,8 +1,6 @@ control 'SV-257947' do title 'RHEL 9 must disable network management of the chrony daemon.' - desc 'Not exposing the management interface of the chrony daemon on the network diminishes the attack space. - -' + desc 'Not exposing the management interface of the chrony daemon on the network diminishes the attack space.' desc 'check', 'Verify RHEL 9 disables network management of the chrony daemon with the following command: $ grep -w cmdport /etc/chrony.conf @@ -15,15 +13,23 @@ cmdport 0' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61688r925826_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000096-GPOS-00050' tag gid: 'V-257947' tag rid: 'SV-257947r925828_rule' tag stig_id: 'RHEL-09-252030' - tag gtitle: 'SRG-OS-000096-GPOS-00050' tag fix_id: 'F-61612r925827_fix' - tag satisfies: ['SRG-OS-000096-GPOS-00050', 'SRG-OS-000095-GPOS-00049'] - tag 'documentable' tag cci: ['CCI-000381', 'CCI-000382'] tag nist: ['CM-7 a', 'CM-7 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/chrony.conf').exist?) + } + + chrony_conf = ntp_conf('/etc/chrony.conf') + + describe chrony_conf do + its('cmdport') { should cmp 0 } + end end diff --git a/controls/SV-257948.rb b/controls/SV-257948.rb index c6a7d4f..674c75c 100644 --- a/controls/SV-257948.rb +++ b/controls/SV-257948.rb @@ -1,6 +1,9 @@ control 'SV-257948' do title 'RHEL 9 systems using Domain Name Servers (DNS) resolution must have at least two name servers configured.' - desc 'To provide availability for name resolution services, multiple redundant name servers are mandated. A failure in name resolution could lead to the failure of security functions requiring name resolution, which may include time synchronization, centralized authentication, and remote system logging.' + desc 'To provide availability for name resolution services, multiple +redundant name servers are mandated. A failure in name resolution could lead to +the failure of security functions requiring name resolution, which may include +time synchronization, centralized authentication, and remote system logging.' desc 'check', 'Verify the name servers used by the system with the following command: $ grep nameserver /etc/resolv.conf @@ -26,14 +29,49 @@ Replace [name server 1] and [name server 2] with the IPs of two different DNS resolvers. Replace [connection name] with a valid NetworkManager connection name on the system. Replace ipv4 with ipv6 if IPv6 DNS servers are used.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61689r925829_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257948' tag rid: 'SV-257948r925831_rule' tag stig_id: 'RHEL-09-252035' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61613r925830_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + dns_in_host_line = parse_config_file('/etc/nsswitch.conf', + comment_char: '#', + assignment_regex: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/).params['hosts'].include?('dns') + + unless dns_in_host_line + describe 'If `local` resolution is being used, a `hosts` entry in /etc/nsswitch.conf having `dns`' do + subject { dns_in_host_line } + it { should be false } + end + end + + unless dns_in_host_line + describe 'If `local` resoultion is being used, the /etc/resolv.conf file should' do + subject { parse_config_file('/etc/resolv.conf', comment_char: '#').params } + it { should be_empty } + end + end + + nameservers = parse_config_file('/etc/resolv.conf', + comment_char: '#').params.keys.grep(/nameserver/) + + if dns_in_host_line + describe "The system's nameservers: #{nameservers}" do + subject { nameservers } + it { should_not be nil } + end + end + + if dns_in_host_line + describe 'The number of nameservers' do + subject { nameservers.count } + it { should cmp >= 2 } + end + end end diff --git a/controls/SV-257949.rb b/controls/SV-257949.rb index 18e7028..7be1893 100644 --- a/controls/SV-257949.rb +++ b/controls/SV-257949.rb @@ -29,4 +29,20 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + network_manager = command('NetworkManager --print-config') + + if network_manager.stdout == '' && !network_manager.stderr.empty? + describe 'NetworkManager' do + it 'should be installed' do + expect(network_manager.stdout).not_to be_empty, 'NetworkManager not found on system' + end + end + else + describe ini(network_manager) do + its('main.dns') { should exist } + its('main.dns') { should be_in ['none', 'default'] } + end + end end diff --git a/controls/SV-257950.rb b/controls/SV-257950.rb index 69b788a..8fde578 100644 --- a/controls/SV-257950.rb +++ b/controls/SV-257950.rb @@ -31,4 +31,10 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe service('ipsec') do + it { should_not be_enabled } + it { should_not be_running } + end end diff --git a/controls/SV-257951.rb b/controls/SV-257951.rb index f88bab1..4668f7e 100644 --- a/controls/SV-257951.rb +++ b/controls/SV-257951.rb @@ -1,6 +1,8 @@ control 'SV-257951' do title 'RHEL 9 must be configured to prevent unrestricted mail relaying.' - desc 'If unrestricted mail relaying is permitted, unauthorized senders could use this host as a mail relay for the purpose of sending spam or other unauthorized activity.' + desc 'If unrestricted mail relaying is permitted, unauthorized senders could +use this host as a mail relay for the purpose of sending spam or other +unauthorized activity.' desc 'check', 'Verify RHEL 9 is configured to prevent unrestricted mail relaying with the following command: $ postconf -n smtpd_client_restrictions @@ -13,14 +15,27 @@ $ sudo postconf -e 'smtpd_client_restrictions = permit_mynetworks,reject'" impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61692r925838_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257951' tag rid: 'SV-257951r925840_rule' tag stig_id: 'RHEL-09-252050' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61616r925839_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + if package('postfix').installed? + describe command('postconf -n smtpd_client_restrictions') do + its('stdout.strip') { + should match(/^smtpd_client_restrictions\s+=\s+(permit_mynetworks|reject)($|(,\s*(permit_mynetworks|reject)\s*$))/i) + } + end + else + impact 0.0 + describe 'The `postfix` package is not installed' do + skip 'The `postfix` package is not installed, this control is Not Applicable' + end + end end diff --git a/controls/SV-257952.rb b/controls/SV-257952.rb index e05d5ee..c939be6 100644 --- a/controls/SV-257952.rb +++ b/controls/SV-257952.rb @@ -31,14 +31,24 @@ ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpboot' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61693r925841_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257952' tag rid: 'SV-257952r925843_rule' tag stig_id: 'RHEL-09-252055' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61617r925842_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + if input('tftp_required') + describe package('tftp-server') do + it { should be_installed } + end + else + describe package('tftp-server') do + it { should_not be_installed } + end + end end diff --git a/controls/SV-257953.rb b/controls/SV-257953.rb index 792a646..a203e9f 100644 --- a/controls/SV-257953.rb +++ b/controls/SV-257953.rb @@ -31,4 +31,11 @@ tag 'documentable' tag cci: ['CCI-000139'] tag nist: ['AU-5 a'] + tag 'host', 'container' + + options = { "assignment_regex": /^(\S+):\s*(\S+)/ } + + describe parse_config_file('/etc/aliases', options) do + its('postmaster') { should cmp 'root' } + end end diff --git a/controls/SV-257954.rb b/controls/SV-257954.rb index 315c7da..b66a7ec 100644 --- a/controls/SV-257954.rb +++ b/controls/SV-257954.rb @@ -30,4 +30,9 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-000803'] tag nist: ['CM-6 b', 'IA-7'] + tag 'host', 'container' + + describe package('libreswan') do + it { should be_installed } + end end diff --git a/controls/SV-257955.rb b/controls/SV-257955.rb index 58f93ac..9ad3e43 100644 --- a/controls/SV-257955.rb +++ b/controls/SV-257955.rb @@ -11,14 +11,22 @@ $ sudo rm /[path]/[to]/[file]/shosts.equiv' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61696r925850_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257955' tag rid: 'SV-257955r925852_rule' tag stig_id: 'RHEL-09-252070' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61620r925851_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + shosts_files = command('find / -xdev -xautofs -name shosts.equiv').stdout.strip.split("\n") + + describe 'The RHEL8 filesystem' do + it 'should not have any shosts.equiv files present' do + expect(shosts_files).to be_empty, "Discovered shosts files:\n\t- #{shosts_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257956.rb b/controls/SV-257956.rb index 5d3f299..b284b49 100644 --- a/controls/SV-257956.rb +++ b/controls/SV-257956.rb @@ -11,14 +11,22 @@ $ sudo rm /[path]/[to]/[file]/.shosts' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61697r925853_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257956' tag rid: 'SV-257956r925855_rule' tag stig_id: 'RHEL-09-252075' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61621r925854_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + shosts_files = command('find / -xdev -xautofs -name .shosts').stdout.strip.split("\n") + + describe 'The RHEL8 filesystem' do + it 'should not have any .shosts files present' do + expect(shosts_files).to be_empty, "Discovered .shosts files:\n\t- #{shosts_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-257957.rb b/controls/SV-257957.rb index 911cf53..57138ec 100644 --- a/controls/SV-257957.rb +++ b/controls/SV-257957.rb @@ -11,7 +11,7 @@ Check the status of the kernel.perf_event_paranoid kernel parameter. -$ sysctl net.ipv4.tcp_syncookies +$ sudo sysctl net.ipv4.tcp_syncookies net.ipv4.tcp_syncookies = 1 @@ -32,10 +32,10 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61698r925856_chk' + tag check_id: 'C-61698r942982_chk' tag severity: 'medium' tag gid: 'V-257957' - tag rid: 'SV-257957r925858_rule' + tag rid: 'SV-257957r942983_rule' tag stig_id: 'RHEL-09-253010' tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61622r925857_fix' @@ -43,4 +43,33 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-001095', 'CCI-002385'] tag nist: ['CM-6 b', 'SC-5 (2)', 'SC-5 a'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.tcp_syncookies' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257958.rb b/controls/SV-257958.rb index 25fc89f..bc23629 100644 --- a/controls/SV-257958.rb +++ b/controls/SV-257958.rb @@ -7,7 +7,7 @@ Check the value of the all "accept_redirects" variables with the following command: -$ sysctl net.ipv4.conf.all.accept_redirects +$ sudo sysctl net.ipv4.conf.all.accept_redirects net.ipv4.conf.all.accept_redirects = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61699r925859_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257958' - tag rid: 'SV-257958r925861_rule' + tag rid: 'SV-257958r942985_rule' tag stig_id: 'RHEL-09-253015' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61623r925860_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.all.accept_redirects' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257959.rb b/controls/SV-257959.rb index e506c6e..4f2e3ae 100644 --- a/controls/SV-257959.rb +++ b/controls/SV-257959.rb @@ -7,7 +7,7 @@ Check the value of the all "accept_source_route" variables with the following command: -$ sysctl net.ipv4.conf.all.accept_source_route +$ sudo sysctl net.ipv4.conf.all.accept_source_route net.ipv4.conf.all.accept_source_route = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61700r925862_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257959' - tag rid: 'SV-257959r925864_rule' + tag rid: 'SV-257959r942987_rule' tag stig_id: 'RHEL-09-253020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61624r925863_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.all.accept_source_route' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257960.rb b/controls/SV-257960.rb index 821d230..ffbea1a 100644 --- a/controls/SV-257960.rb +++ b/controls/SV-257960.rb @@ -39,4 +39,33 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.all.log_martians' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257961.rb b/controls/SV-257961.rb index e6d4c8f..c0d5540 100644 --- a/controls/SV-257961.rb +++ b/controls/SV-257961.rb @@ -39,4 +39,33 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.default.log_martians' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257962.rb b/controls/SV-257962.rb index 3758255..32cfed3 100644 --- a/controls/SV-257962.rb +++ b/controls/SV-257962.rb @@ -3,7 +3,7 @@ desc 'Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface on which they were received. It must not be used on systems that are routers for complicated networks, but is helpful for end hosts and routers serving small networks.' desc 'check', %q(Verify RHEL 9 uses reverse path filtering on all IPv4 interfaces with the following commands: -$ sysctl net.ipv4.conf.all.rp_filter +$ sudo sysctl net.ipv4.conf.all.rp_filter net.ipv4.conf.all.rp_filter = 1 @@ -27,14 +27,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61703r925871_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257962' - tag rid: 'SV-257962r925873_rule' + tag rid: 'SV-257962r942989_rule' tag stig_id: 'RHEL-09-253035' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61627r925872_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.all.rp_filter' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257963.rb b/controls/SV-257963.rb index ae8ce08..ee3a553 100644 --- a/controls/SV-257963.rb +++ b/controls/SV-257963.rb @@ -7,7 +7,7 @@ Check the value of the default "accept_redirects" variables with the following command: -$ sysctl net.ipv4.conf.default.accept_redirects +$ sudo sysctl net.ipv4.conf.default.accept_redirects net.ipv4.conf.default.accept_redirects = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61704r925874_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257963' - tag rid: 'SV-257963r925876_rule' + tag rid: 'SV-257963r942991_rule' tag stig_id: 'RHEL-09-253040' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61628r925875_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.default.accept_redirects' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257964.rb b/controls/SV-257964.rb index dd97ab7..4d0185f 100644 --- a/controls/SV-257964.rb +++ b/controls/SV-257964.rb @@ -7,7 +7,7 @@ Check the value of the accept source route variable with the following command: -$ sysctl net.ipv4.conf.default.accept_source_route +$ sudo sysctl net.ipv4.conf.default.accept_source_route net.ipv4.conf.default.accept_source_route = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61705r925877_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257964' - tag rid: 'SV-257964r925879_rule' + tag rid: 'SV-257964r942993_rule' tag stig_id: 'RHEL-09-253045' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61629r925878_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.default.accept_source_route' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257965.rb b/controls/SV-257965.rb index c91863f..baaf7f0 100644 --- a/controls/SV-257965.rb +++ b/controls/SV-257965.rb @@ -37,4 +37,33 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.conf.default.rp_filter' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257966.rb b/controls/SV-257966.rb index d634b8c..c875d48 100644 --- a/controls/SV-257966.rb +++ b/controls/SV-257966.rb @@ -7,7 +7,7 @@ Check the value of the "icmp_echo_ignore_broadcasts" variable with the following command: -$ sysctl net.ipv4.icmp_echo_ignore_broadcasts +$ sudo sysctl net.ipv4.icmp_echo_ignore_broadcasts net.ipv4.icmp_echo_ignore_broadcasts = 1 @@ -15,7 +15,7 @@ Check that the configuration files are present to enable this network parameter. -$ /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|$)' | grep -F net.ipv4.icmp_echo_ignore_broadcasts | tail -1 +$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|$)' | grep -F net.ipv4.icmp_echo_ignore_broadcasts | tail -1 net.ipv4.icmp_echo_ignore_broadcasts = 1 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61707r925883_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257966' - tag rid: 'SV-257966r925885_rule' + tag rid: 'SV-257966r942995_rule' tag stig_id: 'RHEL-09-253055' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61631r925884_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.icmp_echo_ignore_broadcasts' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257967.rb b/controls/SV-257967.rb index 49fafde..35c5852 100644 --- a/controls/SV-257967.rb +++ b/controls/SV-257967.rb @@ -37,4 +37,33 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv4.icmp_ignore_bogus_error_response' + value = 1 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257968.rb b/controls/SV-257968.rb index c87621f..ff74510 100644 --- a/controls/SV-257968.rb +++ b/controls/SV-257968.rb @@ -7,7 +7,7 @@ Check the value of the "all send_redirects" variables with the following command: -$ sysctl net.ipv4.conf.all.send_redirects +$ sudo sysctl net.ipv4.conf.all.send_redirects net.ipv4.conf.all.send_redirects = 0 @@ -31,14 +31,49 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61709r925889_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257968' - tag rid: 'SV-257968r925891_rule' + tag rid: 'SV-257968r942997_rule' tag stig_id: 'RHEL-09-253065' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61633r925890_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('send_redirects') + impact 0.0 + describe 'N/A' do + skip "Profile inputs indicate that this parameter's setting is a documented operational requirement" + end + else + + parameter = 'net.ipv4.conf.all.send_redirects' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end + end end diff --git a/controls/SV-257969.rb b/controls/SV-257969.rb index 6e0daa3..b45c8b1 100644 --- a/controls/SV-257969.rb +++ b/controls/SV-257969.rb @@ -7,7 +7,7 @@ Check the value of the "default send_redirects" variables with the following command: -$ sysctl net.ipv4.conf.default.send_redirects +$ sudo sysctl net.ipv4.conf.default.send_redirects net.ipv4.conf.default.send_redirects=0 @@ -31,14 +31,48 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61710r925892_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257969' - tag rid: 'SV-257969r925894_rule' + tag rid: 'SV-257969r942999_rule' tag stig_id: 'RHEL-09-253070' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61634r925893_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) { + !input('network_router') + } + if input('send_redirects') + impact 0.0 + describe 'N/A' do + skip "Profile inputs indicate that this parameter's setting is a documented operational requirement" + end + else + + parameter = 'net.ipv4.conf.default.send_redirects' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end + end end diff --git a/controls/SV-257970.rb b/controls/SV-257970.rb index 0dd6493..d5cd470 100644 --- a/controls/SV-257970.rb +++ b/controls/SV-257970.rb @@ -5,7 +5,7 @@ Check that IPv4 forwarding is disabled using the following command: -$ sysctl net.ipv4.conf.all.forwarding +$ sudo sysctl net.ipv4.conf.all.forwarding net.ipv4.conf.all.forwarding = 0 @@ -13,7 +13,7 @@ Check that the configuration files are present to enable this network parameter. -$ { /usr/lib/systemd/systemd-sysctl --cat-config; cat /etc/sysctl.conf; } | egrep -v '^(#|$)' | grep -F net.ipv4.conf.all.forwarding | tail -1 +$ sudo (/usr/lib/systemd/systemd-sysctl --cat-config; cat /etc/sysctl.conf) | egrep -v '^(#|$)' | grep net.ipv4.conf.all.forwarding | tail -1 net.ipv4.conf.all.forwarding = 0 @@ -29,14 +29,51 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61711r925895_chk' + tag check_id: 'C-61711r943000_chk' tag severity: 'medium' tag gid: 'V-257970' - tag rid: 'SV-257970r925897_rule' + tag rid: 'SV-257970r943001_rule' tag stig_id: 'RHEL-09-253075' tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61635r925896_fix' tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) { + !input('network_router') + } + + if input('forwarding') + impact 0.0 + describe 'N/A' do + skip "Profile inputs indicate that this parameter's setting is a documented operational requirement" + end + else + + parameter = 'net.ipv4.conf.all.forwarding' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end + end end diff --git a/controls/SV-257971.rb b/controls/SV-257971.rb index 9088f7e..7a68308 100644 --- a/controls/SV-257971.rb +++ b/controls/SV-257971.rb @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61712r925898_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257971' tag rid: 'SV-257971r925900_rule' tag stig_id: 'RHEL-09-254010' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61636r925899_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv6.conf.all.accept_ra' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257972.rb b/controls/SV-257972.rb index aec17c6..cc575cd 100644 --- a/controls/SV-257972.rb +++ b/controls/SV-257972.rb @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61713r925901_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257972' tag rid: 'SV-257972r925903_rule' tag stig_id: 'RHEL-09-254015' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61637r925902_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv6.conf.all.accept_redirects' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257973.rb b/controls/SV-257973.rb index daa8d66..081b7c7 100644 --- a/controls/SV-257973.rb +++ b/controls/SV-257973.rb @@ -7,7 +7,7 @@ Check the value of the accept source route variable with the following command: -$ sysctl net.ipv6.conf.all.accept_source_route +$ sudo sysctl net.ipv6.conf.all.accept_source_route net.ipv6.conf.all.accept_source_route = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61714r925904_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257973' - tag rid: 'SV-257973r925906_rule' + tag rid: 'SV-257973r943003_rule' tag stig_id: 'RHEL-09-254020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61638r925905_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv6.conf.all.accept_source_route' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257974.rb b/controls/SV-257974.rb index ad97a0c..92a7d0f 100644 --- a/controls/SV-257974.rb +++ b/controls/SV-257974.rb @@ -7,7 +7,7 @@ Check that IPv6 forwarding is disabled using the following commands: -$ sysctl net.ipv6.conf.all.forwarding +$ sudo sysctl net.ipv6.conf.all.forwarding net.ipv6.conf.all.forwarding = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61715r925907_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257974' - tag rid: 'SV-257974r925909_rule' + tag rid: 'SV-257974r943005_rule' tag stig_id: 'RHEL-09-254025' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61639r925908_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv6.conf.all.forwarding' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257975.rb b/controls/SV-257975.rb index 2e67ebf..928e330 100644 --- a/controls/SV-257975.rb +++ b/controls/SV-257975.rb @@ -7,7 +7,7 @@ Determine if router advertisements are not accepted by default by using the following command: -$ sysctl net.ipv6.conf.default.accept_ra +$ sudo sysctl net.ipv6.conf.default.accept_ra net.ipv6.conf.default.accept_ra = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61716r925910_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257975' - tag rid: 'SV-257975r925912_rule' + tag rid: 'SV-257975r943007_rule' tag stig_id: 'RHEL-09-254030' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61640r925911_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv6.conf.default.accept_ra' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257976.rb b/controls/SV-257976.rb index 3f6cd2c..9e0242d 100644 --- a/controls/SV-257976.rb +++ b/controls/SV-257976.rb @@ -7,7 +7,7 @@ Check the value of the default "accept_redirects" variables with the following command: -$ sysctl net.ipv6.conf.default.accept_redirects +$ sudo sysctl net.ipv6.conf.default.accept_redirects net.ipv6.conf.default.accept_redirects = 0 @@ -31,14 +31,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61717r925913_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257976' - tag rid: 'SV-257976r925915_rule' + tag rid: 'SV-257976r943009_rule' tag stig_id: 'RHEL-09-254035' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61641r925914_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv6.conf.default.accept_redirects' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257977.rb b/controls/SV-257977.rb index 174b708..9d54b72 100644 --- a/controls/SV-257977.rb +++ b/controls/SV-257977.rb @@ -9,7 +9,7 @@ Check the value of the accept source route variable with the following command: -$ sysctl net.ipv6.conf.default.accept_source_route +$ sudo sysctl net.ipv6.conf.default.accept_source_route net.ipv6.conf.default.accept_source_route = 0 @@ -33,14 +33,41 @@ $ sudo sysctl --system' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61718r925916_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-257977' - tag rid: 'SV-257977r925918_rule' + tag rid: 'SV-257977r943011_rule' tag stig_id: 'RHEL-09-254040' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61642r925917_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + parameter = 'net.ipv6.conf.default.accept_source_route' + value = 0 + regexp = /^\s*#{parameter}\s*=\s*#{value}\s*$/ + + describe kernel_parameter(parameter) do + its('value') { should eq value } + end + + search_results = command("/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}").stdout.strip.split("\n") + + correct_result = search_results.any? { |line| line.match(regexp) } + incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) } + + describe 'Kernel config files' do + it "should configure '#{parameter}'" do + expect(correct_result).to eq(true), 'No config file was found that correctly sets this action' + end + unless incorrect_results.nil? + it 'should not have incorrect or conflicting setting(s) in the config files' do + expect(incorrect_results).to be_empty, "Incorrect or conflicting setting(s) found:\n\t- #{incorrect_results.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-257978.rb b/controls/SV-257978.rb index 394cc78..583925d 100644 --- a/controls/SV-257978.rb +++ b/controls/SV-257978.rb @@ -1,12 +1,21 @@ control 'SV-257978' do title 'All RHEL 9 networked systems must have SSH installed.' - desc 'Without protection of the transmitted information, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read or altered. + desc 'Without protection of the transmitted information, confidentiality and +integrity may be compromised because unprotected communications can be +intercepted and either read or altered. -This requirement applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, and facsimile machines). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. + This requirement applies to both internal and external networks and all +types of information system components from which information can be +transmitted (e.g., servers, mobile devices, notebook computers, printers, +copiers, scanners, and facsimile machines). Communication paths outside the +physical protection of a controlled boundary are exposed to the possibility of +interception and modification. -Protecting the confidentiality and integrity of organizational information can be accomplished by physical means (e.g., employing physical distribution systems) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. - -' + Protecting the confidentiality and integrity of organizational information +can be accomplished by physical means (e.g., employing physical distribution +systems) or by logical means (e.g., employing cryptographic techniques). If +physical means of protection are employed, then logical means (cryptography) do +not have to be employed, and vice versa.' desc 'check', 'Verify that RHEL 9 has the openssh-server package installed with the following command: $ sudo dnf list --installed openssh-server @@ -21,15 +30,35 @@ $ sudo dnf install openssh-server' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61719r925919_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000423-GPOS-00187' + tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190'] tag gid: 'V-257978' tag rid: 'SV-257978r925921_rule' tag stig_id: 'RHEL-09-255010' - tag gtitle: 'SRG-OS-000423-GPOS-00187' tag fix_id: 'F-61643r925920_fix' - tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190'] - tag 'documentable' tag cci: ['CCI-002418', 'CCI-002420', 'CCI-002421', 'CCI-002422'] - tag nist: ['SC-8', 'SC-8 (2)', 'SC-8 (1)', 'SC-8 (2)'] + tag nist: ['SC-8', 'SC-8 (2)', 'SC-8 (1)'] + tag 'host' + tag 'container-conditional' + + openssh_present = package('openssh-server').installed? + + only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !openssh_present) + } + + if input('allow_container_openssh_server') == false + describe 'In a container Environment' do + it 'the OpenSSH Server should be installed only when allowed in a container environment' do + expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment' + end + end + else + describe 'In a machine environment' do + it 'the OpenSSH Server should be installed' do + expect(package('openssh-server').installed?).to eq(true), 'the OpenSSH Server is not installed' + end + end + end end diff --git a/controls/SV-257979.rb b/controls/SV-257979.rb index 0ae663c..babd495 100644 --- a/controls/SV-257979.rb +++ b/controls/SV-257979.rb @@ -1,12 +1,21 @@ control 'SV-257979' do title 'All RHEL 9 networked systems must have and implement SSH to protect the confidentiality and integrity of transmitted and received information, as well as information during preparation for transmission.' - desc 'Without protection of the transmitted information, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read or altered. + desc 'Without protection of the transmitted information, confidentiality and +integrity may be compromised because unprotected communications can be +intercepted and either read or altered. -This requirement applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, and facsimile machines). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. + This requirement applies to both internal and external networks and all +types of information system components from which information can be +transmitted (e.g., servers, mobile devices, notebook computers, printers, +copiers, scanners, and facsimile machines). Communication paths outside the +physical protection of a controlled boundary are exposed to the possibility of +interception and modification. -Protecting the confidentiality and integrity of organizational information can be accomplished by physical means (e.g., employing physical distribution systems) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. - -' + Protecting the confidentiality and integrity of organizational information +can be accomplished by physical means (e.g., employing physical distribution +systems) or by logical means (e.g., employing cryptographic techniques). If +physical means of protection are employed, then logical means (cryptography) do +not have to be employed, and vice versa.' desc 'check', 'Verify that "sshd" is active with the following command: $ systemctl is-active sshd @@ -19,15 +28,22 @@ $ systemctl enable --now sshd' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61720r925922_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000423-GPOS-00187' + tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190'] tag gid: 'V-257979' tag rid: 'SV-257979r925924_rule' tag stig_id: 'RHEL-09-255015' - tag gtitle: 'SRG-OS-000423-GPOS-00187' tag fix_id: 'F-61644r925923_fix' - tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190'] - tag 'documentable' tag cci: ['CCI-002418', 'CCI-002420', 'CCI-002421', 'CCI-002422'] - tag nist: ['SC-8', 'SC-8 (2)', 'SC-8 (1)', 'SC-8 (2)'] + tag nist: ['SC-8', 'SC-8 (2)', 'SC-8 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe systemd_service('sshd.service') do + it { should be_running } + end end diff --git a/controls/SV-257980.rb b/controls/SV-257980.rb index 9e17784..4182506 100644 --- a/controls/SV-257980.rb +++ b/controls/SV-257980.rb @@ -25,4 +25,13 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe package('openssh-clients') do + it { should be_installed } + end end diff --git a/controls/SV-257981.rb b/controls/SV-257981.rb index 7768c6d..3446c24 100644 --- a/controls/SV-257981.rb +++ b/controls/SV-257981.rb @@ -1,13 +1,11 @@ control 'SV-257981' do title 'RHEL 9 must display the Standard Mandatory DOD Notice and Consent Banner before granting local or remote access to the system via a SSH logon.' - desc 'The warning message reinforces policy awareness during the logon process and facilitates possible legal action against attackers. Alternatively, systems whose ownership should not be obvious should ensure usage of a banner that does not provide easy attribution. - -' + desc 'The warning message reinforces policy awareness during the logon process and facilitates possible legal action against attackers. Alternatively, systems whose ownership should not be obvious should ensure usage of a banner that does not provide easy attribution.' desc 'check', 'Verify any SSH connection to the operating system displays the Standard Mandatory DOD Notice and Consent Banner before granting access to the system. Check for the location of the banner file being used with the following command: -$ sudo grep -i banner /etc/ssh/sshd_config +$ sudo grep -ir banner /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* banner /etc/issue @@ -23,15 +21,58 @@ Banner /etc/issue' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61722r925928_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000023-GPOS-00006' + tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088'] tag gid: 'V-257981' - tag rid: 'SV-257981r925930_rule' + tag rid: 'SV-257981r943028_rule' tag stig_id: 'RHEL-09-255025' - tag gtitle: 'SRG-OS-000023-GPOS-00006' tag fix_id: 'F-61646r925929_fix' - tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088'] - tag 'documentable' tag cci: ['CCI-000048', 'CCI-001384', 'CCI-001385', 'CCI-001386', 'CCI-001387', 'CCI-001388'] - tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 3'] + tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 3'] + tag 'host' + tag 'container-conditional' + + only_if('Control not applicable - SSH is not installed within containerized RHEL', impact: 0.0) { + !virtualization.system.eql?('docker') || file('/etc/ssh/sshd_config').exist? + } + + # When Banner is commented, not found, disabled, or the specified file does not exist, this is a finding. + banner_file = sshd_config.banner + + # Banner property is commented out. + if banner_file.nil? + describe 'The SSHD Banner is not set' do + subject { banner_file.nil? } + it { should be false } + end + end + + # Banner property is set to "none" + if !banner_file.nil? && !banner_file.match(/none/i).nil? + describe 'The SSHD Banner is disabled' do + subject { banner_file.match(/none/i).nil? } + it { should be true } + end + end + + # Banner property provides a path to a file, however, it does not exist. + if !banner_file.nil? && banner_file.match(/none/i).nil? && !file(banner_file).exist? + describe 'The SSHD Banner is set, but, the file does not exist' do + subject { file(banner_file).exist? } + it { should be true } + end + end + + # Banner property provides a path to a file and it exists. + next unless !banner_file.nil? && banner_file.match(/none/i).nil? && file(banner_file).exist? + + banner = file(banner_file).content.gsub(/[\r\n\s]/, '') + expected_banner = input('banner_message_text_ral').gsub(/[\r\n\s]/, '') + + describe 'The SSHD Banner' do + it 'is set to the standard banner and has the correct text' do + expect(banner).to eq(expected_banner), 'Banner does not match expected text' + end + end end diff --git a/controls/SV-257982.rb b/controls/SV-257982.rb index 44a476f..2ab83be 100644 --- a/controls/SV-257982.rb +++ b/controls/SV-257982.rb @@ -5,7 +5,7 @@ Check what the SSH daemon's "LogLevel" option is set to with the following command: -$ sudo grep -i LogLevel /etc/ssh/sshd_config +$ sudo grep -ir LogLevel /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* LogLevel VERBOSE @@ -19,14 +19,24 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61723r925931_chk' + tag check_id: 'C-61723r943029_chk' tag severity: 'medium' tag gid: 'V-257982' - tag rid: 'SV-257982r925933_rule' + tag rid: 'SV-257982r943030_rule' tag stig_id: 'RHEL-09-255030' tag gtitle: 'SRG-OS-000032-GPOS-00013' tag fix_id: 'F-61647r925932_fix' tag 'documentable' tag cci: ['CCI-000067'] tag nist: ['AC-17 (1)'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('LogLevel') { should cmp 'VERBOSE' } + end end diff --git a/controls/SV-257983.rb b/controls/SV-257983.rb index 4995561..184486e 100644 --- a/controls/SV-257983.rb +++ b/controls/SV-257983.rb @@ -5,7 +5,7 @@ ' desc 'check', 'Verify that RHEL 9 SSH daemon accepts public key encryption with the following command: -$ sudo grep -i PubkeyAuthentication /etc/ssh/sshd_config +$ sudo grep -ir PubkeyAuthentication /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* PubkeyAuthentication yes @@ -19,10 +19,10 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61724r925934_chk' + tag check_id: 'C-61724r943031_chk' tag severity: 'medium' tag gid: 'V-257983' - tag rid: 'SV-257983r925936_rule' + tag rid: 'SV-257983r943032_rule' tag stig_id: 'RHEL-09-255035' tag gtitle: 'SRG-OS-000105-GPOS-00052' tag fix_id: 'F-61648r925935_fix' @@ -30,4 +30,14 @@ tag 'documentable' tag cci: ['CCI-000765', 'CCI-000766', 'CCI-000767', 'CCI-000768'] tag nist: ['IA-2 (1)', 'IA-2 (2)', 'IA-2 (3)', 'IA-2 (4)'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('PubkeyAuthentication') { should cmp 'yes' } + end end diff --git a/controls/SV-257984.rb b/controls/SV-257984.rb index ec554c6..e094f5c 100644 --- a/controls/SV-257984.rb +++ b/controls/SV-257984.rb @@ -5,7 +5,7 @@ ' desc 'check', 'Verify RHEL 9 remote access using SSH prevents logging on with a blank password with the following command: -$ sudo grep -i PermitEmptyPasswords /etc/ssh/sshd_config +$ sudo grep -ir PermitEmptyPasswords /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* PermitEmptyPassword no @@ -19,10 +19,10 @@ $ sudo systemctl restart sshd.service' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61725r925937_chk' + tag check_id: 'C-61725r943033_chk' tag severity: 'high' tag gid: 'V-257984' - tag rid: 'SV-257984r925939_rule' + tag rid: 'SV-257984r943034_rule' tag stig_id: 'RHEL-09-255040' tag gtitle: 'SRG-OS-000106-GPOS-00053' tag fix_id: 'F-61649r925938_fix' @@ -30,4 +30,14 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-000766'] tag nist: ['CM-6 b', 'IA-2 (2)'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('PermitEmptyPasswords') { should cmp 'no' } + end end diff --git a/controls/SV-257985.rb b/controls/SV-257985.rb index efc47ff..8e74a64 100644 --- a/controls/SV-257985.rb +++ b/controls/SV-257985.rb @@ -1,11 +1,9 @@ control 'SV-257985' do title 'RHEL 9 must not permit direct logons to the root account using remote access via SSH.' - desc "Even though the communications channel may be encrypted, an additional layer of security is gained by extending the policy of not logging directly on as root. In addition, logging in with a user-specific account provides individual accountability of actions performed on the system and also helps to minimize direct attack attempts on root's password. - -" + desc "Even though the communications channel may be encrypted, an additional layer of security is gained by extending the policy of not logging directly on as root. In addition, logging in with a user-specific account provides individual accountability of actions performed on the system and also helps to minimize direct attack attempts on root's password." desc 'check', 'Verify RHEL 9 remote access using SSH prevents users from logging on directly as "root" with the following command: -$ sudo grep -i PermitRootLogin /etc/ssh/sshd_config +$ sudo grep -ir PermitRootLogin /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* PermitRootLogin no @@ -19,15 +17,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61726r925940_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000109-GPOS-00056' tag gid: 'V-257985' - tag rid: 'SV-257985r928961_rule' + tag rid: 'SV-257985r943036_rule' tag stig_id: 'RHEL-09-255045' - tag gtitle: 'SRG-OS-000109-GPOS-00056' tag fix_id: 'F-61650r925941_fix' - tag satisfies: ['SRG-OS-000109-GPOS-00056', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-000770'] - tag nist: ['CM-6 b', 'IA-2 (5)'] + tag cci: ['CCI-000770', 'CCI-000366'] + tag nist: ['IA-2 (5)', 'CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('PermitRootLogin') { should cmp input('permit_root_login') } + end end diff --git a/controls/SV-257986.rb b/controls/SV-257986.rb index 6ede42d..b032835 100644 --- a/controls/SV-257986.rb +++ b/controls/SV-257986.rb @@ -3,7 +3,7 @@ desc 'When UsePAM is set to "yes", PAM runs through account and session types properly. This is important when restricted access to services based off of IP, time, or other factors of the account is needed. Additionally, this ensures users can inherit certain environment variables on login or disallow access to the server.' desc 'check', 'Verify the RHEL 9 SSHD is configured to allow for the UsePAM interface with the following command: -$ sudo grep -i usepam /etc/ssh/sshd_config +$ sudo grep -ir usepam /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* UsePAM yes @@ -17,14 +17,24 @@ $ sudo systemctl restart sshd.service' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61727r925943_chk' + tag check_id: 'C-61727r943037_chk' tag severity: 'high' tag gid: 'V-257986' - tag rid: 'SV-257986r925945_rule' + tag rid: 'SV-257986r943038_rule' tag stig_id: 'RHEL-09-255050' tag gtitle: 'SRG-OS-000125-GPOS-00065' tag fix_id: 'F-61651r925944_fix' tag 'documentable' tag cci: ['CCI-000877'] tag nist: ['MA-4 c'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('UsePAM') { should cmp 'yes' } + end end diff --git a/controls/SV-257987.rb b/controls/SV-257987.rb index 9437dcd..1c53b12 100644 --- a/controls/SV-257987.rb +++ b/controls/SV-257987.rb @@ -18,14 +18,38 @@ $ sudo dnf reinstall openssh-server' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61728r925946_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000250-GPOS-00093' + tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065'] tag gid: 'V-257987' tag rid: 'SV-257987r925948_rule' tag stig_id: 'RHEL-09-255055' - tag gtitle: 'SRG-OS-000250-GPOS-00093' tag fix_id: 'F-61652r925947_fix' - tag 'documentable' tag cci: ['CCI-001453'] tag nist: ['AC-17 (2)'] + tag 'host' + tag 'container-conditional' + + openssh_present = package('openssh-server').installed? + + only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !openssh_present) + } + + if input('allow_container_openssh_server') == false + describe 'In a container Environment' do + it 'the OpenSSH Server should be installed only when allowed in a container environment' do + expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment' + end + end + else + describe file('/etc/ssh/sshd_config.d/50-redhat.conf') do + it { should exist } + end + describe 'The system' do + it 'does not have a CRYPTO_POLICY setting configured' do + expect(parse_config_file('/etc/sysconfig/sshd').params['CRYPTO_POLICY']).to be_nil, 'The CRYPTO_POLICY setting in the /etc/sysconfig/sshd should not be present. Please ensure it is commented out.' + end + end + end end diff --git a/controls/SV-257988.rb b/controls/SV-257988.rb index 314db07..9c2d01d 100644 --- a/controls/SV-257988.rb +++ b/controls/SV-257988.rb @@ -30,4 +30,28 @@ tag 'documentable' tag cci: ['CCI-001453'] tag nist: ['AC-17 (2)'] + tag 'host' + tag 'container-conditional' + + openssh_present = package('openssh-server').installed? + + only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !openssh_present) + } + + describe file('/etc/ssh/sshd_config.d/50-redhat.conf') do + it { should exist } + end + + sshd_grep = command('grep Include /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*').stdout.lines.map(&:strip) + + star_dot_conf = sshd_grep.any? { |line| line.match?(%r{Include /etc/ssh/sshd_config.d/\*\.conf$}i) } + opensshserver_config = sshd_grep.any? { |line| line.match?(%r{Include /etc/crypto-policies/back-ends/opensshserver\.config$}i) } + + describe 'SSHD config files' do + it 'should include system-wide crypto policies' do + expect(star_dot_conf).to eq(true), 'SSHD conf files do not include /etc/ssh/sshd_config.d/*.conf' + expect(opensshserver_config).to eq(true), 'SSHD conf files do not include /etc/crypto-policies/back-ends/opensshserver.config' + end + end end diff --git a/controls/SV-257989.rb b/controls/SV-257989.rb index 776bc89..d95e156 100644 --- a/controls/SV-257989.rb +++ b/controls/SV-257989.rb @@ -11,24 +11,42 @@ $ sudo grep -i ciphers /etc/crypto-policies/back-ends/openssh.config -Ciphers aes-256-gcm@openssh.com, chacha20-poly1305@openssh.com, aes256-ctr,aes128-gcm@openssh.com,aes128-ctr +Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr -If the cipher entries in the "openssh.config" file have any ciphers other than "aes-256-gcm@openssh.com, chacha20-poly1305@openssh.com, aes256-ctr,aes128-gcm@openssh.com,aes128-ctr", the order differs from the example above, they are missing, or commented out, this is a finding.' +If the cipher entries in the "openssh.config" file have any ciphers other than "aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr", the order differs from the example above, they are missing, or commented out, this is a finding.' desc 'fix', 'Configure the RHEL 9 SSH client to use only ciphers employing FIPS 140-3 approved algorithms by updating the "/etc/crypto-policies/back-ends/openssh.config" file with the following line: -Ciphers aes-256-gcm@openssh.com, chacha20-poly1305@openssh.com, aes256-ctr,aes128-gcm@openssh.com,aes128-ctr +Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr A reboot is required for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61730r925952_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000250-GPOS-00093' + tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065'] tag gid: 'V-257989' - tag rid: 'SV-257989r925954_rule' + tag rid: 'SV-257989r943014_rule' tag stig_id: 'RHEL-09-255065' - tag gtitle: 'SRG-OS-000250-GPOS-00093' - tag fix_id: 'F-61654r925953_fix' - tag 'documentable' + tag fix_id: 'F-61654r943013_fix' tag cci: ['CCI-001453'] tag nist: ['AC-17 (2)'] + tag 'host' + tag 'container-conditional' + + only_if('Control not applicable - SSH is not installed within containerized RHEL', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/sysconfig/sshd').exist?) + } + + approved_ciphers = input('approved_openssh_server_conf')['ciphers'] + + options = { 'assignment_regex': /^(\S+)\s+(\S+)$/ } + opensshserver_conf = parse_config_file('/etc/crypto-policies/back-ends/opensshserver.config', options).params.map { |k, v| [k.downcase, v.split(',')] }.to_h + + actual_ciphers = opensshserver_conf['ciphers'].join(',') + + describe 'OpenSSH server configuration' do + it 'implement approved encryption ciphers' do + expect(actual_ciphers).to eq(approved_ciphers), "OpenSSH server cipher configuration actual value:\n\t#{actual_ciphers}\ndoes not match the expected value:\n\t#{approved_ciphers}" + end + end end diff --git a/controls/SV-257990.rb b/controls/SV-257990.rb index 2f5caf8..13ef554 100644 --- a/controls/SV-257990.rb +++ b/controls/SV-257990.rb @@ -30,4 +30,23 @@ tag 'documentable' tag cci: ['CCI-001453'] tag nist: ['AC-17 (2)'] + tag 'host' + tag 'container-conditional' + + only_if('Control not applicable - SSH is not installed within containerized RHEL', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/sysconfig/sshd').exist?) + } + + approved_macs = input('approved_openssh_server_conf')['macs'] + + options = { 'assignment_regex': /^(\S+)\s+(\S+)$/ } + opensshserver_conf = parse_config_file('/etc/crypto-policies/back-ends/opensshserver.config', options).params.map { |k, v| [k.downcase, v.split(',')] }.to_h + + actual_macs = opensshserver_conf['macs'].join(',') + + describe 'OpenSSH server configuration' do + it 'implement approved MACs' do + expect(actual_macs).to eq(approved_macs), "OpenSSH server cipher configuration actual value:\n\t#{actual_macs}\ndoes not match the expected value:\n\t#{approved_macs}" + end + end end diff --git a/controls/SV-257991.rb b/controls/SV-257991.rb index 4d7e379..fd9bd5c 100644 --- a/controls/SV-257991.rb +++ b/controls/SV-257991.rb @@ -20,14 +20,35 @@ A reboot is required for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61732r925958_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000250-GPOS-00093' + tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065'] tag gid: 'V-257991' tag rid: 'SV-257991r925960_rule' tag stig_id: 'RHEL-09-255075' - tag gtitle: 'SRG-OS-000250-GPOS-00093' tag fix_id: 'F-61656r925959_fix' - tag 'documentable' tag cci: ['CCI-001453'] tag nist: ['AC-17 (2)'] + tag 'host' + tag 'container-conditional' + + # NOTE: At time of writing, the STIG baseline calls for two different values for the MACs option in the openssh.config file. + # SV-257990 calls for one set of MACs and SV-257991 calls for a mutually exclusive set. + + only_if('Control not applicable - SSH is not installed within containerized RHEL', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/sysconfig/sshd').exist?) + } + + approved_macs = input('approved_openssh_server_conf')['macs'] + + options = { 'assignment_regex': /^(\S+)\s+(\S+)$/ } + opensshserver_conf = parse_config_file('/etc/crypto-policies/back-ends/opensshserver.config', options).params.map { |k, v| [k.downcase, v.split(',')] }.to_h + + actual_macs = opensshserver_conf['macs'].join(',') + + describe 'OpenSSH server configuration' do + it 'implement approved MACs' do + expect(actual_macs).to eq(approved_macs), "OpenSSH server cipher configuration actual value:\n\t#{actual_macs}\ndoes not match the expected value:\n\t#{approved_macs}" + end + end end diff --git a/controls/SV-257992.rb b/controls/SV-257992.rb index 88a5bd5..3ff6f1b 100644 --- a/controls/SV-257992.rb +++ b/controls/SV-257992.rb @@ -3,7 +3,7 @@ desc 'SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.' desc 'check', 'Verify the operating system does not allow a noncertificate trusted host SSH logon to the system with the following command: -$ sudo grep -i hostbasedauthentication /etc/ssh/sshd_config +$ sudo grep -ir hostbasedauthentication /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* HostbasedAuthentication no @@ -19,14 +19,24 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61733r925961_chk' + tag check_id: 'C-61733r943039_chk' tag severity: 'medium' tag gid: 'V-257992' - tag rid: 'SV-257992r925963_rule' + tag rid: 'SV-257992r943040_rule' tag stig_id: 'RHEL-09-255080' tag gtitle: 'SRG-OS-000480-GPOS-00229' tag fix_id: 'F-61657r925962_fix' tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('HostBasedAuthentication') { should cmp 'no' } + end end diff --git a/controls/SV-257993.rb b/controls/SV-257993.rb index 2bc1e2d..faced3c 100644 --- a/controls/SV-257993.rb +++ b/controls/SV-257993.rb @@ -1,9 +1,10 @@ control 'SV-257993' do title 'RHEL 9 must not allow users to override SSH environment variables.' - desc 'SSH environment options potentially allow users to bypass access restriction in some configurations.' + desc 'SSH environment options potentially allow users to bypass access +restriction in some configurations.' desc 'check', 'Verify that unattended or automatic logon via SSH is disabled with the following command: -$ sudo grep -i permituserenvironment /etc/ssh/sshd_config +$ sudo grep -ir permituserenvironment /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* PermitUserEnvironment no @@ -21,14 +22,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61734r925964_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00229' tag gid: 'V-257993' - tag rid: 'SV-257993r925966_rule' + tag rid: 'SV-257993r943042_rule' tag stig_id: 'RHEL-09-255085' - tag gtitle: 'SRG-OS-000480-GPOS-00229' tag fix_id: 'F-61658r925965_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This requirement is Not Applicable inside a container, the containers host manages the containers filesystems') { + !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?) + } + + describe sshd_config do + its('PermitUserEnvironment') { should eq 'no' } + end end diff --git a/controls/SV-257994.rb b/controls/SV-257994.rb index 8458085..249b171 100644 --- a/controls/SV-257994.rb +++ b/controls/SV-257994.rb @@ -1,17 +1,27 @@ control 'SV-257994' do title 'RHEL 9 must force a frequent session key renegotiation for SSH connections to the server.' - desc 'Without protection of the transmitted information, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read or altered. - -This requirement applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, and facsimile machines). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. - -Protecting the confidentiality and integrity of organizational information can be accomplished by physical means (e.g., employing physical distribution systems) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. - -Session key regeneration limits the chances of a session key becoming compromised. - -' + desc 'Without protection of the transmitted information, confidentiality and +integrity may be compromised because unprotected communications can be +intercepted and either read or altered. + + This requirement applies to both internal and external networks and all +types of information system components from which information can be +transmitted (e.g., servers, mobile devices, notebook computers, printers, +copiers, scanners, and facsimile machines). Communication paths outside the +physical protection of a controlled boundary are exposed to the possibility of +interception and modification. + + Protecting the confidentiality and integrity of organizational information +can be accomplished by physical means (e.g., employing physical distribution +systems) or by logical means (e.g., employing cryptographic techniques). If +physical means of protection are employed, then logical means (cryptography) do +not have to be employed, and vice versa. + + Session key regeneration limits the chances of a session key becoming +compromised.' desc 'check', 'Verify the SSH server is configured to force frequent session key renegotiation with the following command: -$ sudo grep -i rekeyLimit /etc/ssh/sshd_config +$ sudo grep -ir rekeyLimit /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* RekeyLimit 1G 1h @@ -25,15 +35,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61735r925967_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000423-GPOS-00187' + tag satisfies: ['SRG-OS-000033-GPOS-00014', 'SRG-OS-000420-GPOS-00186', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000423-GPOS-00187'] tag gid: 'V-257994' - tag rid: 'SV-257994r925969_rule' + tag rid: 'SV-257994r943044_rule' tag stig_id: 'RHEL-09-255090' - tag gtitle: 'SRG-OS-000423-GPOS-00187' tag fix_id: 'F-61659r925968_fix' - tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000033-GPOS-00014', 'SRG-OS-000424-GPOS-00188'] - tag 'documentable' tag cci: ['CCI-000068', 'CCI-002418', 'CCI-002421'] tag nist: ['AC-17 (2)', 'SC-8', 'SC-8 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers without SSH enabled', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?) + } + + describe sshd_config do + its('RekeyLimit') { should cmp '1G 1h' } + end end diff --git a/controls/SV-257995.rb b/controls/SV-257995.rb index 06916a0..8e6413d 100644 --- a/controls/SV-257995.rb +++ b/controls/SV-257995.rb @@ -4,16 +4,14 @@ Terminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session. -RHEL 9 utilizes /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of "ClientAliveInterval" and "ClientAliveCountMax" are used to establish the inactivity threshold. The "ClientAliveInterval" is a timeout interval in seconds, after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The "ClientAliveCountMax" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages. - -' +RHEL 9 utilizes /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of "ClientAliveInterval" and "ClientAliveCountMax" are used to establish the inactivity threshold. The "ClientAliveInterval" is a timeout interval in seconds, after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The "ClientAliveCountMax" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.' desc 'check', 'Verify that the "ClientAliveCountMax" is set to "1" by performing the following command: $ sudo grep -i countmax /etc/ssh/sshd_config ClientAliveCountMax 1 -If "ClientAliveCountMax" do not exist, is not set to a value of "0" in "/etc/ssh/sshd_config", or is commented out, this is a finding.' +If "ClientAliveCountMax" do not exist, is not set to a value of "1" in "/etc/ssh/sshd_config", or is commented out, this is a finding.' desc 'fix', 'Note: This setting must be applied in conjunction with RHEL-09-255100 to function correctly. Configure the SSH server to terminate a user session automatically after the SSH client has become unresponsive. @@ -27,15 +25,34 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61736r925970_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000163-GPOS-00072' + tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000126-GPOS-00066', 'SRG-OS-000279-GPOS-00109'] tag gid: 'V-257995' - tag rid: 'SV-257995r925972_rule' + tag rid: 'SV-257995r942963_rule' tag stig_id: 'RHEL-09-255095' - tag gtitle: 'SRG-OS-000163-GPOS-00072' tag fix_id: 'F-61660r925971_fix' - tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000279-GPOS-00109'] - tag 'documentable' tag cci: ['CCI-001133', 'CCI-002361'] tag nist: ['SC-10', 'AC-12'] + tag 'host' + tag 'container-conditional' + + only_if('SSH is not installed on the system this requirement is Not Applicable', impact: 0.0) { + (service('sshd').enabled? || package('openssh-server').installed?) + } + + client_alive_count = input('sshd_client_alive_count_max') + + if virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist? + impact 0.0 + describe 'skip' do + skip 'SSH configuration does not apply inside containers. This control is Not Applicable.' + end + else + describe 'SSH ClientAliveCountMax configuration' do + it "should be set to #{client_alive_count}" do + expect(sshd_config.ClientAliveCountMax).to(cmp(client_alive_count), "SSH ClientAliveCountMax is commented out or not set to the expected value (#{client_alive_count})") + end + end + end end diff --git a/controls/SV-257996.rb b/controls/SV-257996.rb index 48c37c4..5e07efd 100644 --- a/controls/SV-257996.rb +++ b/controls/SV-257996.rb @@ -4,12 +4,10 @@ Terminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session. -RHEL 9 utilizes /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of "ClientAliveInterval" and "ClientAliveCountMax" are used to establish the inactivity threshold. The "ClientAliveInterval" is a timeout interval in seconds, after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The "ClientAliveCountMax" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages. - -' +RHEL 9 utilizes /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of "ClientAliveInterval" and "ClientAliveCountMax" are used to establish the inactivity threshold. The "ClientAliveInterval" is a timeout interval in seconds, after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The "ClientAliveCountMax" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.' desc 'check', 'Verify that the "ClientAliveInterval" variable is set to a value of "600" or less by performing the following command: -$ sudo grep -i interval /etc/ssh/sshd_config +$ sudo grep -ir interval /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* ClientAliveInterval 600 @@ -27,15 +25,38 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61737r925973_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000126-GPOS-00066' + tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000126-GPOS-00066', 'SRG-OS-000279-GPOS-00109', 'SRG-OS-000395-GPOS-00175'] tag gid: 'V-257996' - tag rid: 'SV-257996r925975_rule' + tag rid: 'SV-257996r943046_rule' tag stig_id: 'RHEL-09-255100' - tag gtitle: 'SRG-OS-000126-GPOS-00066' tag fix_id: 'F-61661r925974_fix' - tag satisfies: ['SRG-OS-000126-GPOS-00066', 'SRG-OS-000163-GPOS-00072', 'SRG-OS-000279-GPOS-00109', 'SRG-OS-000395-GPOS-00175'] - tag 'documentable' - tag cci: ['CCI-000879', 'CCI-001133', 'CCI-002361', 'CCI-002891'] - tag nist: ['MA-4 e', 'SC-10', 'AC-12', 'MA-4 (7)'] + tag cci: ['CCI-001133', 'CCI-000879', 'CCI-002361', 'CCI-002891'] + tag nist: ['SC-10', 'MA-4 e', 'AC-12', 'MA-4 (7)'] + tag 'host' + tag 'container-conditional' + + setting = 'ClientAliveInterval' + gssapi_authentication = input('sshd_config_values') + value = gssapi_authentication[setting] + openssh_present = package('openssh-server').installed? + + only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !openssh_present) + } + + if input('allow_container_openssh_server') == false + describe 'In a container Environment' do + it 'the OpenSSH Server should be installed only when allowed in a container environment' do + expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment' + end + end + else + describe 'The OpenSSH Server configuration' do + it "has the correct #{setting} configuration" do + expect(sshd_config.params[setting.downcase]).to cmp(value), "The #{setting} setting in the SSHD config is not correct. Please ensure it set to '#{value}'." + end + end + end end diff --git a/controls/SV-257997.rb b/controls/SV-257997.rb index 64e4c51..cad3b42 100644 --- a/controls/SV-257997.rb +++ b/controls/SV-257997.rb @@ -23,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe file('/etc/ssh/sshd_config') do + it { should exist } + its('group') { should cmp 'root' } + end end diff --git a/controls/SV-257998.rb b/controls/SV-257998.rb index 6df9dfc..6b5e0a3 100644 --- a/controls/SV-257998.rb +++ b/controls/SV-257998.rb @@ -23,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe file('/etc/ssh/sshd_config') do + it { should exist } + it { should be_owned_by 'root' } + end end diff --git a/controls/SV-257999.rb b/controls/SV-257999.rb index e43b439..9fee7c7 100644 --- a/controls/SV-257999.rb +++ b/controls/SV-257999.rb @@ -23,4 +23,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + system_file = '/etc/ssh/sshd_config' + + mode = input('expected_modes')[system_file] + + describe file(system_file) do + it { should exist } + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-258000.rb b/controls/SV-258000.rb index e47c651..ec8c6f7 100644 --- a/controls/SV-258000.rb +++ b/controls/SV-258000.rb @@ -1,6 +1,7 @@ control 'SV-258000' do title 'RHEL 9 SSH private host key files must have mode 0640 or less permissive.' - desc 'If an unauthorized user obtains the private SSH host key file, the host could be impersonated.' + desc 'If an unauthorized user obtains the private SSH host key file, the +host could be impersonated.' desc 'check', 'Verify the SSH private host key files have a mode of "0640" or less permissive with the following command: $ ls -l /etc/ssh/*_key @@ -20,14 +21,29 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61741r925985_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258000' tag rid: 'SV-258000r925987_rule' tag stig_id: 'RHEL-09-255120' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61665r925986_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + ssh_host_key_dirs = input('ssh_host_key_dirs').join(' ') + priv_keys = command("find #{ssh_host_key_dirs} -xdev -name '*.pem'").stdout.split("\n") + mode = input('ssh_private_key_mode') + failing_keys = priv_keys.select { |key| file(key).more_permissive_than?(mode) } + + describe 'All SSH private keys on the filesystem' do + it "should be less permissive than #{mode}" do + expect(failing_keys).to be_empty, "Failing keyfiles:\n\t- #{failing_keys.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258001.rb b/controls/SV-258001.rb index cb4cdff..5925c11 100644 --- a/controls/SV-258001.rb +++ b/controls/SV-258001.rb @@ -1,6 +1,7 @@ control 'SV-258001' do title 'RHEL 9 SSH public host key files must have mode 0644 or less permissive.' - desc 'If a public host key file is modified by an unauthorized user, the SSH service may be compromised.' + desc 'If a public host key file is modified by an unauthorized user, the SSH +service may be compromised.' desc 'check', 'Verify the SSH public host key files have a mode of "0644" or less permissive with the following command: Note: SSH public key files may be found in other directories on the system depending on the installation. @@ -22,14 +23,29 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61742r925988_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258001' tag rid: 'SV-258001r925990_rule' tag stig_id: 'RHEL-09-255125' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61666r925989_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + ssh_host_key_dirs = input('ssh_host_key_dirs').join(' ') + pub_keys = command("find #{ssh_host_key_dirs} -xdev -name '*.pub'").stdout.split("\n") + mode = input('ssh_pub_key_mode') + failing_keys = pub_keys.select { |key| file(key).more_permissive_than?(mode) } + + describe 'All SSH public keys on the filesystem' do + it "should be less permissive than #{mode}" do + expect(failing_keys).to be_empty, "Failing keyfiles:\n\t- #{failing_keys.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258002.rb b/controls/SV-258002.rb index 422bf4b..f3cfdca 100644 --- a/controls/SV-258002.rb +++ b/controls/SV-258002.rb @@ -29,4 +29,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('Compression') { should be_in ['delayed', 'no'] } + end end diff --git a/controls/SV-258003.rb b/controls/SV-258003.rb index ec7fc2b..5dab4cc 100644 --- a/controls/SV-258003.rb +++ b/controls/SV-258003.rb @@ -1,8 +1,6 @@ control 'SV-258003' do title 'RHEL 9 SSH daemon must not allow GSSAPI authentication.' - desc "Generic Security Service Application Program Interface (GSSAPI) authentication is used to provide additional authentication mechanisms to applications. Allowing GSSAPI authentication through SSH exposes the system's GSSAPI to remote hosts, increasing the attack surface of the system. - -" + desc "Generic Security Service Application Program Interface (GSSAPI) authentication is used to provide additional authentication mechanisms to applications. Allowing GSSAPI authentication through SSH exposes the system's GSSAPI to remote hosts, increasing the attack surface of the system." desc 'check', 'Verify the SSH daemon does not allow GSSAPI authentication with the following command: $ sudo grep -ir gssapiauth /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* @@ -23,15 +21,38 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61744r925994_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000364-GPOS-00151' tag gid: 'V-258003' tag rid: 'SV-258003r925996_rule' tag stig_id: 'RHEL-09-255135' - tag gtitle: 'SRG-OS-000364-GPOS-00151' tag fix_id: 'F-61668r925995_fix' - tag satisfies: ['SRG-OS-000364-GPOS-00151', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001813'] tag nist: ['CM-6 b', 'CM-5 (1) (a)'] + tag 'host' + tag 'container-conditional' + + setting = 'GSSAPIAuthentication' + gssapi_authentication = input('sshd_config_values') + value = gssapi_authentication[setting] + + if virtualization.system.eql?('docker') + describe 'In a container Environment' do + if package('openssh-server').installed? + it 'the OpenSSH Server should be installed when allowed in Docker environment' do + expect(input('allow_container_openssh_server')).to eq(true), 'OpenSSH Server is installed but not approved for the Docker environment' + end + else + it 'the OpenSSH Server is not installed' do + skip 'This requirement is not applicable as the OpenSSH Server is not installed in the Docker environment.' + end + end + end + else + describe 'The OpenSSH Server configuration' do + it "has the correct #{setting} configuration" do + expect(sshd_config.params[setting.downcase]).to cmp(value), "The #{setting} setting in the SSHD config is not correct. Please ensure it set to '#{value}'." + end + end + end end diff --git a/controls/SV-258004.rb b/controls/SV-258004.rb index 656a5e2..e5faf92 100644 --- a/controls/SV-258004.rb +++ b/controls/SV-258004.rb @@ -1,8 +1,6 @@ control 'SV-258004' do title 'RHEL 9 SSH daemon must not allow Kerberos authentication.' - desc "Kerberos authentication for SSH is often implemented using Generic Security Service Application Program Interface (GSSAPI). If Kerberos is enabled through SSH, the SSH daemon provides a means of access to the system's Kerberos implementation. Vulnerabilities in the system's Kerberos implementations may be subject to exploitation. - -" + desc "Kerberos authentication for SSH is often implemented using Generic Security Service Application Program Interface (GSSAPI). If Kerberos is enabled through SSH, the SSH daemon provides a means of access to the system's Kerberos implementation. Vulnerabilities in the system's Kerberos implementations may be subject to exploitation." desc 'check', 'Verify the SSH daemon does not allow Kerberos authentication with the following command: $ sudo grep -i kerberosauth /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* @@ -21,15 +19,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61745r925997_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000364-GPOS-00151' tag gid: 'V-258004' tag rid: 'SV-258004r925999_rule' tag stig_id: 'RHEL-09-255140' - tag gtitle: 'SRG-OS-000364-GPOS-00151' tag fix_id: 'F-61669r925998_fix' - tag satisfies: ['SRG-OS-000364-GPOS-00151', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001813'] tag nist: ['CM-6 b', 'CM-5 (1) (a)'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('KerberosAuthentication') { should cmp 'no' } + end end diff --git a/controls/SV-258005.rb b/controls/SV-258005.rb index ab146f2..57035b4 100644 --- a/controls/SV-258005.rb +++ b/controls/SV-258005.rb @@ -29,4 +29,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('IgnoreRhosts') { should cmp 'yes' } + end end diff --git a/controls/SV-258006.rb b/controls/SV-258006.rb index 71d1e70..feaa878 100644 --- a/controls/SV-258006.rb +++ b/controls/SV-258006.rb @@ -19,14 +19,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61747r926003_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258006' tag rid: 'SV-258006r926005_rule' tag stig_id: 'RHEL-09-255150' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61671r926004_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('IgnoreUserKnownHosts') { should cmp 'yes' } + end end diff --git a/controls/SV-258007.rb b/controls/SV-258007.rb index 5bcdc82..caab63d 100644 --- a/controls/SV-258007.rb +++ b/controls/SV-258007.rb @@ -10,7 +10,7 @@ If the value is returned as "yes", the returned line is commented out, or no output is returned, and X11 forwarding is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.' desc 'fix', 'Configure the SSH daemon to not allow X11 forwarding. -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "yes": +Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "no": X11forwarding no @@ -19,14 +19,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61748r926006_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258007' - tag rid: 'SV-258007r926008_rule' + tag rid: 'SV-258007r943048_rule' tag stig_id: 'RHEL-09-255155' - tag gtitle: 'SRG-OS-000480-GPOS-00227' - tag fix_id: 'F-61672r926007_fix' - tag 'documentable' + tag fix_id: 'F-61672r943047_fix' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?) + } + + describe sshd_config do + its('X11Forwarding') { should cmp 'no' } + end end diff --git a/controls/SV-258008.rb b/controls/SV-258008.rb index 806e3b3..56814ea 100644 --- a/controls/SV-258008.rb +++ b/controls/SV-258008.rb @@ -19,14 +19,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61749r926009_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258008' tag rid: 'SV-258008r926011_rule' tag stig_id: 'RHEL-09-255160' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61673r926010_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('StrictModes') { should cmp 'yes' } + end end diff --git a/controls/SV-258009.rb b/controls/SV-258009.rb index 2d0f572..b184569 100644 --- a/controls/SV-258009.rb +++ b/controls/SV-258009.rb @@ -19,14 +19,25 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61750r926012_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258009' tag rid: 'SV-258009r926014_rule' tag stig_id: 'RHEL-09-255165' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61674r926013_fix' - tag 'documentable' - tag cci: ['CCI-000366'] - tag nist: ['CM-6 b'] + tag cci: ['CCI-000366', 'CCI-000052'] + tag nist: ['CM-6 b', 'AC-9'] + tag 'host' + tag 'container-conditional' + + if virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist? + impact 0.0 + describe 'Control not applicable - SSH is not installed within containerized RHEL' do + skip 'Control not applicable - SSH is not installed within containerized RHEL' + end + else + describe sshd_config do + its('PrintLastLog') { should cmp 'yes' } + end + end end diff --git a/controls/SV-258010.rb b/controls/SV-258010.rb index f0a7f26..a287d29 100644 --- a/controls/SV-258010.rb +++ b/controls/SV-258010.rb @@ -29,4 +29,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?) + } + + describe sshd_config do + its('UsePrivilegeSeparation') { should be_in ['sandbox', 'yes'] } + end end diff --git a/controls/SV-258011.rb b/controls/SV-258011.rb index 608bab1..32f98cc 100644 --- a/controls/SV-258011.rb +++ b/controls/SV-258011.rb @@ -3,7 +3,7 @@ desc 'When X11 forwarding is enabled, there may be additional exposure to the server and client displays if the sshd proxy display is configured to listen on the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the "DISPLAY" environment variable to localhost. This prevents remote hosts from connecting to the proxy display.' desc 'check', 'Verify the SSH daemon prevents remote hosts from connecting to the proxy display with the following command: -$ sudo grep -i x11uselocal /etc/ssh/sshd_config +$ sudo grep -ir x11uselocal /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* X11UseLocalhost yes @@ -19,14 +19,22 @@ $ sudo systemctl restart sshd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61752r926018_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258011' - tag rid: 'SV-258011r926020_rule' + tag rid: 'SV-258011r943050_rule' tag stig_id: 'RHEL-09-255175' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61676r926019_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container-conditional' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?) + } + + describe sshd_config do + its('X11UseLocalhost') { should cmp 'yes' } + end end diff --git a/controls/SV-258012.rb b/controls/SV-258012.rb index 1302d77..7ee7c3b 100644 --- a/controls/SV-258012.rb +++ b/controls/SV-258012.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must display the Standard Mandatory DOD Notice and Consent Banner before granting local or remote access to the system via a graphical user logon.' desc 'Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. -For U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist. - -' +For U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist.' desc 'check', 'Verify RHEL 9 displays a banner before granting access to the operating system via a graphical user logon. Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -33,15 +31,31 @@ $ sudo dconf update' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61753r926021_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000023-GPOS-00006' + tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088'] tag gid: 'V-258012' tag rid: 'SV-258012r926023_rule' tag stig_id: 'RHEL-09-271010' - tag gtitle: 'SRG-OS-000023-GPOS-00006' tag fix_id: 'F-61677r926022_fix' - tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088'] - tag 'documentable' tag cci: ['CCI-000048', 'CCI-001384', 'CCI-001385', 'CCI-001386', 'CCI-001387', 'CCI-001388'] - tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 3'] + tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 3'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('grep ^banner-message-enable /etc/dconf/db/local.d/*') do + its('stdout.strip') { should cmp 'banner-message-enable=true' } + end + end end diff --git a/controls/SV-258013.rb b/controls/SV-258013.rb index ec35bb8..6aef9d0 100644 --- a/controls/SV-258013.rb +++ b/controls/SV-258013.rb @@ -50,4 +50,25 @@ tag 'documentable' tag cci: ['CCI-000048', 'CCI-001384', 'CCI-001385', 'CCI-001386', 'CCI-001387', 'CCI-001388'] tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 3'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + profile = command('grep system-db /etc/dconf/profile/user').stdout.strip.match(/:(\S+)$/)[1] + + describe command("grep ^banner-message-enable /etc/dconf/db/#{profile}.d/*") do + its('stdout.strip') { should match(%r{^/org/gnome/login-screen/banner-message-enable}) } + end + end end diff --git a/controls/SV-258014.rb b/controls/SV-258014.rb index 6e74bab..d6896e0 100644 --- a/controls/SV-258014.rb +++ b/controls/SV-258014.rb @@ -37,4 +37,22 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958'] tag nist: ['CM-6 b', 'IA-3', 'IA-3'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('gsettings get org.gnome.desktop.media-handling automount-open') do + its('stdout.strip') { should cmp 'false' } + end + end end diff --git a/controls/SV-258015.rb b/controls/SV-258015.rb index 5a19ec1..9fb890b 100644 --- a/controls/SV-258015.rb +++ b/controls/SV-258015.rb @@ -44,4 +44,25 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958'] tag nist: ['CM-6 b', 'IA-3', 'IA-3'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + profile = command('grep system-db /etc/dconf/profile/user').stdout.strip.match(/:(\S+)$/)[1] + + describe command("grep ^automount-open /etc/dconf/db/#{profile}.d/locks/*") do + its('stdout.strip') { should match(%r{^/org/gnome/desktop/media-handling/automount-open}) } + end + end end diff --git a/controls/SV-258016.rb b/controls/SV-258016.rb index 36377e3..017c168 100644 --- a/controls/SV-258016.rb +++ b/controls/SV-258016.rb @@ -34,4 +34,22 @@ tag 'documentable' tag cci: ['CCI-001764'] tag nist: ['CM-7 (2)'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('gsettings get org.gnome.desktop.media-handling autorun-never') do + its('stdout.strip') { should cmp 'true' } + end + end end diff --git a/controls/SV-258017.rb b/controls/SV-258017.rb index ee0f7f0..2863cdc 100644 --- a/controls/SV-258017.rb +++ b/controls/SV-258017.rb @@ -44,4 +44,25 @@ tag 'documentable' tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958'] tag nist: ['CM-6 b', 'IA-3', 'IA-3'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + profile = command('grep system-db /etc/dconf/profile/user').stdout.strip.match(/:(\S+)$/)[1] + + describe command("grep ^autorun-never /etc/dconf/db/#{profile}.d/locks/*") do + its('stdout.strip') { should match(%r{^/org/gnome/desktop/media-handling/autorun-never}) } + end + end end diff --git a/controls/SV-258018.rb b/controls/SV-258018.rb index 33293f1..ee1c016 100644 --- a/controls/SV-258018.rb +++ b/controls/SV-258018.rb @@ -1,6 +1,7 @@ control 'SV-258018' do title 'RHEL 9 must not allow unattended or automatic logon via the graphical user interface.' - desc 'Failure to restrict system access to authenticated users negatively impacts operating system security.' + desc 'Failure to restrict system access to authenticated users negatively +impacts operating system security.' desc 'check', 'Verify RHEL 9 does not allow an unattended or automatic logon to the system via a graphical user interface. Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -21,14 +22,36 @@ AutomaticLoginEnable=false' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61759r926039_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000480-GPOS-00229' tag gid: 'V-258018' tag rid: 'SV-258018r926041_rule' tag stig_id: 'RHEL-09-271040' - tag gtitle: 'SRG-OS-000480-GPOS-00229' tag fix_id: 'F-61683r926040_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable inside a container, the containers host manages the containers filesystems') { + !virtualization.system.eql?('docker') + } + + custom_conf = '/etc/gdm/custom.conf' + + if package('gnome-desktop3').installed? + if (f = file(custom_conf)).exist? + describe parse_config_file(custom_conf) do + its('daemon.AutomaticLoginEnable') { cmp false } + end + else + describe f do + it { should exist } + end + end + else + impact 0.0 + describe 'The system does not have GDM installed' do + skip 'The system does not have GDM installed, this requirement is Not Applicable.' + end + end end diff --git a/controls/SV-258019.rb b/controls/SV-258019.rb index 914d1d4..bb7f0f9 100644 --- a/controls/SV-258019.rb +++ b/controls/SV-258019.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must be able to initiate directly a session lock for all connection types using smart card when the smart card is removed.' desc 'A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. -The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. - -' +The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity.' desc 'check', %q(Verify RHEL 9 enables a user's session lock until that user re-establishes access using established identification and authentication procedures with the following command: Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -32,15 +30,43 @@ $ sudo dconf update) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61760r926042_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000028-GPOS-00009' + tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] tag gid: 'V-258019' tag rid: 'SV-258019r926044_rule' tag stig_id: 'RHEL-09-271045' - tag gtitle: 'SRG-OS-000028-GPOS-00009' tag fix_id: 'F-61684r926043_fix' - tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] - tag 'documentable' tag cci: ['CCI-000056', 'CCI-000058'] tag nist: ['AC-11 b', 'AC-11 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if !input('smart_card_enabled') + impact 0.0 + describe "The system is not smartcard enabled thus this control is Not + Applicable" do + skip "The system is not using Smartcards / PIVs to fulfil the MFA + requirement, this control is Not Applicable." + end + elsif !package('gnome-desktop3').installed? + impact 0.0 + describe 'The system does not have GNOME installed' do + skip "The system does not have GNOME installed, this requirement is Not + Applicable." + end + else + + # we're going to do this with grep to avoid doing really complicated tree parsing logic + dconf = command('grep -R removal-action /etc/dconf/db/*').stdout.strip + + describe 'The dconf database' do + it 'should be set to initate a session lock when a smartcard is removed' do + expect(dconf).to match(/removal-action\s*=\s*['"]lock-screen['"]/), 'lock-screen setting not found' + end + end + end end diff --git a/controls/SV-258020.rb b/controls/SV-258020.rb index 8568044..21b4c75 100644 --- a/controls/SV-258020.rb +++ b/controls/SV-258020.rb @@ -44,4 +44,25 @@ tag 'documentable' tag cci: ['CCI-000056', 'CCI-000058'] tag nist: ['AC-11 b', 'AC-11 a'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + profile = command('grep system-db /etc/dconf/profile/user').stdout.strip.match(/:(\S+)$/)[1] + + describe command("grep ^removal-action /etc/dconf/db/#{profile}.d/locks/*") do + its('stdout.strip') { should match(%r{^/org/gnome/settings-daemon/peripherals/smartcard/removal-action}) } + end + end end diff --git a/controls/SV-258021.rb b/controls/SV-258021.rb index d485b70..fcaa8f0 100644 --- a/controls/SV-258021.rb +++ b/controls/SV-258021.rb @@ -1,12 +1,15 @@ control 'SV-258021' do title 'RHEL 9 must enable a user session lock until that user re-establishes access using established identification and authentication procedures for graphical user sessions.' - desc 'A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. + desc 'A session lock is a temporary action taken when a user stops work and +moves away from the immediate physical vicinity of the information system but +does not want to log out because of the temporary nature of the absence. -The session lock is implemented at the point where session activity can be determined. + The session lock is implemented at the point where session activity can be +determined. -Regardless of where the session lock is determined and implemented, once invoked, the session lock must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system. - -' + Regardless of where the session lock is determined and implemented, once +invoked, the session lock must remain in place until the user reauthenticates. +No other activity aside from reauthentication must unlock the system.' desc 'check', %q(Verify RHEL 9 enables a user's session lock until that user re-establishes access using established identification and authentication procedures with the following command: Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -32,15 +35,30 @@ $ sudo dconf update) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61762r926048_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000028-GPOS-00009' + tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] tag gid: 'V-258021' tag rid: 'SV-258021r926050_rule' tag stig_id: 'RHEL-09-271055' - tag gtitle: 'SRG-OS-000028-GPOS-00009' tag fix_id: 'F-61686r926049_fix' - tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] - tag 'documentable' tag cci: ['CCI-000056', 'CCI-000058'] tag nist: ['AC-11 b', 'AC-11 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if package('gnome-desktop3').installed? + describe command('gsettings get org.gnome.desktop.screensaver lock-enabled') do + its('stdout.strip') { should cmp 'true' } + end + else + impact 0.0 + describe 'The system does not have GNOME installed' do + skip "The system does not have GNOME installed, this requirement is Not + Applicable." + end + end end diff --git a/controls/SV-258022.rb b/controls/SV-258022.rb index 36e7f23..bccfd71 100644 --- a/controls/SV-258022.rb +++ b/controls/SV-258022.rb @@ -4,9 +4,7 @@ The session lock is implemented at the point where session activity can be determined and/or controlled. -Implementing session settings will have little value if a user is able to manipulate these settings from the defaults prescribed in the other requirements of this implementation guide. - -" +Implementing session settings will have little value if a user is able to manipulate these settings from the defaults prescribed in the other requirements of this implementation guide." desc 'check', 'Verify RHEL 9 prevents a user from overriding settings for graphical user interfaces. Note: This requirement assumes the use of the RHEL 9 default graphical user interface, Gnome Shell. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -39,15 +37,29 @@ /org/gnome/desktop/screensaver/lock-enabled' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61763r926051_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000028-GPOS-00009' + tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227', 'SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] tag gid: 'V-258022' tag rid: 'SV-258022r926053_rule' tag stig_id: 'RHEL-09-271060' - tag gtitle: 'SRG-OS-000028-GPOS-00009' tag fix_id: 'F-61687r926052_fix' - tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] - tag 'documentable' - tag cci: ['CCI-000056', 'CCI-000058'] - tag nist: ['AC-11 b', 'AC-11 a'] + tag cci: ['CCI-000057', 'CCI-000056', 'CCI-000058'] + tag nist: ['AC-11 a', 'AC-11 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if !package('gnome-desktop3').installed? + impact 0.0 + describe 'The GNOME desktop is not installed, this control is Not Applicable.' do + skip 'The GNOME desktop is not installed, this control is Not Applicable.' + end + else + describe command('grep -i lock-enabled /etc/dconf/db/local.d/locks/*') do + its('stdout.split') { should include '/org/gnome/desktop/screensaver/lock-enabled' } + end + end end diff --git a/controls/SV-258023.rb b/controls/SV-258023.rb index 0167eea..0627d53 100644 --- a/controls/SV-258023.rb +++ b/controls/SV-258023.rb @@ -1,8 +1,6 @@ control 'SV-258023' do title 'RHEL 9 must automatically lock graphical user sessions after 15 minutes of inactivity.' - desc "A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, the GNOME desktop can be configured to identify when a user's session has idled and take action to initiate a session lock. - -" + desc "A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, the GNOME desktop can be configured to identify when a user's session has idled and take action to initiate a session lock." desc 'check', 'Verify RHEL 9 initiates a session lock after a 15-minute period of inactivity for graphical user interfaces with the following command: Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -29,15 +27,30 @@ $ sudo dconf update' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61764r926054_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000029-GPOS-00010' + tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012'] tag gid: 'V-258023' tag rid: 'SV-258023r926056_rule' tag stig_id: 'RHEL-09-271065' - tag gtitle: 'SRG-OS-000029-GPOS-00010' tag fix_id: 'F-61688r926055_fix' - tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012'] - tag 'documentable' tag cci: ['CCI-000057', 'CCI-000060'] tag nist: ['AC-11 a', 'AC-11 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if package('gnome-desktop3').installed? + describe command("gsettings get org.gnome.desktop.session idle-delay | cut -d ' ' -f2") do + its('stdout.strip') { should cmp <= input('system_inactivity_timeout') } + end + else + impact 0.0 + describe 'The system does not have GNOME installed' do + skip "The system does not have GNOME installed, this requirement is Not + Applicable." + end + end end diff --git a/controls/SV-258024.rb b/controls/SV-258024.rb index 0d995ce..27b40b1 100644 --- a/controls/SV-258024.rb +++ b/controls/SV-258024.rb @@ -1,8 +1,6 @@ control 'SV-258024' do title 'RHEL 9 must prevent a user from overriding the session idle-delay setting for the graphical user interface.' - desc "A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, the GNOME desktop can be configured to identify when a user's session has idled and take action to initiate the session lock. As such, users should not be allowed to change session settings. - -" + desc "A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, the GNOME desktop can be configured to identify when a user's session has idled and take action to initiate the session lock. As such, users should not be allowed to change session settings." desc 'check', 'Verify RHEL 9 prevents a user from overriding settings for graphical user interfaces. Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -35,15 +33,33 @@ /org/gnome/desktop/session/idle-delay' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61765r926057_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000029-GPOS-00010' + tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227'] tag gid: 'V-258024' tag rid: 'SV-258024r926059_rule' tag stig_id: 'RHEL-09-271070' - tag gtitle: 'SRG-OS-000029-GPOS-00010' tag fix_id: 'F-61689r926058_fix' - tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012'] - tag 'documentable' tag cci: ['CCI-000057', 'CCI-000060'] tag nist: ['AC-11 a', 'AC-11 (1)'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('grep -i idle /etc/dconf/db/local.d/locks/*') do + it 'checks if idle delay is set' do + expect(subject.stdout.split).to include('/org/gnome/desktop/session/idle-delay'), 'The idle delay is not set. Please ensure it is set.' + end + end + end end diff --git a/controls/SV-258025.rb b/controls/SV-258025.rb index ef0c829..16cf2a7 100644 --- a/controls/SV-258025.rb +++ b/controls/SV-258025.rb @@ -28,14 +28,31 @@ $ sudo dconf update' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61766r926060_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000029-GPOS-00010' + tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227'] tag gid: 'V-258025' tag rid: 'SV-258025r926062_rule' tag stig_id: 'RHEL-09-271075' - tag gtitle: 'SRG-OS-000029-GPOS-00010' tag fix_id: 'F-61690r926061_fix' - tag 'documentable' tag cci: ['CCI-000057'] tag nist: ['AC-11 a'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('gsettings get org.gnome.desktop.screensaver lock-delay') do + its('stdout.strip') { should match(/uint32\s[0-5]/) } + end + end end diff --git a/controls/SV-258026.rb b/controls/SV-258026.rb index 21a9fea..5b5e13f 100644 --- a/controls/SV-258026.rb +++ b/controls/SV-258026.rb @@ -33,14 +33,29 @@ /org/gnome/desktop/screensaver/lock-delay' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61767r926063_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000029-GPOS-00010' + tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227'] tag gid: 'V-258026' tag rid: 'SV-258026r926065_rule' tag stig_id: 'RHEL-09-271080' - tag gtitle: 'SRG-OS-000029-GPOS-00010' tag fix_id: 'F-61691r926064_fix' - tag 'documentable' tag cci: ['CCI-000057'] tag nist: ['AC-11 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if package('gnome-desktop3').installed? + describe command('grep -i lock-delay /etc/dconf/db/local.d/locks/*') do + its('stdout.split') { should include '/org/gnome/desktop/screensaver/lock-delay' } + end + else + impact 0.0 + describe 'The GNOME desktop is not installed' do + skip 'The GNOME desktop is not installed, this control is Not Applicable.' + end + end end diff --git a/controls/SV-258027.rb b/controls/SV-258027.rb index de61914..0555ca9 100644 --- a/controls/SV-258027.rb +++ b/controls/SV-258027.rb @@ -42,4 +42,25 @@ tag 'documentable' tag cci: ['CCI-000060'] tag nist: ['AC-11 (1)'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + profile = command('grep system-db /etc/dconf/profile/user').stdout.strip.match(/:(\S+)$/)[1] + + describe command("grep ^picture-uri /etc/dconf/db/#{profile}.d/locks/*") do + its('stdout.strip') { should match(%r{^/org/gnome/desktop/screensaver/picture-uri}) } + end + end end diff --git a/controls/SV-258028.rb b/controls/SV-258028.rb index 3d97f45..ceb8f8a 100644 --- a/controls/SV-258028.rb +++ b/controls/SV-258028.rb @@ -23,4 +23,29 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + db_list = command('find /etc/dconf/db -maxdepth 1 -type f').stdout.strip.split("\n") + + failing_dbs = db_list.select { |db| file(db).mtime < file("#{db}.d").mtime } + + describe 'dconf databases' do + it 'should have been updated after the last corresponding keyfile edit' do + expect(failing_dbs).to be_empty, "Failing databases:\n\t- #{failing_dbs.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-258029.rb b/controls/SV-258029.rb index e40027a..c3939d3 100644 --- a/controls/SV-258029.rb +++ b/controls/SV-258029.rb @@ -14,7 +14,7 @@ Add or update the [org/gnome/settings-daemon/] section of the /etc/dconf/db/local.d/00-security-settings" database file and add or update the following lines: -[org/gnome/settings-daemon/peripherals/smartcard] +[org/gnome/login-screen] disable-restart-buttons='true' Then update the dconf system databases: @@ -25,11 +25,33 @@ tag check_id: 'C-61770r926072_chk' tag severity: 'medium' tag gid: 'V-258029' - tag rid: 'SV-258029r926074_rule' + tag rid: 'SV-258029r943059_rule' tag stig_id: 'RHEL-09-271095' tag gtitle: 'SRG-OS-000480-GPOS-00227' - tag fix_id: 'F-61694r926073_fix' + tag fix_id: 'F-61694r943058_fix' tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + restart_button_setting = command('grep ^disable-restart-buttons /etc/dconf/db/*').stdout.strip.match(/:disable-restart-buttons=(\S+)/)[1] + + describe 'GUI settings should disable the restart button' do + subject { restart_button_setting } + it { should cmp 'true' } + end + end end diff --git a/controls/SV-258030.rb b/controls/SV-258030.rb index c8130e8..77cb5ca 100644 --- a/controls/SV-258030.rb +++ b/controls/SV-258030.rb @@ -45,4 +45,25 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + + profile = command('grep system-db /etc/dconf/profile/user').stdout.strip.match(/:(\S+)$/)[1] + + describe command("grep ^disable-restart-buttons /etc/dconf/db/#{profile}.d/locks/*") do + its('stdout.strip') { should match(%r{^/org/gnome/login-screen/disable-restart-buttons}) } + end + end end diff --git a/controls/SV-258031.rb b/controls/SV-258031.rb index 762c553..6f178bc 100644 --- a/controls/SV-258031.rb +++ b/controls/SV-258031.rb @@ -32,4 +32,22 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('gsettings get org.gnome.settings-daemon.plugins.media-keys logout') do + its('stdout.strip') { should cmp "['']" } + end + end end diff --git a/controls/SV-258032.rb b/controls/SV-258032.rb index ebf59a6..c6b1b8b 100644 --- a/controls/SV-258032.rb +++ b/controls/SV-258032.rb @@ -35,4 +35,22 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('grep logout /etc/dconf/db/local.d/locks/*') do + its('stdout.strip') { should cmp match(%r{^/org/gnome/settings-daemon/plugins/media-keys/logout}) } + end + end end diff --git a/controls/SV-258033.rb b/controls/SV-258033.rb index 34fb40d..bb88a2f 100644 --- a/controls/SV-258033.rb +++ b/controls/SV-258033.rb @@ -1,6 +1,8 @@ control 'SV-258033' do title 'RHEL 9 must disable the user list at logon for graphical user interfaces.' - desc 'Leaving the user list enabled is a security risk since it allows anyone with physical access to the system to enumerate known user accounts without authenticated access to the system.' + desc 'Leaving the user list enabled is a security risk since it allows +anyone with physical access to the system to enumerate known user accounts +without authenticated access to the system.' desc 'check', 'Verify that RHEL 9 disables the user logon list for graphical user interfaces with the following command: Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. @@ -24,14 +26,30 @@ $ sudo dconf update' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61774r926084_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258033' tag rid: 'SV-258033r926086_rule' tag stig_id: 'RHEL-09-271115' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61698r926085_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/) + + if no_gui + impact 0.0 + describe 'The system does not have a GUI installed, this requirement is Not Applicable.' do + skip 'A GUI desktop is not installed, this control is Not Applicable.' + end + else + describe command('gsettings get org.gnome.login-screen disable-user-list') do + its('stdout.strip') { should cmp 'true' } + end + end end diff --git a/controls/SV-258034.rb b/controls/SV-258034.rb index 222c43d..cece569 100644 --- a/controls/SV-258034.rb +++ b/controls/SV-258034.rb @@ -1,8 +1,7 @@ control 'SV-258034' do title 'RHEL 9 must be configured to disable USB mass storage.' - desc 'USB mass storage permits easy introduction of unknown devices, thereby facilitating malicious activity. - -' + desc 'USB mass storage permits easy introduction of unknown devices, thereby +facilitating malicious activity.' desc 'check', 'Verify that RHEL 9 disables the ability to load the USB Storage kernel module with the following command: $ sudo grep -r usb-storage /etc/modprobe.conf /etc/modprobe.d/* @@ -16,15 +15,29 @@ blacklist usb-storage' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61775r926087_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000114-GPOS-00059' + tag satisfies: ['SRG-OS-000114-GPOS-00059', 'SRG-OS-000378-GPOS-00163', 'SRG-OS-000480-GPOS-00227'] tag gid: 'V-258034' tag rid: 'SV-258034r926089_rule' tag stig_id: 'RHEL-09-291010' - tag gtitle: 'SRG-OS-000114-GPOS-00059' tag fix_id: 'F-61699r926088_fix' - tag satisfies: ['SRG-OS-000114-GPOS-00059', 'SRG-OS-000378-GPOS-00163', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958'] - tag nist: ['CM-6 b', 'IA-3', 'IA-3'] + tag cci: ['CCI-000778', 'CCI-000366', 'CCI-001958'] + tag nist: ['IA-3', 'CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + if input('usb_storage_required') == true + describe kernel_module('usb_storage') do + it { should_not be_disabled } + it { should_not be_blacklisted } + end + else + describe kernel_module('usb_storage') do + it { should be_disabled } + it { should be_blacklisted } + end + end end diff --git a/controls/SV-258035.rb b/controls/SV-258035.rb index 363cc1f..375b176 100644 --- a/controls/SV-258035.rb +++ b/controls/SV-258035.rb @@ -20,14 +20,25 @@ $ sudo dnf install usbguard' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61776r926090_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000378-GPOS-00163' tag gid: 'V-258035' tag rid: 'SV-258035r926092_rule' tag stig_id: 'RHEL-09-291015' - tag gtitle: 'SRG-OS-000378-GPOS-00163' tag fix_id: 'F-61700r926091_fix' - tag 'documentable' tag cci: ['CCI-001958'] tag nist: ['IA-3'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + peripherals_package = input('peripherals_package') + + describe package(peripherals_package) do + it "is expected to be installed. \n\tPlease ensure to configure the service to ensure your devices function as expected." do + expect(subject.installed?).to be(true), "The #{peripherals_package} package is not installed" + end + end end diff --git a/controls/SV-258036.rb b/controls/SV-258036.rb index d13e968..3edcc1b 100644 --- a/controls/SV-258036.rb +++ b/controls/SV-258036.rb @@ -17,14 +17,28 @@ $ sudo systemctl enable --now usbguard' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61777r926093_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000378-GPOS-00163' tag gid: 'V-258036' tag rid: 'SV-258036r926095_rule' tag stig_id: 'RHEL-09-291020' - tag gtitle: 'SRG-OS-000378-GPOS-00163' tag fix_id: 'F-61701r926094_fix' - tag 'documentable' tag cci: ['CCI-001958'] tag nist: ['IA-3'] + tag 'host' + + only_if('This requirement does not apply to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + peripherals_service = input('peripherals_service') + + describe service(peripherals_service) do + it "is expected to be running. \n\tPlease ensure to configure the service to ensure your devices function as expected." do + expect(subject.running?).to be(true), "The #{peripherals_service} service is not running" + end + it "is expected to be enabled. \n\tPlease ensure to configure the service to ensure your devices function as expected." do + expect(subject.enabled?).to be(true), "The #{peripherals_service} service is not enabled" + end + end end diff --git a/controls/SV-258037.rb b/controls/SV-258037.rb index bd7213e..7ab8172 100644 --- a/controls/SV-258037.rb +++ b/controls/SV-258037.rb @@ -31,14 +31,22 @@ AuditBackend=LinuxAudit' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61778r926096_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000062-GPOS-00031' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258037' tag rid: 'SV-258037r926098_rule' tag stig_id: 'RHEL-09-291025' - tag gtitle: 'SRG-OS-000062-GPOS-00031' tag fix_id: 'F-61702r926097_fix' - tag 'documentable' tag cci: ['CCI-000169'] tag nist: ['AU-12 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe parse_config_file('/etc/usbguard/usbguard-daemon.conf') do + its('AuditBackend') { should cmp 'LinuxAudit' } + end end diff --git a/controls/SV-258038.rb b/controls/SV-258038.rb index 425814f..4bc79a5 100644 --- a/controls/SV-258038.rb +++ b/controls/SV-258038.rb @@ -11,7 +11,9 @@ If the command does not return results or an error is returned, ask the SA to indicate how unauthorized peripherals are being blocked. -If there is no evidence that unauthorized peripherals are being blocked before establishing a connection, this is a finding.' +If there is no evidence that unauthorized peripherals are being blocked before establishing a connection, this is a finding. + +If the system is virtual machine with no virtual or physical USB peripherals attached, this is not a finding.' desc 'fix', 'Configure the operating system to enable the blocking of unauthorized peripherals with the following command: Note: This command must be run from a root shell and will create an allow list for any usb devices currently connect to the system. @@ -21,14 +23,32 @@ Note: Enabling and starting usbguard without properly configuring it for an individual system will immediately prevent any access over a usb device such as a keyboard or mouse.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61779r926099_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000378-GPOS-00163' tag gid: 'V-258038' - tag rid: 'SV-258038r926101_rule' + tag rid: 'SV-258038r943052_rule' tag stig_id: 'RHEL-09-291030' - tag gtitle: 'SRG-OS-000378-GPOS-00163' tag fix_id: 'F-61703r926100_fix' - tag 'documentable' tag cci: ['CCI-001958'] tag nist: ['IA-3'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + peripherals_package = input('peripherals_package') + + if peripherals_package != 'usbguard' + describe 'Non-standard package' do + it 'is handling peripherals' do + expect(peripherals_package).to exist + end + end + else + describe command('usbguard list-rules') do + its('stdout') { should_not be_empty } + its('exit_status') { should eq 0 } + end + end end diff --git a/controls/SV-258039.rb b/controls/SV-258039.rb index be91730..7ea95b2 100644 --- a/controls/SV-258039.rb +++ b/controls/SV-258039.rb @@ -1,8 +1,6 @@ control 'SV-258039' do title 'RHEL 9 Bluetooth must be disabled.' - desc 'This requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with RHEL 9 systems. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR keyboards, mice and pointing devices, and near field communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the Authorizing Official (AO). Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the RHEL 9 operating system. - -' + desc 'This requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with RHEL 9 systems. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR keyboards, mice and pointing devices, and near field communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the Authorizing Official (AO). Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the RHEL 9 operating system.' desc 'check', 'Verify that RHEL 9 disables the ability to load the Bluetooth kernel module with the following command: $ sudo grep -r bluetooth /etc/modprobe.conf /etc/modprobe.d/* @@ -20,15 +18,29 @@ Reboot the system for the settings to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61780r926102_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000095-GPOS-00049' tag gid: 'V-258039' tag rid: 'SV-258039r926104_rule' tag stig_id: 'RHEL-09-291035' - tag gtitle: 'SRG-OS-000095-GPOS-00049' tag fix_id: 'F-61704r926103_fix' - tag satisfies: ['SRG-OS-000095-GPOS-00049', 'SRG-OS-000300-GPOS-00118'] - tag 'documentable' - tag cci: ['CCI-000381', 'CCI-001443'] - tag nist: ['CM-7 a', 'AC-18 (1)'] + tag cci: ['CCI-001443', 'CCI-000381'] + tag nist: ['AC-18 (1)', 'CM-7 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('bluetooth_installed') + describe kernel_module('bluetooth') do + it { should be_disabled } + it { should be_blacklisted } + end + else + impact 0.0 + describe 'Device or operating system does not have a Bluetooth adapter installed' do + skip 'If the device or operating system does not have a Bluetooth adapter installed, this requirement is not applicable.' + end + end end diff --git a/controls/SV-258040.rb b/controls/SV-258040.rb index a62aac2..3424752 100644 --- a/controls/SV-258040.rb +++ b/controls/SV-258040.rb @@ -1,8 +1,6 @@ control 'SV-258040' do title 'RHEL 9 wireless network adapters must be disabled.' - desc 'This requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with RHEL 9 systems. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR keyboards, mice and pointing devices, and near field communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the Authorizing Official (AO). Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the RHEL 9 operating system. - -' + desc 'This requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with RHEL 9 systems. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR keyboards, mice and pointing devices, and near field communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the Authorizing Official (AO). Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the RHEL 9 operating system.' desc 'check', 'Verify there are no wireless interfaces configured on the system with the following command: Note: This requirement is Not Applicable for systems that do not have physical wireless network radios. @@ -23,15 +21,26 @@ $ nmcli radio all off' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61781r926105_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000299-GPOS-00117' + tag satisfies: ['SRG-OS-000299-GPOS-00117', 'SRG-OS-000300-GPOS-00118', 'SRG-OS-000481-GPOS-000481', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000481-GPOS-00481'] tag gid: 'V-258040' tag rid: 'SV-258040r926107_rule' tag stig_id: 'RHEL-09-291040' - tag gtitle: 'SRG-OS-000299-GPOS-00117' tag fix_id: 'F-61705r926106_fix' - tag satisfies: ['SRG-OS-000299-GPOS-00117', 'SRG-OS-000300-GPOS-00118', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000481-GPOS-00481'] - tag 'documentable' - tag cci: ['CCI-001443', 'CCI-001444', 'CCI-002418', 'CCI-002421'] - tag nist: ['AC-18 (1)', 'AC-18 (1)', 'SC-8', 'SC-8 (1)'] + tag cci: ['CCI-001444', 'CCI-001443', 'CCI-002418', 'CCI-002421'] + tag nist: ['AC-18 (1)', 'SC-8', 'SC-8 (1)'] + tag 'host' + tag 'container' + + if input('wifi_hardware') + describe command('nmcli device') do + its('stdout.strip') { should_not match(/wifi\s*connected/) } + end + else + impact 0.0 + describe 'Skip' do + skip 'The system does not have a wireless network adapter, this control is Not Applicable.' + end + end end diff --git a/controls/SV-258041.rb b/controls/SV-258041.rb index 70a1af3..3c8ff2a 100644 --- a/controls/SV-258041.rb +++ b/controls/SV-258041.rb @@ -17,14 +17,24 @@ PASS_MAX_DAYS 60' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61782r926108_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000076-GPOS-00044' tag gid: 'V-258041' tag rid: 'SV-258041r926110_rule' tag stig_id: 'RHEL-09-411010' - tag gtitle: 'SRG-OS-000076-GPOS-00044' tag fix_id: 'F-61706r926109_fix' - tag 'documentable' tag cci: ['CCI-000199'] tag nist: ['IA-5 (1) (d)'] + tag 'host' + tag 'container' + + value = input('pass_max_days') + setting = input_object('pass_max_days').name.upcase + + describe "/etc/login.defs does not have `#{setting}` configured" do + let(:config) { login_defs.read_params[setting] } + it "greater than #{value} day" do + expect(config).to cmp <= value + end + end end diff --git a/controls/SV-258042.rb b/controls/SV-258042.rb index d5d2282..97e5f3a 100644 --- a/controls/SV-258042.rb +++ b/controls/SV-258042.rb @@ -13,14 +13,26 @@ passwd -x 60 [user]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61783r926111_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000076-GPOS-00044' tag gid: 'V-258042' tag rid: 'SV-258042r926113_rule' tag stig_id: 'RHEL-09-411015' - tag gtitle: 'SRG-OS-000076-GPOS-00044' tag fix_id: 'F-61707r926112_fix' - tag 'documentable' tag cci: ['CCI-000199'] tag nist: ['IA-5 (1) (d)'] + tag 'host' + tag 'container' + + value = input('pass_max_days') + + bad_users = users.where { uid >= 1000 }.where { value > 60 or maxdays.negative? }.usernames + in_scope_users = bad_users - input('exempt_home_users') + + describe 'Users are not be able' do + it "to retain passwords for more then #{value} day(s)" do + failure_message = "The following users can update their password more then every #{value} day(s): #{in_scope_users.join(', ')}" + expect(in_scope_users).to be_empty, failure_message + end + end end diff --git a/controls/SV-258043.rb b/controls/SV-258043.rb index d549d24..5014a9a 100644 --- a/controls/SV-258043.rb +++ b/controls/SV-258043.rb @@ -1,6 +1,7 @@ control 'SV-258043' do title 'All RHEL 9 local interactive user accounts must be assigned a home directory upon creation.' - desc 'If local interactive users are not assigned a valid home directory, there is no place for the storage and control of files they should own.' + desc 'If local interactive users are not assigned a valid home directory, +there is no place for the storage and control of files they should own.' desc 'check', 'Verify all local interactive users on RHEL 9 are assigned a home directory upon creation with the following command: $ grep -i create_home /etc/login.defs @@ -13,14 +14,18 @@ CREATE_HOME yes' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61784r926114_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258043' tag rid: 'SV-258043r926116_rule' tag stig_id: 'RHEL-09-411020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61708r926115_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + describe login_defs do + its('CREATE_HOME') { should eq 'yes' } + end end diff --git a/controls/SV-258044.rb b/controls/SV-258044.rb index 7dc9f77..5c434b7 100644 --- a/controls/SV-258044.rb +++ b/controls/SV-258044.rb @@ -1,6 +1,11 @@ control 'SV-258044' do title 'RHEL 9 must set the umask value to 077 for all local interactive user accounts.' - desc 'The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.' + desc 'The umask controls the default access mode assigned to newly created +files. A umask of 077 limits new files to mode 600 or less permissive. Although +umask can be represented as a four-digit number, the first digit representing +special access modes is typically ignored or required to be "0". This +requirement applies to the globally configured system defaults and the local +interactive user defaults for each account on the system.' desc 'check', 'Verify that the default umask for all local interactive users is "077". Identify the locations of all local interactive user home directories by looking at the "/etc/passwd" file. @@ -20,14 +25,45 @@ If the account is for an application, the requirement for a umask less restrictive than "077" can be documented with the information system security officer, but the user agreement for access to the account must specify that the local interactive user must log on to their account first and then switch the user to the application account with the correct option to gain the account's environment variables.) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61785r926117_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258044' tag rid: 'SV-258044r926119_rule' tag stig_id: 'RHEL-09-411025' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61709r926118_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + exempt_home_users = input('exempt_home_users') + expected_mode = input('permissions_for_shells')['default_umask'] + uid_min = login_defs.read_params['UID_MIN'].to_i + uid_min = 1000 if uid_min.nil? + + iusers = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) } + + if !iusers.users.nil? && !iusers.users.empty? + + # run the check text's grep against all interactive users, compare any hits to the expected mode + failing_users = iusers.entries.select { |u| + umask_set = command("grep -ir ^umask #{u.home} | grep -v '.bash_history'").stdout.strip + umask_set.nil? && umask_set.match(/(?\d{3,4})/)['umask'].to_i > expected_mode.to_i + }.map(&:user) + + describe 'All non-exempt interactive users on the system' do + it "should not set the UMASK more permissive than '#{expected_mode}' in any init files" do + expect(failing_users).to be_empty, "Failing users:\n\t- #{failing_users.join("\n\t- ")}" + end + end + else + describe 'No non-exempt interactive user accounts' do + it 'were detected on the system' do + expect(true).to eq(true) + end + end + end end diff --git a/controls/SV-258045.rb b/controls/SV-258045.rb index f40be74..7cd3f21 100644 --- a/controls/SV-258045.rb +++ b/controls/SV-258045.rb @@ -1,8 +1,6 @@ control 'SV-258045' do title 'RHEL 9 duplicate User IDs (UIDs) must not exist for interactive users.' - desc 'To ensure accountability and prevent unauthenticated access, interactive users must be identified and authenticated to prevent potential misuse and compromise of the system. - -' + desc 'To ensure accountability and prevent unauthenticated access, interactive users must be identified and authenticated to prevent potential misuse and compromise of the system.' desc 'check', %q(Verify that RHEL 9 contains no duplicate UIDs for interactive users with the following command: $ sudo awk -F ":" 'list[$3]++{print $1, $3}' /etc/passwd @@ -11,15 +9,22 @@ desc 'fix', 'Edit the file "/etc/passwd" and provide each interactive user account that has a duplicate UID with a unique UID.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61786r926120_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000104-GPOS-00051' + tag satisfies: ['SRG-OS-000104-GPOS-00051', 'SRG-OS-000121-GPOS-00062', 'SRG-OS-000042-GPOS-00020'] tag gid: 'V-258045' tag rid: 'SV-258045r926122_rule' tag stig_id: 'RHEL-09-411030' - tag gtitle: 'SRG-OS-000104-GPOS-00051' tag fix_id: 'F-61710r926121_fix' - tag satisfies: ['SRG-OS-000104-GPOS-00051', 'SRG-OS-000121-GPOS-00062', 'SRG-OS-000042-GPOS-00020'] - tag 'documentable' - tag cci: ['CCI-000135', 'CCI-000764', 'CCI-000804'] - tag nist: ['AU-3 (1)', 'IA-2', 'IA-8'] + tag cci: ['CCI-000764', 'CCI-000135', 'CCI-000804'] + tag nist: ['IA-2', 'AU-3 (1)', 'IA-8'] + tag 'host' + tag 'container' + + user_count = passwd.where { uid.to_i >= 1000 }.entries.length + + describe "Count of interactive unique user IDs should match interactive user count (#{user_count}): UID count" do + subject { passwd.where { uid.to_i >= 1000 }.uids.uniq.length } + it { should eq user_count } + end end diff --git a/controls/SV-258046.rb b/controls/SV-258046.rb index 20f2803..f603f2f 100644 --- a/controls/SV-258046.rb +++ b/controls/SV-258046.rb @@ -37,4 +37,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + ignore_shells = input('non_interactive_shells').join('|') + non_interactive_shells = passwd.where { uid.to_i < 1000 && !shell.match(ignore_shells) }.users - input('interactive_system_account_exemptions') + + describe 'Non-interactive system accounts' do + it 'should have non-interactive shells' do + expect(non_interactive_shells).to be_empty, "Non-interactive system accounts with interactive shells:\n\t- #{non_interactive_shells.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258047.rb b/controls/SV-258047.rb index 2124003..e6fccca 100644 --- a/controls/SV-258047.rb +++ b/controls/SV-258047.rb @@ -1,35 +1,83 @@ control 'SV-258047' do title 'RHEL 9 must automatically expire temporary accounts within 72 hours.' - desc 'Temporary accounts are privileged or nonprivileged accounts that are established during pressing circumstances, such as new software or hardware configuration or an incident response, where the need for prompt account activation requires bypassing normal account authorization procedures. If any inactive temporary accounts are left enabled on the system and are not either manually removed or automatically expired within 72 hours, the security posture of the system will be degraded and exposed to exploitation by unauthorized users or insider threat actors. + desc 'Temporary accounts are privileged or nonprivileged accounts that are + established during pressing circumstances, such as new software or hardware + configuration or an incident response, where the need for prompt account + activation requires bypassing normal account authorization procedures. -Temporary accounts are different from emergency accounts. Emergency accounts, also known as "last resort" or "break glass" accounts, are local logon accounts enabled on the system for emergency use by authorized system administrators to manage a system when standard logon methods are failing or not available. Emergency accounts are not subject to manual removal or scheduled expiration requirements. + If any inactive temporary accounts are left enabled on the system and are + not either manually removed or automatically expired within 72 hours, the + security posture of the system will be degraded and exposed to exploitation + by unauthorized users or insider threat actors. -The automatic expiration of temporary accounts may be extended as needed by the circumstances but it must not be extended indefinitely. A documented permanent account should be established for privileged users who need long-term maintenance accounts. + Temporary accounts are different from emergency accounts. Emergency accounts, + also known as "last resort" or "break glass" accounts, are local logon accounts + enabled on the system for emergency use by authorized system administrators + to manage a system when standard logon methods are failing or not available. -' - desc 'check', 'Verify temporary accounts have been provisioned with an expiration date of 72 hours. + Emergency accounts are not subject to manual removal or scheduled expiration + requirements. -For every existing temporary account, run the following command to obtain its account expiration information: + The automatic expiration of temporary accounts may be extended as needed by + the circumstances but it must not be extended indefinitely. A documented + permanent account should be established for privileged users who need long-term + maintenance accounts.' + desc 'check', 'Verify temporary accounts have been provisioned with an + expiration date of 72 hours. -$ sudo chage -l | grep -i "account expires" + For every existing temporary account, run the following command to obtain its + account expiration information: -Verify each of these accounts has an expiration date set within 72 hours. + $ sudo chage -l | grep -i "account expires" -If any temporary accounts have no expiration date set or do not expire within 72 hours, this is a finding.' - desc 'fix', 'Configure the operating system to expire temporary accounts after 72 hours with the following command: + Verify each of these accounts has an expiration date set within 72 hours. -$ sudo chage -E $(date -d +3days +%Y-%m-%d) ' + If any temporary accounts have no expiration date set or do not expire within + 72 hours, this is a finding.' + desc 'fix', 'Configure the operating system to expire temporary accounts after + 72 hours with the following command: + + $ sudo chage -E $(date -d +3days +%Y-%m-%d) ' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61788r926126_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000123-GPOS-00064' tag gid: 'V-258047' tag rid: 'SV-258047r926128_rule' tag stig_id: 'RHEL-09-411040' - tag gtitle: 'SRG-OS-000123-GPOS-00064' tag fix_id: 'F-61712r926127_fix' - tag satisfies: ['SRG-OS-000123-GPOS-00064', 'SRG-OS-000002-GPOS-00002'] - tag 'documentable' - tag cci: ['CCI-000016', 'CCI-001682'] - tag nist: ['AC-2 (2)', 'AC-2 (2)'] + tag cci: ['CCI-001682', 'CCI-000016'] + tag nist: ['AC-2 (2)'] + tag 'host' + tag 'container' + + tmp_users = input('temporary_accounts') + + # NOTE: that 230331 is extremely similar to this req, to the point where this input seems + # appropriate to use for both of them + tmp_max_days = input('temporary_account_max_days') + + if tmp_users.empty? + describe 'Temporary accounts' do + subject { tmp_users } + it { should be_empty } + end + else + # user has to specify what the tmp accounts are, so we will print a different pass message + # if none of those tmp accounts even exist on the system for clarity + tmp_users_existing = tmp_users.select { |u| user(u).exists? } + failing_users = tmp_users_existing.select { |u| user(u).warndays > tmp_max_days } + + describe 'Temporary accounts' do + if tmp_users_existing.nil? + it "should have expiration times less than or equal to '#{tmp_max_days}' days" do + expect(failing_users).to be_empty, "Failing users:\n\t- #{failing_users.join("\n\t- ")}" + end + else + it "(input as '#{tmp_users.join("', '")}') were not found on this system" do + expect(tmp_users_existing).to be_empty + end + end + end + end end diff --git a/controls/SV-258048.rb b/controls/SV-258048.rb index 61ac40b..41c9863 100644 --- a/controls/SV-258048.rb +++ b/controls/SV-258048.rb @@ -23,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-000764'] tag nist: ['IA-2'] + tag 'host', 'container' + + ignore_shells = input('non_interactive_shells').join('|') + interactive_users = passwd.where { uid.to_i >= 1000 && !shell.match(ignore_shells) }.users + interactive_users_without_group = interactive_users.reject { |u| group(user(u).group).exists? } + + describe 'Interactive users' do + it 'should have a valid primary group' do + expect(interactive_users_without_group).to be_empty, "Interactive users without a valid primary group:\n\t- #{interactive_users_without_group.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258049.rb b/controls/SV-258049.rb index 1244f8a..5ddc497 100644 --- a/controls/SV-258049.rb +++ b/controls/SV-258049.rb @@ -23,14 +23,42 @@ The recommendation is 35 days, but a lower value is acceptable.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61790r926132_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000118-GPOS-00060' tag gid: 'V-258049' tag rid: 'SV-258049r926134_rule' tag stig_id: 'RHEL-09-411050' - tag gtitle: 'SRG-OS-000118-GPOS-00060' tag fix_id: 'F-61714r926133_fix' - tag 'documentable' tag cci: ['CCI-000795'] tag nist: ['IA-4 e'] + tag 'host' + tag 'container' + + days_of_inactivity = input('days_of_inactivity') + + describe 'Useradd configuration' do + useradd_config = parse_config_file('/etc/default/useradd') + + context 'when INACTIVE is set' do + it 'should exist' do + expect(useradd_config.params).to include('INACTIVE') + end + + it 'should not be nil' do + expect(useradd_config.params['INACTIVE']).not_to be_nil + end + + it 'should have INACTIVE greater than or equal to 0' do + expect(useradd_config.params['INACTIVE'].to_i).to be >= 0 + end + + it 'should have INACTIVE less than or equal to days_of_inactivity' do + expect(useradd_config.params['INACTIVE'].to_i).to be <= days_of_inactivity + end + + it 'should not have INACTIVE equal to -1' do + expect(useradd_config.params['INACTIVE']).not_to eq '-1' + end + end + end end diff --git a/controls/SV-258050.rb b/controls/SV-258050.rb index f66c0d3..a2ca164 100644 --- a/controls/SV-258050.rb +++ b/controls/SV-258050.rb @@ -10,19 +10,73 @@ /home/[localinteractiveuser]/.bash_profile:PATH=$PATH:$HOME/.local/bin:$HOME/bin If any local interactive user initialization files have executable search path statements that include directories outside of their home directory and is not documented with the ISSO as an operational requirement, this is a finding.' - desc 'fix', 'Edit the local interactive user initialization files to change any PATH variable statements that reference directories other than their home directory. + desc 'fix', 'Edit the local interactive user initialization files to change any PATH +variable statements that reference directories other than their home directory. -If a local interactive user requires path variables to reference a directory owned by the application, it must be documented with the ISSO.' + If a local interactive user requires path variables to reference a +directory owned by the application, it must be documented with the ISSO.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61791r926135_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258050' tag rid: 'SV-258050r926137_rule' tag stig_id: 'RHEL-09-411055' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61715r926136_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + ignore_shells = input('non_interactive_shells').join('|') + + findings = {} + users.where { !shell.match(ignore_shells) && (uid >= 1000 || uid.zero?) }.entries.each do |user_info| + next if input('exempt_home_users').include?(user_info.username.to_s) + + grep_results = command("grep -i path= --exclude=\".bash_history\" #{user_info.home}/.*").stdout.split("\n") + grep_results.each do |result| + result.slice! 'PATH=' + # Case when last value in exec search path is : + result += ' ' if result[-1] == ':' + result.slice! '$PATH:' + result.gsub! '="', '=' # account for cases where path is set to equal a quote-wrapped statement + result.gsub! '$HOME', user_info.home.to_s + result.gsub! '~', user_info.home.to_s + result.gsub! ':$PATH', '' # remove $PATH if it shows up at the end of line + line_arr = result.split(':') + line_arr.delete_at(0) + line_arr.each do |line| + line = line.strip + + # Don't run test on line that exports PATH and is not commented out + next unless !line.start_with?('export') && !line.start_with?('#') + + # Case when :: found in exec search path or : found at beginning + if line.strip.empty? + curr_work_dir = command('pwd').stdout.delete("\n") + line = curr_work_dir if curr_work_dir.start_with?(user_info.home.to_s) || curr_work_dir[] + end + + # catch a leading '"' + line = line[1..line.length] if line.start_with?('"') + + # This will fail if non-home directory found in path + next if line.start_with?(user_info.home) + + # we want a hash of usernames as the keys and arrays of failing lines as values + findings[user_info.username] = if findings[user_info.username] + findings[user_info.username] << line + else + [line] + end + end + end + end + + describe 'Initialization files' do + it "should not include executable search paths that include directories outside the respective user's home directory" do + expect(findings).to be_empty, "Users with non-homedir paths assigned to their PATH environment variable:\n\t#{findings}" + end + end end diff --git a/controls/SV-258051.rb b/controls/SV-258051.rb index 4eff351..5ed29c1 100644 --- a/controls/SV-258051.rb +++ b/controls/SV-258051.rb @@ -1,6 +1,7 @@ control 'SV-258051' do title 'All RHEL 9 local interactive users must have a home directory assigned in the /etc/passwd file.' - desc 'If local interactive users are not assigned a valid home directory, there is no place for the storage and control of files they should own.' + desc 'If local interactive users are not assigned a valid home directory, +there is no place for the storage and control of files they should own.' desc 'check', "Verify that interactive users on the system have a home directory assigned with the following command: $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1, $3, $6}' /etc/passwd @@ -15,14 +16,39 @@ desc 'fix', 'Create and assign home directories to all local interactive users on RHEL 9 that currently do not have a home directory assigned.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61792r926138_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258051' tag rid: 'SV-258051r926140_rule' tag stig_id: 'RHEL-09-411060' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61716r926139_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + exempt_users = input('exempt_home_users') + ignore_shells = input('non_interactive_shells').join('|') + actvite_users_without_homedir = users.where { !shell.match(ignore_shells) && home.nil? }.entries + + # only_if("This control is Not Applicable since no 'non-exempt' users were found", impact: 0.0) { !active_home.empty? } + + describe 'All non-exempt users' do + it 'have an assinded home directory that exists' do + failure_message = "The following users do not have an assigned home directory: #{actvite_users_without_homedir.join(', ')}" + expect(actvite_users_without_homedir).to be_empty, failure_message + end + end + describe 'Note: `exempt_home_users` skipped user' do + exempt_users.each do |u| + next if exempt_users.empty? + + it u.to_s do + expect(user(u).username).to be_truthy.or be_nil + end + end + end end diff --git a/controls/SV-258052.rb b/controls/SV-258052.rb index 550101e..27fd055 100644 --- a/controls/SV-258052.rb +++ b/controls/SV-258052.rb @@ -20,14 +20,40 @@ $ sudo chmod 0750 /home/wadea' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61793r926141_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258052' tag rid: 'SV-258052r926143_rule' tag stig_id: 'RHEL-09-411065' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61717r926142_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + exempt_home_users = input('exempt_home_users') + uid_min = login_defs.read_params['UID_MIN'].to_i + uid_min = 1000 if uid_min.nil? + + iuser_entries = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) } + + if !iuser_entries.users.nil? && !iuser_entries.users.empty? + failing_homedirs = iuser_entries.homes.reject { |home| + file(home).exist? + } + describe 'All non-exempt interactive user account home directories on the system' do + it 'should exist' do + expect(failing_homedirs).to be_empty, "Failing home directories:\n\t- #{failing_homedirs.join("\n\t- ")}" + end + end + else + describe 'No non-exempt interactive user accounts' do + it 'were detected on the system' do + expect(true).to eq(true) + end + end + end end diff --git a/controls/SV-258053.rb b/controls/SV-258053.rb index fe07b5c..3c04de9 100644 --- a/controls/SV-258053.rb +++ b/controls/SV-258053.rb @@ -23,14 +23,42 @@ $ sudo chgrp users /home/wadea) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61794r926144_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258053' tag rid: 'SV-258053r926146_rule' tag stig_id: 'RHEL-09-411070' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61718r926145_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + exempt_home_users = input('exempt_home_users') + uid_min = login_defs.read_params['UID_MIN'].to_i + uid_min = 1000 if uid_min.nil? + + iuser_entries = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) } + + if !iuser_entries.users.nil? && !iuser_entries.users.empty? + failing_iusers = iuser_entries.entries.reject { |iu| + file(iu['home']).gid == iu.gid.to_i + } + failing_homedirs = failing_iusers.map { |iu| iu['home'] } + + describe 'All non-exempt interactive user account home directories on the system' do + it 'should be group-owned by the group of the user they are associated with' do + expect(failing_homedirs).to be_empty, "Failing home directories:\n\t- #{failing_homedirs.join("\n\t- ")}" + end + end + else + describe 'No non-exempt interactive user accounts' do + it 'were detected on the system' do + expect(true).to eq(true) + end + end + end end diff --git a/controls/SV-258054.rb b/controls/SV-258054.rb index c54ccf0..ec9d61f 100644 --- a/controls/SV-258054.rb +++ b/controls/SV-258054.rb @@ -1,8 +1,6 @@ control 'SV-258054' do title 'RHEL 9 must automatically lock an account when three unsuccessful logon attempts occur.' - desc 'By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-force attacks, is reduced. Limits are imposed by locking the account. - -' + desc 'By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-force attacks, is reduced. Limits are imposed by locking the account.' desc 'check', %q(Verify RHEL 9 is configured to lock an account after three unsuccessful logon attempts with the command: $ grep 'deny =' /etc/security/faillock.conf @@ -17,15 +15,20 @@ deny = 3' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61795r926147_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000329-GPOS-00128' + tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128'] tag gid: 'V-258054' tag rid: 'SV-258054r926149_rule' tag stig_id: 'RHEL-09-411075' - tag gtitle: 'SRG-OS-000329-GPOS-00128' tag fix_id: 'F-61719r926148_fix' - tag satisfies: ['SRG-OS-000329-GPOS-00128', 'SRG-OS-000021-GPOS-00005'] - tag 'documentable' tag cci: ['CCI-000044', 'CCI-002238'] tag nist: ['AC-7 a', 'AC-7 b'] + tag 'host' + tag 'container' + + describe parse_config_file('/etc/security/faillock.conf') do + its('deny') { should cmp <= input('unsuccessful_attempts') } + its('deny') { should_not cmp 0 } + end end diff --git a/controls/SV-258055.rb b/controls/SV-258055.rb index b3fe5a2..3458e86 100644 --- a/controls/SV-258055.rb +++ b/controls/SV-258055.rb @@ -31,4 +31,13 @@ tag 'documentable' tag cci: ['CCI-000044', 'CCI-002238'] tag nist: ['AC-7 a', 'AC-7 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe command('grep even_deny_root /etc/security/faillock.conf').stdout.strip do + it { should match(/^even_deny_root$/) } + end end diff --git a/controls/SV-258056.rb b/controls/SV-258056.rb index 6c7ccbf..fa62586 100644 --- a/controls/SV-258056.rb +++ b/controls/SV-258056.rb @@ -1,8 +1,6 @@ control 'SV-258056' do title 'RHEL 9 must automatically lock an account when three unsuccessful logon attempts occur during a 15-minute time period.' - desc 'By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account. - -' + desc 'By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.' desc 'check', 'Verify RHEL 9 locks an account after three unsuccessful logon attempts within a period of 15 minutes with the following command: Note: If the system administrator demonstrates the use of an approved centralized account management method that locks an account after three unsuccessful logon attempts within a period of 15 minutes, this requirement is Not Applicable. @@ -21,15 +19,19 @@ fail_interval = 900' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61797r926153_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000329-GPOS-00128' + tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128'] tag gid: 'V-258056' tag rid: 'SV-258056r926155_rule' tag stig_id: 'RHEL-09-411085' - tag gtitle: 'SRG-OS-000329-GPOS-00128' tag fix_id: 'F-61721r926154_fix' - tag satisfies: ['SRG-OS-000329-GPOS-00128', 'SRG-OS-000021-GPOS-00005'] - tag 'documentable' tag cci: ['CCI-000044', 'CCI-002238'] tag nist: ['AC-7 a', 'AC-7 b'] + tag 'host' + tag 'container' + + describe parse_config_file(input('security_faillock_conf')) do + its('fail_interval') { should cmp >= input('fail_interval') } + end end diff --git a/controls/SV-258057.rb b/controls/SV-258057.rb index 2a5a12e..0942b24 100644 --- a/controls/SV-258057.rb +++ b/controls/SV-258057.rb @@ -30,4 +30,11 @@ tag 'documentable' tag cci: ['CCI-000044', 'CCI-002238'] tag nist: ['AC-7 a', 'AC-7 b'] + tag 'host', 'container' + + lockout_time = input('lockout_time') + + describe parse_config_file('/etc/security/faillock.conf') do + its('unlock_time') { should cmp lockout_time } + end end diff --git a/controls/SV-258058.rb b/controls/SV-258058.rb index 959da43..cbbf491 100644 --- a/controls/SV-258058.rb +++ b/controls/SV-258058.rb @@ -1,6 +1,9 @@ control 'SV-258058' do title 'RHEL 9 must not have unauthorized accounts.' - desc 'Accounts providing no operational purpose provide additional opportunities for system compromise. Unnecessary accounts include user accounts for individuals not requiring access to the system and application accounts for applications not installed on the system.' + desc 'Accounts providing no operational purpose provide additional +opportunities for system compromise. Unnecessary accounts include user accounts +for individuals not requiring access to the system and application accounts for +applications not installed on the system.' desc 'check', 'Verify that there are no unauthorized interactive user accounts with the following command: $ less /etc/passwd @@ -21,14 +24,22 @@ $ sudo userdel ' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61799r926159_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258058' tag rid: 'SV-258058r926161_rule' tag stig_id: 'RHEL-09-411095' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61723r926160_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + failing_users = passwd.users.reject { |u| (input('known_system_accounts') + input('user_accounts')).uniq.include?(u) } + + describe 'All users' do + it 'should have an explicit, authorized purpose (either a known user account or a required system account)' do + expect(failing_users).to be_empty, "Failing users:\n\t- #{failing_users.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258059.rb b/controls/SV-258059.rb index 918ffc5..0b2ff22 100644 --- a/controls/SV-258059.rb +++ b/controls/SV-258059.rb @@ -8,19 +8,27 @@ root If any accounts other than "root" have a UID of "0", this is a finding.) - desc 'fix', 'Change the UID of any account on the system, other than root, that has a UID of "0". + desc 'fix', 'Change the UID of any account on the system, other than root, that has a +UID of "0". -If the account is associated with system commands or applications, the UID should be changed to one greater than "0" but less than "1000". Otherwise, assign a UID of greater than "1000" that has not already been assigned.' + If the account is associated with system commands or applications, the UID +should be changed to one greater than "0" but less than "1000". Otherwise, +assign a UID of greater than "1000" that has not already been assigned.' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61800r926162_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258059' tag rid: 'SV-258059r926164_rule' tag stig_id: 'RHEL-09-411100' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61724r926163_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + describe passwd.uids(0) do + its('users') { should cmp 'root' } + its('entries.length') { should eq 1 } + end end diff --git a/controls/SV-258060.rb b/controls/SV-258060.rb index 7b39e79..e738a55 100644 --- a/controls/SV-258060.rb +++ b/controls/SV-258060.rb @@ -15,14 +15,19 @@ dir = /var/log/faillock' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61801r926165_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000021-GPOS-00005' + tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128'] tag gid: 'V-258060' tag rid: 'SV-258060r926167_rule' tag stig_id: 'RHEL-09-411105' - tag gtitle: 'SRG-OS-000021-GPOS-00005' tag fix_id: 'F-61725r926166_fix' - tag 'documentable' tag cci: ['CCI-000044'] tag nist: ['AC-7 a'] + tag 'host' + tag 'container' + + describe parse_config_file('/etc/security/faillock.conf') do + its('dir') { should cmp input('log_directory') } + end end diff --git a/controls/SV-258061.rb b/controls/SV-258061.rb index ace639a..948e9ab 100644 --- a/controls/SV-258061.rb +++ b/controls/SV-258061.rb @@ -19,4 +19,13 @@ tag 'documentable' tag cci: ['CCI-000764'] tag nist: ['IA-2'] + tag 'host', 'container' + + duplicate_gids = command('cut -d : -f 3 /etc/group | uniq -d').stdout.strip.split + + describe 'All GIDs' do + it 'should be unique' do + expect(duplicate_gids).to be_empty, "GIDs with more than one group name:\n\t- #{duplicate_gids.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258062.rb b/controls/SV-258062.rb index 4879152..50ccd08 100644 --- a/controls/SV-258062.rb +++ b/controls/SV-258062.rb @@ -1,6 +1,10 @@ control 'SV-258062' do title 'Local RHEL 9 initialization files must not execute world-writable programs.' - desc 'If user start-up files execute world-writable programs, especially in unprotected directories, they could be maliciously modified to destroy user files or otherwise compromise the system at the user level. If the system is compromised at the user level, it is easier to elevate privileges to eventually compromise the system at the root and network level.' + desc 'If user start-up files execute world-writable programs, especially in +unprotected directories, they could be maliciously modified to destroy user +files or otherwise compromise the system at the user level. If the system is +compromised at the user level, it is easier to elevate privileges to eventually +compromise the system at the root and network level.' desc 'check', 'Verify that local initialization files do not execute world-writable programs with the following command: Note: The example will be for a system that is configured to create user home directories in the "/home" directory. @@ -8,19 +12,47 @@ $ sudo find /home -perm -002 -type f -name ".[^.]*" -exec ls -ld {} \\; If any local initialization files are found to reference world-writable files, this is a finding.' - desc 'fix', 'Set the mode on files being executed by the local initialization files with the following command: + desc 'fix', 'Set the mode on files being executed by the local initialization files with +the following command: -$ sudo chmod 0755 ' + $ sudo chmod 0755 ' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61803r926171_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258062' tag rid: 'SV-258062r926173_rule' tag stig_id: 'RHEL-09-411115' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61727r926172_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + if input('disable_slow_controls') + describe 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute.' do + skip 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute. You must enable this control for a full accredidation for production.' + end + else + + # get all world-writeable programs + mount_points = etc_fstab.mount_point.join(' ') + ww_programs = command("find #{mount_points} -xdev -type f -perm -0002 -print").stdout.split.join('|') + + # get all homedirs + interactive_users = passwd.where { uid.to_i >= 1000 && shell !~ /nologin/ } + + interactive_user_homedirs = interactive_users.homes.map { |home_path| home_path.match(%r{^(.*)/.*$}).captures.first }.uniq + + # get all init files (.*) in homedirs + init_files = command("find #{interactive_user_homedirs.join(' ')} -xdev -maxdepth 2 -name '.*' ! -name '.bash_history' -type f").stdout.split("\n") + + # check for ww programs in the init files + init_files_invoking_ww = ww_programs.empty? ? [] : init_files.select { |i| file(i).content.lines.any? { |line| line.match(/^#{ww_programs}/) } } + + describe 'Interactive user initialization files' do + it 'should not invoke world-writeable programs' do + expect(init_files_invoking_ww).to be_empty, "Failing init files:\n\t- #{init_files_invoking_ww.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-258063.rb b/controls/SV-258063.rb index f0d0134..9f9f494 100644 --- a/controls/SV-258063.rb +++ b/controls/SV-258063.rb @@ -1,8 +1,6 @@ control 'SV-258063' do title 'RHEL 9 must have the tmux package installed.' - desc 'Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package. - -' + desc 'Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package.' desc 'check', 'Verify that RHEL 9 has the tmux package installed with the following command: $ sudo dnf list --installed tmux @@ -17,15 +15,22 @@ $ sudo dnf install tmux' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61804r926174_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000030-GPOS-00011' + tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] tag gid: 'V-258063' tag rid: 'SV-258063r926176_rule' tag stig_id: 'RHEL-09-412010' - tag gtitle: 'SRG-OS-000030-GPOS-00011' tag fix_id: 'F-61728r926175_fix' - tag satisfies: ['SRG-OS-000030-GPOS-00011', 'SRG-OS-000028-GPOS-00009'] - tag 'documentable' tag cci: ['CCI-000056', 'CCI-000058'] tag nist: ['AC-11 b', 'AC-11 a'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe package('tmux') do + it { should be_installed } + end end diff --git a/controls/SV-258064.rb b/controls/SV-258064.rb index 2b78fb2..3f8eba3 100644 --- a/controls/SV-258064.rb +++ b/controls/SV-258064.rb @@ -1,15 +1,13 @@ control 'SV-258064' do title 'RHEL 9 must ensure session control is automatically started at shell initialization.' - desc 'Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package. - -' + desc 'Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package.' desc 'check', 'Verify RHEL 9 shell initialization file is configured to start each shell with the tmux terminal multiplexer. Determine the location of the tmux script with the following command: $ sudo grep tmux /etc/bashrc /etc/profile.d/* -/etc/profile.d/tmux.sh: case "$name" in (sshd|login) exec tmux ;; esac +/etc/profile.d/tmux.sh: case "$name" in (sshd|login) tmux ;; esac Review the tmux script by using the following example: @@ -37,15 +35,43 @@ fi' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61805r926177_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000031-GPOS-00012' + tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011', 'SRG-OS-000031-GPOS-00012'] tag gid: 'V-258064' - tag rid: 'SV-258064r926179_rule' + tag rid: 'SV-258064r943016_rule' tag stig_id: 'RHEL-09-412015' - tag gtitle: 'SRG-OS-000031-GPOS-00012' tag fix_id: 'F-61729r926178_fix' - tag satisfies: ['SRG-OS-000031-GPOS-00012', 'SRG-OS-000028-GPOS-00009'] - tag 'documentable' tag cci: ['CCI-000056', 'CCI-000060'] tag nist: ['AC-11 b', 'AC-11 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + tmux_running = command('ps all | grep tmux | grep -v grep').stdout.strip + + describe 'tmux' do + it 'should be running' do + expect(tmux_running).to_not be_empty, 'tmux is not running' + end + end + + if tmux_running.nil? + + # compare the tmux config with the expected multiline string the same way we do the banner checks + # i.e. strip out all whitespace and compare the strings + + expected_config = "if [ \"$PS1\" ]; then\nparent=$(ps -o ppid= -p $$)\nname=$(ps -o comm= -p $parent)\ncase \"$name\" in (sshd|login) tmux ;; esac\nfi".content.gsub(/[\r\n\s]/, '') + + tmux_script = command('grep -r tmux /etc/bashrc /etc/profile.d').stdout.strip.match(/^(?\S+):/)['path'] + tmux_config = file(tmux_script).content.gsub(/[\r\n\s]/, '') + + describe 'tmux' do + it 'should be configured as expected' do + expect(tmux_config).to match(/#{expected_config}/), 'tmux config does not match expected script' + end + end + end end diff --git a/controls/SV-258065.rb b/controls/SV-258065.rb index b416ae7..58cb660 100644 --- a/controls/SV-258065.rb +++ b/controls/SV-258065.rb @@ -23,14 +23,30 @@ $ tmux source-file /etc/tmux.conf' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61806r926180_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000028-GPOS-00009' + tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011'] tag gid: 'V-258065' tag rid: 'SV-258065r926182_rule' tag stig_id: 'RHEL-09-412020' - tag gtitle: 'SRG-OS-000028-GPOS-00009' tag fix_id: 'F-61730r926181_fix' - tag 'documentable' tag cci: ['CCI-000056'] tag nist: ['AC-11 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + lock_command = command('grep -i lock-command /etc/tmux.conf').stdout.strip + lock_session = command('grep -i lock-session /etc/tmux.conf').stdout.strip + + describe 'tmux settings' do + it 'should set lock-command' do + expect(lock_command).to match(/set -g lock-command vlock/) + end + it 'should bind a specific key to lock-session' do + expect(lock_session).to match(/bind . lock-session/) + end + end end diff --git a/controls/SV-258066.rb b/controls/SV-258066.rb index 0ebe64f..91f15ae 100644 --- a/controls/SV-258066.rb +++ b/controls/SV-258066.rb @@ -1,8 +1,6 @@ control 'SV-258066' do title 'RHEL 9 must automatically lock command line user sessions after 15 minutes of inactivity.' - desc "A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, tmux can be configured to identify when a user's session has idled and take action to initiate a session lock. - -" + desc "A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, tmux can be configured to identify when a user's session has idled and take action to initiate a session lock." desc 'check', 'Verify RHEL 9 initiates a session lock after 15 minutes of inactivity. Check the value of the system inactivity timeout with the following command: @@ -17,15 +15,32 @@ set -g lock-after-time 900' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61807r926183_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000029-GPOS-00010' + tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012'] tag gid: 'V-258066' tag rid: 'SV-258066r926185_rule' tag stig_id: 'RHEL-09-412025' - tag gtitle: 'SRG-OS-000029-GPOS-00010' tag fix_id: 'F-61731r926184_fix' - tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012'] - tag 'documentable' tag cci: ['CCI-000057', 'CCI-000060'] tag nist: ['AC-11 a', 'AC-11 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + timeout = command('grep -i lock-after-time /etc/tmux.conf').stdout.strip.match(/lock-after-time\s+(?\d+)/) + expected_timeout = input('system_activity_timeout') + + describe 'tmux settings' do + it 'should set lock-after-time' do + expect(timeout).to_not be_nil, 'lock-after-time not set' + end + unless timeout.nil? + it "should lock the session after #{expected_timeout} seconds" do + expect(timeout['timeout'].to_i).to cmp <= expected_timeout + end + end + end end diff --git a/controls/SV-258067.rb b/controls/SV-258067.rb index f6eaa03..d4b8f2d 100644 --- a/controls/SV-258067.rb +++ b/controls/SV-258067.rb @@ -1,8 +1,6 @@ control 'SV-258067' do title 'RHEL 9 must prevent users from disabling session control mechanisms.' - desc 'The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 must provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. - -' + desc 'The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 must provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity.' desc 'check', 'Verify RHEL 9 prevents users from disabling the tmux terminal multiplexer with the following command: $ grep -i tmux /etc/shells @@ -11,15 +9,21 @@ desc 'fix', 'Configure RHEL 9 to prevent users from disabling the tmux terminal multiplexer by editing the "/etc/shells" configuration file to remove any instances of tmux.' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61808r926186_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000324-GPOS-00125' + tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011', 'SRG-OS-000324-GPOS-00125'] tag gid: 'V-258067' tag rid: 'SV-258067r926188_rule' tag stig_id: 'RHEL-09-412030' - tag gtitle: 'SRG-OS-000324-GPOS-00125' tag fix_id: 'F-61732r926187_fix' - tag satisfies: ['SRG-OS-000324-GPOS-00125', 'SRG-OS-000028-GPOS-00009'] - tag 'documentable' tag cci: ['CCI-000056', 'CCI-002235'] tag nist: ['AC-11 b', 'AC-6 (10)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe command('grep -i tmux /etc/shells') do + its('stdout.strip') { should be_empty } + end end diff --git a/controls/SV-258068.rb b/controls/SV-258068.rb index 8420576..4b9baf9 100644 --- a/controls/SV-258068.rb +++ b/controls/SV-258068.rb @@ -30,4 +30,21 @@ tag 'documentable' tag cci: ['CCI-000057', 'CCI-001133'] tag nist: ['AC-11 a', 'SC-10'] + tag 'host', 'container' + + stop_idle_session_sec = input('stop_idle_session_sec') + + tmout_lines = command('grep -i tmout /etc/profile /etc/profile.d/*.sh').stdout.strip + tmout_value = tmout_lines.match(/^[^#]+TMOUT\s*=\s*(\d+)/i) + + describe 'The system' do + it 'should set a TMOUT value' do + expect(tmout_value).to_not be_nil, 'No TMOUT value set in /etc/profile or /etc/profile.d/*.sh' + end + unless tmout_value.nil? + it "should exit after #{stop_idle_session_sec} seconds of inactivity" do + expect(tmout_value.captures.first.to_i).to be <= stop_idle_session_sec + end + end + end end diff --git a/controls/SV-258069.rb b/controls/SV-258069.rb index 909f1c5..5f15e15 100644 --- a/controls/SV-258069.rb +++ b/controls/SV-258069.rb @@ -19,14 +19,41 @@ * hard maxlogins 10' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61810r926192_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000027-GPOS-00008' tag gid: 'V-258069' tag rid: 'SV-258069r926194_rule' tag stig_id: 'RHEL-09-412040' - tag gtitle: 'SRG-OS-000027-GPOS-00008' tag fix_id: 'F-61734r926193_fix' - tag 'documentable' tag cci: ['CCI-000054'] tag nist: ['AC-10'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + setting = 'maxlogins' + expected_value = input('concurrent_sessions_permitted') + + limits_files = command('ls /etc/security/limits.d/*.conf').stdout.strip.split + limits_files.append('/etc/security/limits.conf') + + # make sure that at least one limits.conf file has the correct setting + globally_set = limits_files.any? { |lf| !limits_conf(lf).read_params['*'].nil? && limits_conf(lf).read_params['*'].include?(['hard', setting.to_s, expected_value.to_s]) } + + # make sure that no limits.conf file has a value that contradicts the global set + failing_files = limits_files.select { |lf| + limits_conf(lf).read_params.values.flatten(1).any? { |l| + l[1].eql?(setting) && l[2].to_i > expected_value + } + } + describe 'Limits files' do + it "should limit concurrent sessions to #{expected_value} by default" do + expect(globally_set).to eq(true), "No global ('*') setting for concurrent sessions found" + end + it 'should not have any conflicting settings' do + expect(failing_files).to be_empty, "Files with incorrect '#{setting}' settings:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258070.rb b/controls/SV-258070.rb index d28ae59..e21b09c 100644 --- a/controls/SV-258070.rb +++ b/controls/SV-258070.rb @@ -15,14 +15,19 @@ audit' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61811r926195_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000021-GPOS-00005' + tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128'] tag gid: 'V-258070' tag rid: 'SV-258070r926197_rule' tag stig_id: 'RHEL-09-412045' - tag gtitle: 'SRG-OS-000021-GPOS-00005' tag fix_id: 'F-61735r926196_fix' - tag 'documentable' tag cci: ['CCI-000044'] tag nist: ['AC-7 a'] + tag 'host' + tag 'container' + + describe parse_config_file('/etc/security/faillock.conf') do + its('audit') { should_not be_nil } + end end diff --git a/controls/SV-258071.rb b/controls/SV-258071.rb index 1b3e88e..95d6509 100644 --- a/controls/SV-258071.rb +++ b/controls/SV-258071.rb @@ -15,14 +15,18 @@ FAIL_DELAY 4' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61812r926198_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00226' tag gid: 'V-258071' tag rid: 'SV-258071r926200_rule' tag stig_id: 'RHEL-09-412050' - tag gtitle: 'SRG-OS-000480-GPOS-00226' tag fix_id: 'F-61736r926199_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + describe login_defs do + its('FAIL_DELAY.to_i') { should cmp >= input('login_prompt_delay') } + end end diff --git a/controls/SV-258072.rb b/controls/SV-258072.rb index ba8a15f..3dc0603 100644 --- a/controls/SV-258072.rb +++ b/controls/SV-258072.rb @@ -31,4 +31,24 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + file = '/etc/bashrc' + + expected_umask = input('permissions_for_shells')[:bashrc_umask] + + umask_check = command("grep umask #{file}").stdout.strip.match(/^umask\s+(?\d+)$/) + + if umask_check.nil? + describe "UMASK should be set in #{file}" do + subject { umask_check } + it { should_not be_nil } + end + else + impact 0.7 if umask_check[:umask] == '0000' || umask_check[:umask] == '000' + describe 'UMASK' do + subject { umask_check[:umask] } + it { should cmp expected_umask } + end + end end diff --git a/controls/SV-258073.rb b/controls/SV-258073.rb index d8e98f2..175523c 100644 --- a/controls/SV-258073.rb +++ b/controls/SV-258073.rb @@ -31,4 +31,24 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + file = '/etc/csh.cshrc' + + expected_umask = input('permissions_for_shells')[:cshrc_umask] + + umask_check = command("grep umask #{file}").stdout.strip.match(/^umask\s+(?\d+)$/) + + if umask_check.nil? + describe "UMASK should be set in #{file}" do + subject { umask_check } + it { should_not be_nil } + end + else + impact 0.7 if umask_check[:umask] == '0000' || umask_check[:umask] == '000' + describe 'UMASK' do + subject { umask_check[:umask] } + it { should cmp expected_umask } + end + end end diff --git a/controls/SV-258074.rb b/controls/SV-258074.rb index 3231410..75ab922 100644 --- a/controls/SV-258074.rb +++ b/controls/SV-258074.rb @@ -1,6 +1,7 @@ control 'SV-258074' do title 'RHEL 9 must define default permissions for all authenticated users in such a way that the user can only read and modify their own files.' - desc 'Setting the most restrictive default permissions ensures that when new accounts are created, they do not have unnecessary access.' + desc 'Setting the most restrictive default permissions ensures that when new +accounts are created, they do not have unnecessary access.' desc 'check', 'Verify RHEL 9 defines default permissions for all authenticated users in such a way that the user can only read and modify their own files with the following command: Note: If the value of the "UMASK" parameter is set to "000" in "/etc/login.defs" file, the Severity is raised to a CAT I. @@ -17,14 +18,20 @@ UMASK 077' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61815r926207_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00228' tag gid: 'V-258074' tag rid: 'SV-258074r926209_rule' tag stig_id: 'RHEL-09-412065' - tag gtitle: 'SRG-OS-000480-GPOS-00228' tag fix_id: 'F-61739r926208_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + permissions_for_shells = input('permissions_for_shells') + + describe login_defs do + its('UMASK') { should cmp permissions_for_shells['default_umask'] } + end end diff --git a/controls/SV-258075.rb b/controls/SV-258075.rb index 2ac4295..8c6fa89 100644 --- a/controls/SV-258075.rb +++ b/controls/SV-258075.rb @@ -30,4 +30,24 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + file = '/etc/profile' + + expected_umask = input('permissions_for_shells')[:profile_umask] + + umask_check = command("grep umask #{file}").stdout.strip.match(/^umask\s+(?\d+)$/) + + if umask_check.nil? + describe "UMASK should be set in #{file}" do + subject { umask_check } + it { should_not be_nil } + end + else + impact 0.7 if umask_check[:umask] == '0000' || umask_check[:umask] == '000' + describe 'UMASK' do + subject { umask_check[:umask] } + it { should cmp expected_umask } + end + end end diff --git a/controls/SV-258076.rb b/controls/SV-258076.rb index 35bb05b..ce419ba 100644 --- a/controls/SV-258076.rb +++ b/controls/SV-258076.rb @@ -1,13 +1,15 @@ control 'SV-258076' do title 'RHEL 9 must display the date and time of the last successful account logon upon logon.' desc 'Users need to be aware of activity that occurs regarding their account. Providing users with information regarding the number of unsuccessful attempts that were made to login to their account allows the user to determine if any unauthorized activity has occurred and gives them an opportunity to notify administrators.' - desc 'check', 'Verify users are provided with feedback on when account accesses last occurred with the following command: + desc 'check', 'Verify users are provided with feedback on when account accesses last +occurred with the following command: -$ sudo grep pam_lastlog /etc/pam.d/postlogin + $ sudo grep pam_lastlog /etc/pam.d/postlogin -session required pam_lastlog.so showfailed + session required pam_lastlog.so showfailed -If "pam_lastlog" is missing from "/etc/pam.d/postlogin" file, or the silent option is present, this is a finding.' + If "pam_lastlog" is missing from "/etc/pam.d/postlogin" file, or the +silent option is present, this is a finding.' desc 'fix', 'Configure RHEL 9 to provide users with feedback on when account accesses last occurred by setting the required configuration options in "/etc/pam.d/postlogin". Add the following line to the top of "/etc/pam.d/postlogin": @@ -15,14 +17,19 @@ session required pam_lastlog.so showfailed' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61817r926213_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258076' tag rid: 'SV-258076r926215_rule' tag stig_id: 'RHEL-09-412075' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61741r926214_fix' - tag 'documentable' - tag cci: ['CCI-000366'] - tag nist: ['CM-6 b'] + tag cci: ['CCI-000366', 'CCI-000052'] + tag nist: ['CM-6 b', 'AC-9'] + tag 'host' + tag 'container' + + describe pam('/etc/pam.d/postlogin') do + its('lines') { should match_pam_rule('session .* pam_lastlog.so').all_with_args('showfailed') } + its('lines') { should_not match_pam_rule('session .* pam_lastlog.so').all_without_args('silent') } + end end diff --git a/controls/SV-258077.rb b/controls/SV-258077.rb index ce13d1c..52f45bc 100644 --- a/controls/SV-258077.rb +++ b/controls/SV-258077.rb @@ -29,4 +29,12 @@ tag 'documentable' tag cci: ['CCI-001133'] tag nist: ['SC-10'] + tag 'container' + tag 'host' + + stop_idle_session_sec = input('stop_idle_session_sec') + + describe parse_config_file('/etc/systemd/logind.conf') do + its('Login') { should include('StopIdleSessionSec' => stop_idle_session_sec.to_s) } + end end diff --git a/controls/SV-258078.rb b/controls/SV-258078.rb index 24bb290..e5d9f49 100644 --- a/controls/SV-258078.rb +++ b/controls/SV-258078.rb @@ -1,10 +1,17 @@ control 'SV-258078' do title 'RHEL 9 must use a Linux Security Module configured to enforce limits on system services.' - desc 'Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. - -This requirement applies to operating systems performing security function verification/testing and/or systems and environments that require this functionality. - -' + desc 'Without verification of the security functions, security functions may +not operate correctly and the failure may go unnoticed. Security function is +defined as the hardware, software, and/or firmware of the information system +responsible for enforcing the system security policy and supporting the +isolation of code and data on which the protection is based. Security +functionality includes, but is not limited to, establishing system accounts, +configuring access authorizations (i.e., permissions, privileges), setting +events to be audited, and setting intrusion detection parameters. + + This requirement applies to operating systems performing security function +verification/testing and/or systems and environments that require this +functionality.' desc 'check', 'Ensure that RHEL 9 verifies correct operation of security functions through the use of SELinux with the following command: $ getenforce @@ -30,15 +37,21 @@ A reboot is required for the changes to take effect.' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61819r926219_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000445-GPOS-00199' tag gid: 'V-258078' tag rid: 'SV-258078r926221_rule' tag stig_id: 'RHEL-09-431010' - tag gtitle: 'SRG-OS-000445-GPOS-00199' tag fix_id: 'F-61743r926220_fix' - tag satisfies: ['SRG-OS-000445-GPOS-00199', 'SRG-OS-000134-GPOS-00068'] - tag 'documentable' tag cci: ['CCI-001084', 'CCI-002696'] tag nist: ['SC-3', 'SI-6 a'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + describe selinux do + it { should be_enforcing } + end end diff --git a/controls/SV-258079.rb b/controls/SV-258079.rb index 05f8143..1017d0c 100644 --- a/controls/SV-258079.rb +++ b/controls/SV-258079.rb @@ -19,14 +19,27 @@ A reboot is required for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61820r926222_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000445-GPOS-00199' tag gid: 'V-258079' tag rid: 'SV-258079r926224_rule' tag stig_id: 'RHEL-09-431015' - tag gtitle: 'SRG-OS-000445-GPOS-00199' tag fix_id: 'F-61744r926223_fix' - tag 'documentable' tag cci: ['CCI-002696'] tag nist: ['SI-6 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe selinux do + it { should_not be_disabled } + it { should be_enforcing } + its('policy') { should eq 'targeted' } + end + + describe parse_config_file('/etc/selinux/config') do + its('SELINUXTYPE') { should eq 'targeted' } + end end diff --git a/controls/SV-258080.rb b/controls/SV-258080.rb index 2e9cd99..b7c0672 100644 --- a/controls/SV-258080.rb +++ b/controls/SV-258080.rb @@ -39,6 +39,32 @@ tag gtitle: 'SRG-OS-000021-GPOS-00005' tag fix_id: 'F-61745r926226_fix' tag 'documentable' - tag cci: ['CCI-000044'] - tag nist: ['AC-7 a'] + tag cci: ['CCI-000044', 'CCI-002238'] + tag nist: ['AC-7 a', 'AC-7 b'] + tag 'host' + + if virtualization.system.eql?('docker') + impact 0.0 + describe 'Control not applicable in a container' do + skip 'SELinux controls Not Applicable in a container' + end + else + + describe selinux do + it { should be_installed } + it { should be_enforcing } + it { should_not be_disabled } + end + + describe parse_config_file('/etc/security/faillock.conf') do + its('dir') { should cmp input('non_default_tally_dir') } + end + + faillock_tally = input('faillock_tally') + + describe "The selected non-default tally directory for PAM: #{input('non_default_tally_dir')}" do + subject { file(input('non_default_tally_dir')) } + its('selinux_label') { should match(/#{faillock_tally}/) } + end + end end diff --git a/controls/SV-258081.rb b/controls/SV-258081.rb index 83c5774..bf625b3 100644 --- a/controls/SV-258081.rb +++ b/controls/SV-258081.rb @@ -1,10 +1,18 @@ control 'SV-258081' do title 'RHEL 9 must have policycoreutils package installed.' - desc 'Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. + desc 'Without verification of the security functions, security functions may +not operate correctly and the failure may go unnoticed. Security function is +defined as the hardware, software, and/or firmware of the information system +responsible for enforcing the system security policy and supporting the +isolation of code and data on which the protection is based. Security +functionality includes, but is not limited to, establishing system accounts, +configuring access authorizations (i.e., permissions, privileges), setting +events to be audited, and setting intrusion detection parameters. -Policycoreutils contains the policy core utilities that are required for basic operation of an SELinux-enabled system. These utilities include load_policy to load SELinux policies, setfile to label filesystems, newrole to switch roles, and run_init to run /etc/init.d scripts in the proper context. - -' + Policycoreutils contains the policy core utilities that are required for +basic operation of an SELinux-enabled system. These utilities include +load_policy to load SELinux policies, setfile to label filesystems, newrole to +switch roles, and run_init to run /etc/init.d scripts in the proper context.' desc 'check', 'Verify RHEL 9 has the policycoreutils package installed with the following command: $ sudo dnf list --installed policycoreutils @@ -19,15 +27,21 @@ $ sudo dnf install policycoreutils' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61822r926228_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258081' tag rid: 'SV-258081r926230_rule' tag stig_id: 'RHEL-09-431025' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61746r926229_fix' - tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000134-GPOS-00068'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-001084'] - tag nist: ['CM-6 b', 'SC-3'] + tag cci: ['CCI-001084', 'CCI-000366'] + tag nist: ['SC-3', 'CM-6 b'] + tag 'host' + + only_if('Control not applicable within a container', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + describe package('policycoreutils') do + it { should be_installed } + end end diff --git a/controls/SV-258082.rb b/controls/SV-258082.rb index f10c99f..0cd9740 100644 --- a/controls/SV-258082.rb +++ b/controls/SV-258082.rb @@ -25,4 +25,9 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + describe package('policycoreutils-python-utils') do + it { should be_installed } + end end diff --git a/controls/SV-258083.rb b/controls/SV-258083.rb index 08289a7..47c1b62 100644 --- a/controls/SV-258083.rb +++ b/controls/SV-258083.rb @@ -25,4 +25,13 @@ tag 'documentable' tag cci: ['CCI-002235'] tag nist: ['AC-6 (10)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?) + } + + describe package('sudo') do + it { should be_installed } + end end diff --git a/controls/SV-258084.rb b/controls/SV-258084.rb index 68e8f00..d9c69bc 100644 --- a/controls/SV-258084.rb +++ b/controls/SV-258084.rb @@ -7,7 +7,7 @@ If the value is set to an integer less than "0", the user's time stamp will not expire and the user will not have to reauthenticate for privileged actions until the user's session is terminated.) desc 'check', %q(Verify RHEL 9 requires reauthentication when using the "sudo" command to elevate privileges with the following command: -$ sudo grep -i 'timestamp_timeout' /etc/sudoers /etc/sudoers.d/* +$ sudo grep -ir 'timestamp_timeout' /etc/sudoers /etc/sudoers.d/* /etc/sudoers:Defaults timestamp_timeout=0 @@ -21,14 +21,29 @@ Defaults timestamp_timeout=0' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61825r926237_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000373-GPOS-00156' tag gid: 'V-258084' - tag rid: 'SV-258084r926239_rule' + tag rid: 'SV-258084r943061_rule' tag stig_id: 'RHEL-09-432015' - tag gtitle: 'SRG-OS-000373-GPOS-00156' tag fix_id: 'F-61749r926238_fix' - tag 'documentable' tag cci: ['CCI-002038'] tag nist: ['IA-11'] + tag 'host' + tag 'container-conditional' + + only_if('This requirement is Not Applicable in a container with no sudo installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !command('sudo').exist?) + } + + setting = 'timestamp_timeout' + setting_value = sudoers(input('sudoers_config_files')).settings.Defaults[setting] + + describe 'Sudoers configuration' do + it "should should set #{setting} to a non-negative number, exactly once" do + expect(setting_value).to_not be_nil, "#{setting} not found inside sudoers config file(s)" + expect(setting_value.count).to eq(1), "#{setting} set #{setting_value.count} times inside sudoers config file(s)" + expect(setting_value.first.to_i).to be >= 0 + end + end end diff --git a/controls/SV-258085.rb b/controls/SV-258085.rb index d1ad109..e289e30 100644 --- a/controls/SV-258085.rb +++ b/controls/SV-258085.rb @@ -3,7 +3,7 @@ desc 'If the rootpw, targetpw, or runaspw flags are defined and not disabled, by default the operating system will prompt the invoking user for the "root" user password.' desc 'check', %q(Verify that the sudoers security policy is configured to use the invoking user's password for privilege escalation with the following command: -$ sudo egrep -i '(!rootpw|!targetpw|!runaspw)' /etc/sudoers /etc/sudoers.d/* | grep -v '#' +$ sudo egrep -ir '(!rootpw|!targetpw|!runaspw)' /etc/sudoers /etc/sudoers.d/* | grep -v '#' /etc/sudoers:Defaults !targetpw /etc/sudoers:Defaults !rootpw @@ -25,14 +25,34 @@ Defaults !runaspw' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61826r926240_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258085' - tag rid: 'SV-258085r926242_rule' + tag rid: 'SV-258085r943063_rule' tag stig_id: 'RHEL-09-432020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61750r926241_fix' - tag 'documentable' - tag cci: ['CCI-000366'] - tag nist: ['CM-6 b'] + tag cci: ['CCI-002227', 'CCI-000366'] + tag nist: ['AC-6 (5)', 'CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers without sudo installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !command('sudo').exist?) + } + + settings = sudoers(input('sudoers_config_files').join(' ')).settings['Defaults'] + + describe 'Sudoers file(s) settings' do + it 'should set !targetpw' do + expect(settings).to include('!targetpw'), 'Sudoers file(s) do not set !targetpw' + expect(settings).not_to include('targetpw'), 'Sudoers file(s) set targetpw' + end + it 'should set !rootpw' do + expect(settings).to include('!rootpw'), 'Sudoers file(s) do not set !rootpw' + expect(settings).not_to include('rootpw'), 'Sudoers file(s) set rootpw' + end + it 'should set !runaspw' do + expect(settings).to include('!runaspw'), 'Sudoers file(s) do not set !runaspw' + expect(settings).not_to include('runaspw'), 'Sudoers file(s) set runaspw' + end + end end diff --git a/controls/SV-258086.rb b/controls/SV-258086.rb index a8c5845..fd677c1 100644 --- a/controls/SV-258086.rb +++ b/controls/SV-258086.rb @@ -2,12 +2,10 @@ title 'RHEL 9 must require users to reauthenticate for privilege escalation.' desc 'Without reauthentication, users may access resources or perform tasks for which they do not have authorization. -When operating systems provide the capability to escalate a functional capability, it is critical that the user reauthenticate. - -' +When operating systems provide the capability to escalate a functional capability, it is critical that the user reauthenticate.' desc 'check', %q(Verify that "/etc/sudoers" has no occurrences of "!authenticate" with the following command: -$ sudo grep -i '!authenticate' /etc/sudoers /etc/sudoers.d/* +$ sudo grep -ir '!authenticate' /etc/sudoers /etc/sudoers.d/* If any occurrences of "!authenticate" are returned, this is a finding.) desc 'fix', %q(Configure RHEL 9 to not allow users to execute privileged actions without authenticating. @@ -17,15 +15,23 @@ $ sudo sed -i '/\!authenticate/ s/^/# /g' /etc/sudoers /etc/sudoers.d/*) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61827r926243_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000373-GPOS-00156' + tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158'] tag gid: 'V-258086' - tag rid: 'SV-258086r926245_rule' + tag rid: 'SV-258086r943065_rule' tag stig_id: 'RHEL-09-432025' - tag gtitle: 'SRG-OS-000373-GPOS-00156' tag fix_id: 'F-61751r926244_fix' - tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158'] - tag 'documentable' tag cci: ['CCI-002038'] tag nist: ['IA-11'] + tag 'host' + tag 'container-conditional' + + only_if('Control not applicable within a container without sudo installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !command('sudo').exist?) + } + + describe sudoers(input('sudoers_config_files')) do + its('settings.Defaults') { should_not include '!authenticate' } + end end diff --git a/controls/SV-258087.rb b/controls/SV-258087.rb index 0e51765..6f4e32a 100644 --- a/controls/SV-258087.rb +++ b/controls/SV-258087.rb @@ -14,14 +14,30 @@ ALL ALL=(ALL:ALL) ALL' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61828r926246_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258087' tag rid: 'SV-258087r926248_rule' tag stig_id: 'RHEL-09-432030' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61752r926247_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers without sudo installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !command('sudo').exist?) + } + + bad_sudoers_rules = sudoers(input('sudoers_config_files').join(' ')).rules.where { + users == 'ALL' && + hosts == 'ALL' && + run_as.start_with?('ALL') && + commands == 'ALL' + } + + describe 'Sudoers file(s)' do + it 'should not contain any unrestricted sudo rules' do + expect(bad_sudoers_rules.entries).to be_empty, "Unrestricted sudo rules found; check sudoers file(s):\n\t- #{input('sudoers_config_files').join("\n\t- ")}" + end + end end diff --git a/controls/SV-258088.rb b/controls/SV-258088.rb index 650e534..08e7e5f 100644 --- a/controls/SV-258088.rb +++ b/controls/SV-258088.rb @@ -32,4 +32,10 @@ tag 'documentable' tag cci: ['CCI-002038', 'CCI-002165'] tag nist: ['IA-11', 'AC-3 (4)'] + tag 'host' + tag 'container' + + describe pam('/etc/pam.d/su') do + its('lines') { should match_pam_rule('auth required pam_wheel.so').all_with_args('use_uid') } + end end diff --git a/controls/SV-258089.rb b/controls/SV-258089.rb index dfd7231..376a172 100644 --- a/controls/SV-258089.rb +++ b/controls/SV-258089.rb @@ -8,9 +8,7 @@ RHEL 9 ships with many optional packages. One such package is a file access policy daemon called "fapolicyd". "fapolicyd" is a userspace daemon that determines access rights to files based on attributes of the process and file. It can be used to either blocklist or allowlist processes or file access. -Proceed with caution with enforcing the use of this daemon. Improper configuration may render the system nonfunctional. The "fapolicyd" API is not namespace aware and can cause issues when launching or running containers. - -' +Proceed with caution with enforcing the use of this daemon. Improper configuration may render the system nonfunctional. The "fapolicyd" API is not namespace aware and can cause issues when launching or running containers.' desc 'check', 'Verify that RHEL 9 fapolicyd package is installed with the following command: $ sudo dnf list --installed fapolicyd @@ -25,15 +23,29 @@ $ sudo dnf install fapolicyd' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61830r926252_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000370-GPOS-00155' + tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155', 'SRG-OS-000480-GPOS-00232'] tag gid: 'V-258089' tag rid: 'SV-258089r926254_rule' tag stig_id: 'RHEL-09-433010' - tag gtitle: 'SRG-OS-000370-GPOS-00155' tag fix_id: 'F-61754r926253_fix' - tag satisfies: ['SRG-OS-000370-GPOS-00155', 'SRG-OS-000368-GPOS-00154'] - tag 'documentable' tag cci: ['CCI-001764', 'CCI-001774'] tag nist: ['CM-7 (2)', 'CM-7 (5) (b)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if !input('use_fapolicyd') + impact 0.0 + describe 'The organization is not using the Fapolicyd service to manage firewall servies, this control is Not Applicable' do + skip 'The organization is not using the Fapolicyd service to manage firewall servies, this control is Not Applicable' + end + else + describe package('fapolicyd') do + it { should be_installed } + end + end end diff --git a/controls/SV-258090.rb b/controls/SV-258090.rb index 759e239..8703fb0 100644 --- a/controls/SV-258090.rb +++ b/controls/SV-258090.rb @@ -8,9 +8,7 @@ RHEL 9 ships with many optional packages. One such package is a file access policy daemon called "fapolicyd". "fapolicyd" is a userspace daemon that determines access rights to files based on attributes of the process and file. It can be used to either blocklist or allowlist processes or file access. -Proceed with caution with enforcing the use of this daemon. Improper configuration may render the system nonfunctional. The "fapolicyd" API is not namespace aware and can cause issues when launching or running containers. - -' +Proceed with caution with enforcing the use of this daemon. Improper configuration may render the system nonfunctional. The "fapolicyd" API is not namespace aware and can cause issues when launching or running containers.' desc 'check', 'Verify that RHEL 9 fapolicyd is active with the following command: $ systemctl is-active fapolicyd @@ -23,15 +21,31 @@ $ systemctl enable --now fapolicyd' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61831r926255_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000370-GPOS-00155' + tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155', 'SRG-OS-000480-GPOS-00232'] tag gid: 'V-258090' tag rid: 'SV-258090r926257_rule' tag stig_id: 'RHEL-09-433015' - tag gtitle: 'SRG-OS-000370-GPOS-00155' tag fix_id: 'F-61755r926256_fix' - tag satisfies: ['SRG-OS-000370-GPOS-00155', 'SRG-OS-000368-GPOS-00154'] - tag 'documentable' tag cci: ['CCI-001764', 'CCI-001774'] tag nist: ['CM-7 (2)', 'CM-7 (5) (b)'] + tag 'host' + + if virtualization.system.eql?('docker') + impact 0.0 + describe 'This requirement is Not Applicable in the container' do + skip 'This requirement is Not Applicable in the container' + end + elsif !input('use_fapolicyd') + impact 0.0 + describe 'The organization does not use the Fapolicyd service to manage firewall services' do + skip 'The organization is not using the Fapolicyd service to manage firewall services, this control is Not Applicable' + end + else + describe service('fapolicyd') do + it { should be_enabled } + it { should be_running } + end + end end diff --git a/controls/SV-258091.rb b/controls/SV-258091.rb index 87d0c7b..41302ce 100644 --- a/controls/SV-258091.rb +++ b/controls/SV-258091.rb @@ -31,6 +31,16 @@ tag gtitle: 'SRG-OS-000069-GPOS-00037' tag fix_id: 'F-61756r926259_fix' tag 'documentable' - tag cci: ['CCI-000192'] - tag nist: ['IA-5 (1) (a)'] + tag cci: ['CCI-000366', 'CCI-000192'] + tag nist: ['CM-6 b', 'IA-5 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable for containers', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + describe 'System pwquality setting' do + subject { parse_config(command('grep -rh retry /etc/security/pwquality.conf*').stdout.strip) } + its('retry') { should cmp >= input('min_retry') } + end end diff --git a/controls/SV-258092.rb b/controls/SV-258092.rb index 84730fd..1985011 100644 --- a/controls/SV-258092.rb +++ b/controls/SV-258092.rb @@ -21,14 +21,20 @@ password required pam_pwhistory.so use_authtok remember=5 retry=3' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61833r926261_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000077-GPOS-00045' tag gid: 'V-258092' tag rid: 'SV-258092r926263_rule' tag stig_id: 'RHEL-09-611015' - tag gtitle: 'SRG-OS-000077-GPOS-00045' tag fix_id: 'F-61757r926262_fix' - tag 'documentable' tag cci: ['CCI-000200'] tag nist: ['IA-5 (1) (e)'] + tag 'host' + tag 'container' + + pam_auth_files = input('pam_auth_files') + + describe pam(pam_auth_files['password-auth']) do + its('lines') { should match_pam_rule('password (required|requisite|sufficient) pam_pwhistory.so').any_with_integer_arg('remember', '>=', input('min_reuse_generations')) } + end end diff --git a/controls/SV-258093.rb b/controls/SV-258093.rb index 62fea80..caca7b1 100644 --- a/controls/SV-258093.rb +++ b/controls/SV-258093.rb @@ -31,4 +31,12 @@ tag 'documentable' tag cci: ['CCI-000200'] tag nist: ['IA-5 (1) (e)'] + tag 'host' + tag 'container' + + pam_auth_files = input('pam_auth_files') + + describe pam(pam_auth_files['system-auth']) do + its('lines') { should match_pam_rule('password (required|requisite|sufficient) pam_pwhistory.so').any_with_integer_arg('remember', '>=', input('min_reuse_generations')) } + end end diff --git a/controls/SV-258094.rb b/controls/SV-258094.rb index 4cee6f9..b78632a 100644 --- a/controls/SV-258094.rb +++ b/controls/SV-258094.rb @@ -21,4 +21,16 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + pam_auth_files = input('pam_auth_files') + file_list = pam_auth_files.values.join(' ') + bad_entries = command("grep -i nullok #{file_list}").stdout.lines.collect(&:squish) + + describe 'The system is configureed' do + subject { command("grep -i nullok #{file_list}") } + it 'to not allow null passwords' do + expect(subject.stdout.strip).to be_empty, "The system is configured to allow null passwords. Please remove any instances of the `nullok` option from: \n\t- #{bad_entries.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258095.rb b/controls/SV-258095.rb index 382af53..1269dd8 100644 --- a/controls/SV-258095.rb +++ b/controls/SV-258095.rb @@ -20,14 +20,23 @@ account required pam_faillock.so' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61836r926270_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000021-GPOS-00005' + tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128'] tag gid: 'V-258095' tag rid: 'SV-258095r926272_rule' tag stig_id: 'RHEL-09-611030' - tag gtitle: 'SRG-OS-000021-GPOS-00005' tag fix_id: 'F-61760r926271_fix' - tag 'documentable' tag cci: ['CCI-000044'] tag nist: ['AC-7 a'] + tag 'host' + tag 'container' + + pam_auth_files = input('pam_auth_files') + + describe pam(pam_auth_files['system-auth']) do + its('lines') { should match_pam_rule('auth required pam_faillock.so preauth') } + its('lines') { should match_pam_rule('auth required pam_faillock.so authfail') } + its('lines') { should match_pam_rule('account required pam_faillock.so') } + end end diff --git a/controls/SV-258096.rb b/controls/SV-258096.rb index 4c7ea07..337c03d 100644 --- a/controls/SV-258096.rb +++ b/controls/SV-258096.rb @@ -20,14 +20,21 @@ account required pam_faillock.so' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61837r926273_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000021-GPOS-00005' + tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128'] tag gid: 'V-258096' tag rid: 'SV-258096r926275_rule' tag stig_id: 'RHEL-09-611035' - tag gtitle: 'SRG-OS-000021-GPOS-00005' tag fix_id: 'F-61761r926274_fix' - tag 'documentable' tag cci: ['CCI-000044'] tag nist: ['AC-7 a'] + tag 'host' + tag 'container' + + describe pam('/etc/pam.d/password-auth') do + its('lines') { should match_pam_rule('auth required pam_faillock.so preauth') } + its('lines') { should match_pam_rule('auth required pam_faillock.so authfail') } + its('lines') { should match_pam_rule('account required pam_faillock.so') } + end end diff --git a/controls/SV-258097.rb b/controls/SV-258097.rb index c2ba293..fe0709e 100644 --- a/controls/SV-258097.rb +++ b/controls/SV-258097.rb @@ -1,8 +1,6 @@ control 'SV-258097' do title 'RHEL 9 must ensure the password complexity module is enabled in the password-auth file.' - desc 'Enabling PAM password complexity permits enforcement of strong passwords and consequently makes the system less prone to dictionary attacks. - -' + desc 'Enabling PAM password complexity permits enforcement of strong passwords and consequently makes the system less prone to dictionary attacks.' desc 'check', 'Verify RHEL 9 uses "pwquality" to enforce the password complexity rules in the password-auth file with the following command: $ cat /etc/pam.d/password-auth | grep pam_pwquality @@ -17,15 +15,23 @@ password required pam_pwquality.so' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61838r926276_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000069-GPOS-00037' tag gid: 'V-258097' tag rid: 'SV-258097r926278_rule' tag stig_id: 'RHEL-09-611040' - tag gtitle: 'SRG-OS-000069-GPOS-00037' tag fix_id: 'F-61762r926277_fix' - tag satisfies: ['SRG-OS-000069-GPOS-00037', 'SRG-OS-000070-GPOS-00038', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000192', 'CCI-000193', 'CCI-000366'] - tag nist: ['IA-5 (1) (a)', 'IA-5 (1) (a)', 'CM-6 b'] + tag cci: ['CCI-000192', 'CCI-000366', 'CCI-000193'] + tag nist: ['IA-5 (1) (a)', 'CM-6 b'] + tag 'host' + tag 'container' + + pam_auth_files = input('pam_auth_files') + + describe pam(pam_auth_files['password-auth']) do + its('lines') { should match_pam_rule('password (required|requisite) pam_pwquality.so') } + end + describe pam(pam_auth_files['system-auth']) do + its('lines') { should match_pam_rule('password (required|requisite) pam_pwquality.so') } + end end diff --git a/controls/SV-258098.rb b/controls/SV-258098.rb index d01027e..1ad3b66 100644 --- a/controls/SV-258098.rb +++ b/controls/SV-258098.rb @@ -25,4 +25,14 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + pam_auth_files = input('pam_auth_files') + + [pam_auth_files['password-auth'], pam_auth_files['system-auth']].each do |path| + describe pam(path) do + its('lines') { should match_pam_rule('.* .* pam_pwquality.so') } + end + end end diff --git a/controls/SV-258099.rb b/controls/SV-258099.rb index 8f3552a..8c7bf5d 100644 --- a/controls/SV-258099.rb +++ b/controls/SV-258099.rb @@ -30,4 +30,13 @@ tag 'documentable' tag cci: ['CCI-000196', 'CCI-000803'] tag nist: ['IA-5 (1) (c)', 'IA-7'] + tag 'host' + tag 'container' + + expected_line = 'password sufficient pam_unix.so sha512' + pam_auth_files = input('pam_auth_files') + + describe pam(pam_auth_files['password-auth']) do + its('lines') { should match_pam_rule(expected_line).any_with_integer_arg('rounds', '>=', input('password_hash_rounds')) } + end end diff --git a/controls/SV-258100.rb b/controls/SV-258100.rb index 52fca1e..e228959 100644 --- a/controls/SV-258100.rb +++ b/controls/SV-258100.rb @@ -30,4 +30,13 @@ tag 'documentable' tag cci: ['CCI-000196', 'CCI-000803'] tag nist: ['IA-5 (1) (c)', 'IA-7'] + tag 'host' + tag 'container' + + expected_line = 'password sufficient pam_unix.so sha512' + pam_auth_files = input('pam_auth_files') + + describe pam(pam_auth_files['password-auth']) do + its('lines') { should match_pam_rule(expected_line).any_with_integer_arg('rounds', '>=', input('password_hash_rounds')) } + end end diff --git a/controls/SV-258101.rb b/controls/SV-258101.rb index 585fe0a..3a96255 100644 --- a/controls/SV-258101.rb +++ b/controls/SV-258101.rb @@ -32,4 +32,19 @@ tag 'documentable' tag cci: ['CCI-000192', 'CCI-000193', 'CCI-000194', 'CCI-000195', 'CCI-000205', 'CCI-000366', 'CCI-001619'] tag nist: ['IA-5 (1) (a)', 'IA-5 (1) (a)', 'IA-5 (1) (a)', 'IA-5 (1) (b)', 'IA-5 (1) (a)', 'CM-6 b', 'IA-5 (1) (a)'] + tag 'host' + tag 'container' + + # TODO: use this pattern on the rest of the pwquality.conf settings (current implementation for the other ones dont account for multiple conmf files) + + setting = 'enforce_for_root' + + setting_check = command("grep #{setting} /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf").stdout.strip.match(/^:+#{setting}$/) + + describe 'The root account' do + it 'should enforce password complexity rules' do + expect(setting_check).to_not be_nil, "'#{setting}' not found (or commented out) in conf file(s)" + expect(setting_check.length).to eq(1), "'#{setting}' set more than once in conf file(s)" + end + end end diff --git a/controls/SV-258102.rb b/controls/SV-258102.rb index bc3ffcb..c16a7b7 100644 --- a/controls/SV-258102.rb +++ b/controls/SV-258102.rb @@ -19,14 +19,32 @@ lcredit = -1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61843r926291_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000070-GPOS-00038' tag gid: 'V-258102' tag rid: 'SV-258102r926293_rule' tag stig_id: 'RHEL-09-611065' - tag gtitle: 'SRG-OS-000070-GPOS-00038' tag fix_id: 'F-61767r926292_fix' - tag 'documentable' tag cci: ['CCI-000193'] tag nist: ['IA-5 (1) (a)'] + tag 'host' + tag 'container' + + describe 'pwquality.conf settings' do + let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) } + let(:setting) { 'lcredit' } + let(:value) { Array(config.params[setting]) } + + it 'has `lcredit` set' do + expect(value).not_to be_empty, 'lcredit is not set in pwquality.conf' + end + + it 'only sets `lcredit` once' do + expect(value.length).to eq(1), 'lcredit is commented or set more than once in pwquality.conf' + end + + it 'does not set `lcredit` to a positive value' do + expect(value.first.to_i).to be < 0, 'lcredit is not set to a negative value in pwquality.conf' + end + end end diff --git a/controls/SV-258103.rb b/controls/SV-258103.rb index 62d2ee4..f695842 100644 --- a/controls/SV-258103.rb +++ b/controls/SV-258103.rb @@ -19,14 +19,32 @@ dcredit = -1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61844r926294_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000071-GPOS-00039' tag gid: 'V-258103' tag rid: 'SV-258103r926296_rule' tag stig_id: 'RHEL-09-611070' - tag gtitle: 'SRG-OS-000071-GPOS-00039' tag fix_id: 'F-61768r926295_fix' - tag 'documentable' tag cci: ['CCI-000194'] tag nist: ['IA-5 (1) (a)'] + tag 'host' + tag 'container' + + describe 'pwquality.conf settings' do + let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) } + let(:setting) { 'dcredit' } + let(:value) { Array(config.params[setting]) } + + it 'has `dcredit` set' do + expect(value).not_to be_empty, 'dcredit is not set in pwquality.conf' + end + + it 'only sets `dcredit` once' do + expect(value.length).to eq(1), 'dcredit is commented or set more than once in pwquality.conf' + end + + it 'does not set `dcredit` to a positive value' do + expect(value.first.to_i).to be < 0, 'dcredit is not set to a negative value in pwquality.conf' + end + end end diff --git a/controls/SV-258104.rb b/controls/SV-258104.rb index 69c0cc0..494e302 100644 --- a/controls/SV-258104.rb +++ b/controls/SV-258104.rb @@ -19,14 +19,24 @@ PASS_MIN_DAYS 1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61845r926297_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000075-GPOS-00043' tag gid: 'V-258104' tag rid: 'SV-258104r926299_rule' tag stig_id: 'RHEL-09-611075' - tag gtitle: 'SRG-OS-000075-GPOS-00043' tag fix_id: 'F-61769r926298_fix' - tag 'documentable' tag cci: ['CCI-000198'] tag nist: ['IA-5 (1) (d)'] + tag 'host' + tag 'container' + + value = input('pass_min_days') + setting = input_object('pass_min_days').name.upcase + + describe "/etc/login.defs does not have `#{setting}` configured" do + let(:config) { login_defs.read_params[setting] } + it "greater than #{value} day" do + expect(config).to cmp <= value + end + end end diff --git a/controls/SV-258105.rb b/controls/SV-258105.rb index bf16bd4..3b2e8d2 100644 --- a/controls/SV-258105.rb +++ b/controls/SV-258105.rb @@ -1,6 +1,10 @@ control 'SV-258105' do title 'RHEL 9 passwords must have a 24 hours minimum password lifetime restriction in /etc/shadow.' - desc "Enforcing a minimum password lifetime helps to prevent repeated password changes to defeat the password reuse or history enforcement requirement. If users are allowed to immediately and continually change their password, the password could be repeatedly changed in a short period of time to defeat the organization's policy regarding password reuse." + desc "Enforcing a minimum password lifetime helps to prevent repeated +password changes to defeat the password reuse or history enforcement +requirement. If users are allowed to immediately and continually change their +password, the password could be repeatedly changed in a short period of time to +defeat the organization's policy regarding password reuse." desc 'check', %q(Verify that RHEL 9 has configured the minimum time period between password changes for each user account as one day or greater with the following command: $ sudo awk -F: '$4 < 1 {print $1 " " $4}' /etc/shadow @@ -11,14 +15,26 @@ $ sudo passwd -n 1 [user]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61846r926300_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000075-GPOS-00043' tag gid: 'V-258105' tag rid: 'SV-258105r926302_rule' tag stig_id: 'RHEL-09-611080' - tag gtitle: 'SRG-OS-000075-GPOS-00043' tag fix_id: 'F-61770r926301_fix' - tag 'documentable' tag cci: ['CCI-000198'] tag nist: ['IA-5 (1) (d)'] + tag 'host' + tag 'container' + + # TODO: add inputs for a frequecny + + bad_users = users.where { uid >= 1000 }.where { mindays < 1 }.usernames + in_scope_users = bad_users - input('exempt_home_users') + + describe 'Users should not' do + it 'be able to change their password more then once a 24 hour period' do + failure_message = "The following users can update their password more then once a day: #{in_scope_users.join(', ')}" + expect(in_scope_users).to be_empty, failure_message + end + end end diff --git a/controls/SV-258106.rb b/controls/SV-258106.rb index 8da79cc..09c6022 100644 --- a/controls/SV-258106.rb +++ b/controls/SV-258106.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must require users to provide a password for privilege escalation.' desc 'Without reauthentication, users may access resources or perform tasks for which they do not have authorization. -When operating systems provide the capability to escalate a functional capability, it is critical that the user reauthenticate. - -' +When operating systems provide the capability to escalate a functional capability, it is critical that the user reauthenticate.' desc 'check', 'Verify that "/etc/sudoers" has no occurrences of "NOPASSWD" with the following command: $ sudo grep -ri nopasswd /etc/sudoers /etc/sudoers.d/* @@ -17,15 +15,31 @@ $ sudo sed -i '/NOPASSWD/ s/^/# /g' /etc/sudoers /etc/sudoers.d/*) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61847r926303_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000373-GPOS-00156' + tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158'] tag gid: 'V-258106' tag rid: 'SV-258106r926305_rule' tag stig_id: 'RHEL-09-611085' - tag gtitle: 'SRG-OS-000373-GPOS-00156' tag fix_id: 'F-61771r926304_fix' - tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158'] - tag 'documentable' tag cci: ['CCI-002038'] tag nist: ['IA-11'] + tag 'host' + tag 'container-conditional' + + only_if('Control not applicable within a container without sudo installed', impact: 0.0) { + !(virtualization.system.eql?('docker') && !command('sudo').exist?) + } + + # TODO: figure out why this .where throws an exception if we don't explicitly filter out nils via 'tags.nil?' + # ergo shouldn't the filtertable be handling that kind of nil-checking for us? + failing_results = sudoers(input('sudoers_config_files').join(' ')).rules.where { tags.nil? && (tags || '').include?('NOPASSWD') } + + failing_results = failing_results.where { !input('passwordless_admins').include?(users) } if input('passwordless_admins').nil? + + describe 'Sudoers' do + it 'should not include any (non-exempt) users with NOPASSWD set' do + expect(failing_results.users).to be_empty, "NOPASSWD settings found for users:\n\t- #{failing_results.users.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258107.rb b/controls/SV-258107.rb index a683390..552b51a 100644 --- a/controls/SV-258107.rb +++ b/controls/SV-258107.rb @@ -23,14 +23,18 @@ minlen = 15' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61848r926306_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000078-GPOS-00046' tag gid: 'V-258107' tag rid: 'SV-258107r926308_rule' tag stig_id: 'RHEL-09-611090' - tag gtitle: 'SRG-OS-000078-GPOS-00046' tag fix_id: 'F-61772r926307_fix' - tag 'documentable' tag cci: ['CCI-000205'] tag nist: ['IA-5 (1) (a)'] + tag 'host' + tag 'container' + + describe parse_config_file('/etc/security/pwquality.conf') do + its('minlen.to_i') { should cmp >= input('pass_min_len') } + end end diff --git a/controls/SV-258108.rb b/controls/SV-258108.rb index 2fca5d8..4052fed 100644 --- a/controls/SV-258108.rb +++ b/controls/SV-258108.rb @@ -19,14 +19,24 @@ PASS_MIN_LEN 15' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61849r926309_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000078-GPOS-00046' tag gid: 'V-258108' tag rid: 'SV-258108r926311_rule' tag stig_id: 'RHEL-09-611095' - tag gtitle: 'SRG-OS-000078-GPOS-00046' tag fix_id: 'F-61773r926310_fix' - tag 'documentable' tag cci: ['CCI-000205'] tag nist: ['IA-5 (1) (a)'] + tag 'host' + tag 'container' + + value = input('pass_min_len') + setting = input_object('pass_min_len').name.upcase + + describe "/etc/login.defs does not have `#{setting}` configured" do + let(:config) { login_defs.read_params[setting] } + it "greater than #{value} day" do + expect(config).to cmp >= value + end + end end diff --git a/controls/SV-258109.rb b/controls/SV-258109.rb index dece232..31ff9bc 100644 --- a/controls/SV-258109.rb +++ b/controls/SV-258109.rb @@ -15,14 +15,34 @@ ocredit = -1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61850r926312_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000266-GPOS-00101' tag gid: 'V-258109' tag rid: 'SV-258109r926314_rule' tag stig_id: 'RHEL-09-611100' - tag gtitle: 'SRG-OS-000266-GPOS-00101' tag fix_id: 'F-61774r926313_fix' - tag 'documentable' tag cci: ['CCI-001619'] tag nist: ['IA-5 (1) (a)'] + tag 'host' + tag 'container' + + # value = input('ocredit') + setting = 'ocredit' + + describe 'pwquality.conf settings' do + let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) } + let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) } + + it "has `#{setting}` set" do + expect(setting_value).not_to be_empty, "#{setting} is not set in pwquality.conf" + end + + it "only sets `#{setting}` once" do + expect(setting_value.length).to eq(1), "#{setting} is commented or set more than once in pwquality.conf" + end + + it "does not set `#{setting}` to a positive value" do + expect(setting_value.first.to_i).to be <= 0, "#{setting} is set to a positive value in pwquality.conf" + end + end end diff --git a/controls/SV-258110.rb b/controls/SV-258110.rb index 2ca8b46..2252452 100644 --- a/controls/SV-258110.rb +++ b/controls/SV-258110.rb @@ -15,14 +15,18 @@ dictcheck=1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61851r926315_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00225' tag gid: 'V-258110' tag rid: 'SV-258110r926317_rule' tag stig_id: 'RHEL-09-611105' - tag gtitle: 'SRG-OS-000480-GPOS-00225' tag fix_id: 'F-61775r926316_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + describe parse_config_file('/etc/security/pwquality.conf') do + its('dictcheck') { should eq '1' } + end end diff --git a/controls/SV-258111.rb b/controls/SV-258111.rb index b732967..77d0ad1 100644 --- a/controls/SV-258111.rb +++ b/controls/SV-258111.rb @@ -17,14 +17,32 @@ ucredit = -1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61852r926318_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000069-GPOS-00037' tag gid: 'V-258111' tag rid: 'SV-258111r926320_rule' tag stig_id: 'RHEL-09-611110' - tag gtitle: 'SRG-OS-000069-GPOS-00037' tag fix_id: 'F-61776r926319_fix' - tag 'documentable' tag cci: ['CCI-000192'] tag nist: ['IA-5 (1) (a)'] + tag 'host' + tag 'container' + + describe 'pwquality.conf:' do + let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) } + let(:setting) { 'ucredit' } + let(:value) { Array(config.params[setting]) } + + it 'has `ucredit` set' do + expect(value).not_to be_empty, 'ucredit is not set in pwquality.conf' + end + + it 'only sets `ucredit` once' do + expect(value.length).to eq(1), 'ucredit is commented or set more than once in pwquality.conf' + end + + it 'does not set `ucredit` to a positive value' do + expect(value.first.to_i).to cmp < 0, 'ucredit is not set to a negative value in pwquality.conf' + end + end end diff --git a/controls/SV-258112.rb b/controls/SV-258112.rb index f96ff95..6265eba 100644 --- a/controls/SV-258112.rb +++ b/controls/SV-258112.rb @@ -27,4 +27,23 @@ tag 'documentable' tag cci: ['CCI-000195'] tag nist: ['IA-5 (1) (b)'] + tag 'host', 'container' + + setting = 'difok' + expected_value = input('difok') + + pattern = /^[^#]*#{setting}\s*=\s*(?\d+)$/ + setting_check = command("grep #{setting} /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf").stdout.strip.scan(pattern).flatten + + describe 'Password settings for the root account' do + it 'should be set' do + expect(setting_check).to_not be_empty, "'#{setting}' not found (or commented out) in conf file(s)" + end + it 'should only be set once' do + expect(setting_check.length).to eq(1), "'#{setting}' set more than once in conf file(s)" + end + it "should be set to be >= #{expected_value}" do + expect(setting_check.first.to_i).to be >= expected_value, "'#{setting}' set to less than '#{expected_value}' in conf file(s)" + end + end end diff --git a/controls/SV-258113.rb b/controls/SV-258113.rb index 19c1d0a..688b027 100644 --- a/controls/SV-258113.rb +++ b/controls/SV-258113.rb @@ -17,14 +17,34 @@ maxclassrepeat = 4' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61854r926324_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000072-GPOS-00040' tag gid: 'V-258113' tag rid: 'SV-258113r926326_rule' tag stig_id: 'RHEL-09-611120' - tag gtitle: 'SRG-OS-000072-GPOS-00040' tag fix_id: 'F-61778r926325_fix' - tag 'documentable' tag cci: ['CCI-000195'] tag nist: ['IA-5 (1) (b)'] + tag 'host' + tag 'container' + + value = input('maxclassrepeat') + setting = 'maxclassrepeat' + + describe 'pwquality.conf settings' do + let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) } + let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) } + + it "has `#{setting}` set" do + expect(setting_value).not_to be_empty, "#{setting} is not set in pwquality.conf" + end + + it "only sets `#{setting}` once" do + expect(setting_value.length).to eq(1), "#{setting} is commented or set more than once in pwquality.conf" + end + + it "does not set `#{setting}` to more than #{value}" do + expect(setting_value.first.to_i).to be <= value.to_i, "#{setting} is set to a value greater than #{value} in pwquality.conf" + end + end end diff --git a/controls/SV-258114.rb b/controls/SV-258114.rb index a494f3f..bfcc13d 100644 --- a/controls/SV-258114.rb +++ b/controls/SV-258114.rb @@ -17,14 +17,34 @@ maxrepeat = 3' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61855r926327_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000072-GPOS-00040' tag gid: 'V-258114' tag rid: 'SV-258114r926329_rule' tag stig_id: 'RHEL-09-611125' - tag gtitle: 'SRG-OS-000072-GPOS-00040' tag fix_id: 'F-61779r926328_fix' - tag 'documentable' tag cci: ['CCI-000195'] tag nist: ['IA-5 (1) (b)'] + tag 'host' + tag 'container' + + value = input('maxrepeat') + setting = 'maxrepeat' + + describe 'pwquality.conf settings' do + let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) } + let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) } + + it "has `#{setting}` set" do + expect(setting_value).not_to be_empty, "#{setting} is not set in pwquality.conf" + end + + it "only sets `#{setting}` once" do + expect(setting_value.length).to eq(1), "#{setting} is commented or set more than once in pwquality.conf" + end + + it "does not set `#{setting}` to more than #{value}" do + expect(setting_value.first.to_i).to be <= value.to_i, "#{setting} is set to a value greater than #{value} in pwquality.conf" + end + end end diff --git a/controls/SV-258115.rb b/controls/SV-258115.rb index 8d76a64..e1b4c20 100644 --- a/controls/SV-258115.rb +++ b/controls/SV-258115.rb @@ -17,14 +17,34 @@ minclass = 4' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61856r926330_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000072-GPOS-00040' tag gid: 'V-258115' tag rid: 'SV-258115r926332_rule' tag stig_id: 'RHEL-09-611130' - tag gtitle: 'SRG-OS-000072-GPOS-00040' tag fix_id: 'F-61780r926331_fix' - tag 'documentable' tag cci: ['CCI-000195'] tag nist: ['IA-5 (1) (b)'] + tag 'host' + tag 'container' + + value = input('minclass') + setting = 'minclass' + + describe 'pwquality.conf settings' do + let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) } + let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) } + + it "has `#{setting}` set" do + expect(setting_value).not_to be_empty, "#{setting} is not set in pwquality.conf" + end + + it "only sets `#{setting}` once" do + expect(setting_value.length).to eq(1), "#{setting} is commented or set more than once in pwquality.conf" + end + + it "does not set `#{setting}` to more than #{value}" do + expect(setting_value.first.to_i).to be <= value.to_i, "#{setting} is set to a value greater than #{value} in pwquality.conf" + end + end end diff --git a/controls/SV-258116.rb b/controls/SV-258116.rb index ab31a34..40b2139 100644 --- a/controls/SV-258116.rb +++ b/controls/SV-258116.rb @@ -27,4 +27,9 @@ tag 'documentable' tag cci: ['CCI-000196'] tag nist: ['IA-5 (1) (c)'] + tag 'host', 'container' + + describe parse_config_file('/etc/libuser.conf') do + its('crypt_style') { should cmp 'sha512' } + end end diff --git a/controls/SV-258117.rb b/controls/SV-258117.rb index 7d621d4..af6638e 100644 --- a/controls/SV-258117.rb +++ b/controls/SV-258117.rb @@ -27,4 +27,9 @@ tag 'documentable' tag cci: ['CCI-000196'] tag nist: ['IA-5 (1) (c)'] + tag 'host', 'container' + + describe login_defs do + its('ENCRYPT_METHOD') { should cmp 'SHA512' } + end end diff --git a/controls/SV-258118.rb b/controls/SV-258118.rb index 0f1fa68..0c05925 100644 --- a/controls/SV-258118.rb +++ b/controls/SV-258118.rb @@ -1,8 +1,6 @@ control 'SV-258118' do title 'RHEL 9 must not be configured to bypass password requirements for privilege escalation.' - desc 'Without reauthentication, users may access resources or perform tasks for which they do not have authorization. When operating systems provide the capability to escalate a functional capability, it is critical the user reauthenticate. - -' + desc 'Without reauthentication, users may access resources or perform tasks for which they do not have authorization. When operating systems provide the capability to escalate a functional capability, it is critical the user reauthenticate.' desc 'check', 'Verify the operating system is not configured to bypass password requirements for privilege escalation with the following command: $ sudo grep pam_succeed_if /etc/pam.d/sudo @@ -24,4 +22,17 @@ tag 'documentable' tag cci: ['CCI-002038'] tag nist: ['IA-11'] + tag 'host' + tag 'container-conditional' + + if virtualization.system.eql?('docker') && !command('sudo').exist? + impact 0.0 + describe 'Control not applicable within a container without sudo enabled' do + skip 'Control not applicable within a container without sudo enabled' + end + else + describe parse_config_file('/etc/pam.d/sudo') do + its('content') { should_not match(/pam_succeed_if/) } + end + end end diff --git a/controls/SV-258119.rb b/controls/SV-258119.rb index 8ac4231..46473ec 100644 --- a/controls/SV-258119.rb +++ b/controls/SV-258119.rb @@ -2,9 +2,7 @@ title 'RHEL 9 shadow password suite must be configured to use a sufficient number of hashing rounds.' desc 'Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text. -Using more hashing rounds makes password cracking attacks more difficult. - -' +Using more hashing rounds makes password cracking attacks more difficult.' desc 'check', 'Verify that RHEL 9 has a minimum number of hash rounds configured with the following command: $ grep -i sha_crypt /etc/login.defs @@ -17,15 +15,18 @@ SHA_CRYPT_MIN_ROUNDS 5000' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61860r926342_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000073-GPOS-00041' tag gid: 'V-258119' tag rid: 'SV-258119r926344_rule' tag stig_id: 'RHEL-09-611150' - tag gtitle: 'SRG-OS-000073-GPOS-00041' tag fix_id: 'F-61784r926343_fix' - tag satisfies: ['SRG-OS-000073-GPOS-00041', 'SRG-OS-000120-GPOS-00061'] - tag 'documentable' tag cci: ['CCI-000196', 'CCI-000803'] tag nist: ['IA-5 (1) (c)', 'IA-7'] + tag 'host' + tag 'container' + + describe login_defs do + its('ENCRYPT_METHOD') { should cmp 'SHA512' } + end end diff --git a/controls/SV-258120.rb b/controls/SV-258120.rb index 144cd9e..fd19762 100644 --- a/controls/SV-258120.rb +++ b/controls/SV-258120.rb @@ -27,4 +27,15 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + tag 'container' + + users_with_blank_passwords = shadow.where { password.nil? || password.empty? }.users - input('users_allowed_blank_passwords') + + describe 'All users' do + it 'should have a password set' do + fail_msg = "Users with blank passwords:\n\t- #{users_with_blank_passwords.join("\n\t- ")}" + expect(users_with_blank_passwords).to be_empty, fail_msg + end + end end diff --git a/controls/SV-258121.rb b/controls/SV-258121.rb index 326e160..d429297 100644 --- a/controls/SV-258121.rb +++ b/controls/SV-258121.rb @@ -28,4 +28,20 @@ tag 'documentable' tag cci: ['CCI-000764', 'CCI-000766', 'CCI-000767', 'CCI-000768', 'CCI-000770', 'CCI-001941', 'CCI-001942'] tag nist: ['IA-2', 'IA-2 (2)', 'IA-2 (3)', 'IA-2 (4)', 'IA-2 (5)', 'IA-2 (8)', 'IA-2 (9)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('smart_card_enabled') + describe parse_config_file('/etc/opensc.conf') do + its('card_drivers') { should cmp 'cac' } + end + else + impact 0.0 + describe 'The system is not smartcard enabled thus this control is Not Applicable' do + skip 'The system is not using Smartcards / PIVs to fulfil the MFA requirement, this control is Not Applicable.' + end + end end diff --git a/controls/SV-258122.rb b/controls/SV-258122.rb index 87b7093..11554db 100644 --- a/controls/SV-258122.rb +++ b/controls/SV-258122.rb @@ -1,8 +1,6 @@ control 'SV-258122' do title 'RHEL 9 must enable certificate based smart card authentication.' - desc 'Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. The DOD Common Access Card (CAC) with DOD-approved PKI is an example of multifactor authentication. - -' + desc 'Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. The DOD Common Access Card (CAC) with DOD-approved PKI is an example of multifactor authentication.' desc 'check', 'Verify that RHEL 9 has smart cards are enabled in System Security Services Daemon (SSSD), run the following command: $ sudo grep pam_cert_auth /etc/sssd/sssd.conf @@ -15,15 +13,41 @@ pam_cert_auth = True' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61863r926351_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000375-GPOS-00160' + tag satisfies: ['SRG-OS-000105-GPOS-00052', 'SRG-OS-000106-GPOS-00053', 'SRG-OS-000107-GPOS-00054', 'SRG-OS-000108-GPOS-00055', 'SRG-OS-000375-GPOS-00160'] tag gid: 'V-258122' tag rid: 'SV-258122r926353_rule' tag stig_id: 'RHEL-09-611165' - tag gtitle: 'SRG-OS-000375-GPOS-00160' tag fix_id: 'F-61787r926352_fix' - tag satisfies: ['SRG-OS-000375-GPOS-00160', 'SRG-OS-000105-GPOS-00052'] - tag 'documentable' tag cci: ['CCI-000765', 'CCI-001948'] tag nist: ['IA-2 (1)', 'IA-2 (11)'] + tag 'host' + + only_if('If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.', impact: 0.0) { + input('smart_card_enabled') + } + + sssd_conf_files = input('sssd_conf_files') + sssd_conf_contents = ini({ command: "cat #{input('sssd_conf_files').join(' ')}" }) + + pam_auth_files = input('pam_auth_files') + + describe 'SSSD' do + it 'should be installed and enabled' do + expect(service('sssd')).to be_installed.and be_enabled + expect(sssd_conf_contents.params).to_not be_empty, "SSSD configuration files not found or have no content; files checked:\n\t- #{sssd_conf_files.join("\n\t- ")}" + end + if sssd_conf_contents.params.nil? + it 'should configure pam_cert_auth' do + expect(sssd_conf_contents.sssd.pam_cert_auth).to eq(true) + end + end + end + + [pam_auth_files['system-auth'], pam_auth_files['smartcard-auth']].each do |path| + describe pam(path) do + its('lines') { should match_pam_rule('.* .* pam_sss.so (try_cert_auth|require_cert_auth)') } + end + end end diff --git a/controls/SV-258123.rb b/controls/SV-258123.rb index 43a9fca..a550cb2 100644 --- a/controls/SV-258123.rb +++ b/controls/SV-258123.rb @@ -4,9 +4,7 @@ Multifactor solutions that require devices separate from information systems gaining access include, for example, hardware tokens providing time-based or challenge-response authenticators and smart cards such as the U.S. Government Personal Identity Verification (PIV) card and the DOD CAC. -RHEL 9 includes multiple options for configuring certificate status checking, but for this requirement focuses on the System Security Services Daemon (SSSD). By default, SSSD performs Online Certificate Status Protocol (OCSP) checking and certificate verification using a sha256 digest function. - -' +RHEL 9 includes multiple options for configuring certificate status checking, but for this requirement focuses on the System Security Services Daemon (SSSD). By default, SSSD performs Online Certificate Status Protocol (OCSP) checking and certificate verification using a sha256 digest function.' desc 'check', 'Verify the operating system implements Online Certificate Status Protocol (OCSP) and is using the proper digest value on the system with the following command: $ sudo grep certificate_verification /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf | grep -v "^#" @@ -32,15 +30,40 @@ $ sudo systemctl restart sssd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61864r926354_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000375-GPOS-00160' + tag satisfies: ['SRG-OS-000375-GPOS-00160', 'SRG-OS-000377-GPOS-00162'] tag gid: 'V-258123' tag rid: 'SV-258123r926356_rule' tag stig_id: 'RHEL-09-611170' - tag gtitle: 'SRG-OS-000375-GPOS-00160' tag fix_id: 'F-61788r926355_fix' - tag satisfies: ['SRG-OS-000375-GPOS-00160', 'SRG-OS-000377-GPOS-00162'] - tag 'documentable' tag cci: ['CCI-001948', 'CCI-001954'] tag nist: ['IA-2 (11)', 'IA-2 (12)'] + tag 'host' + + only_if('This requirement is Not Applicable inside the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternate_mfa_method').nil? + describe 'Manual Review' do + skip "Alternate MFA method selected:\t\nConsult with ISSO to determine that alternate MFA method is approved; manually review system to ensure alternate MFA method is functioning" + end + else + sssd_conf_files = input('sssd_conf_files') + sssd_conf_contents = ini({ command: "cat #{input('sssd_conf_files').join(' ')}" }) + sssd_certificate_verification = input('sssd_certificate_verification') + + describe 'SSSD' do + it 'should be installed and enabled' do + expect(service('sssd')).to be_installed.and be_enabled + expect(sssd_conf_contents.params).to_not be_empty, "SSSD configuration files not found or have no content; files checked:\n\t- #{sssd_conf_files.join("\n\t- ")}" + end + if sssd_conf_contents.params.nil? + it "should configure certificate_verification to be '#{sssd_certificate_verification}'" do + expect(sssd_conf_contents.sssd.certificate_verification).to eq(sssd_certificate_verification) + end + end + end + end end diff --git a/controls/SV-258124.rb b/controls/SV-258124.rb index f998b35..42ec38a 100644 --- a/controls/SV-258124.rb +++ b/controls/SV-258124.rb @@ -25,4 +25,20 @@ tag 'documentable' tag cci: ['CCI-001948'] tag nist: ['IA-2 (11)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('smart_card_enabled') + describe package('pcsc-lite') do + it { should be_installed } + end + else + impact 0.0 + describe 'The system is not smartcard enabled thus this control is Not Applicable' do + skip 'The system is not using Smartcards / PIVs to fulfil the MFA requirement, this control is Not Applicable.' + end + end end diff --git a/controls/SV-258125.rb b/controls/SV-258125.rb index 537cacd..f16acb7 100644 --- a/controls/SV-258125.rb +++ b/controls/SV-258125.rb @@ -25,4 +25,21 @@ tag 'documentable' tag cci: ['CCI-001948'] tag nist: ['IA-2 (11)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('smart_card_enabled') + describe service('pcscd') do + it { should be_enabled } + it { should be_running } + end + else + impact 0.0 + describe 'The system is not smartcard enabled thus this control is Not Applicable' do + skip 'The system is not using Smartcards / PIVs to fulfil the MFA requirement, this control is Not Applicable.' + end + end end diff --git a/controls/SV-258126.rb b/controls/SV-258126.rb index bd11d30..77de161 100644 --- a/controls/SV-258126.rb +++ b/controls/SV-258126.rb @@ -30,4 +30,20 @@ tag 'documentable' tag cci: ['CCI-001948', 'CCI-001953'] tag nist: ['IA-2 (11)', 'IA-2 (12)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('smart_card_enabled') + describe package('opensc') do + it { should be_installed } + end + else + impact 0.0 + describe 'The system is not smartcard enabled thus this control is Not Applicable' do + skip 'The system is not using Smartcards / PIVs to fulfil the MFA requirement, this control is Not Applicable.' + end + end end diff --git a/controls/SV-258127.rb b/controls/SV-258127.rb index d72eff9..6f34ffb 100644 --- a/controls/SV-258127.rb +++ b/controls/SV-258127.rb @@ -14,19 +14,45 @@ $ sudo ssh-keygen -y -f /path/to/file If the contents of the key are displayed, this is a finding.' - desc 'fix', 'Create a new private and public key pair that utilizes a passcode with the following command: + desc 'fix', 'Create a new private and public key pair that utilizes a passcode with the +following command: -$ sudo ssh-keygen -n [passphrase]' + $ sudo ssh-keygen -n [passphrase]' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61868r926366_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000067-GPOS-00035' tag gid: 'V-258127' tag rid: 'SV-258127r926368_rule' tag stig_id: 'RHEL-09-611190' - tag gtitle: 'SRG-OS-000067-GPOS-00035' tag fix_id: 'F-61792r926367_fix' - tag 'documentable' tag cci: ['CCI-000186'] - tag nist: ['IA-5 (2) (a) (1)'] + tag nist: ['IA-5 (2) (b)', 'IA-5 (2) (a) (1)'] + tag 'host' + + if virtualization.system.eql?('docker') + impact 0.0 + describe 'N/A' do + skip 'Control not applicable within a container' + end + elsif input('private_key_files').empty? + impact 0.0 + describe 'N/A' do + skip 'No private key files were given in the input, this control is Not Applicable' + end + elsif input('private_key_files').map { |kf| file(kf).exist? }.uniq.first == false + describe 'no files found' do + skip 'No private key files given in the input were found on the system; please check the input accurately lists all private keys on this system' + end + else + passwordless_keys = input('private_key_files').select { |kf| + file(kf).exist? && + !inspec.command("ssh-keygen -y -P '' -f #{kf}").stderr.match('incorrect passphrase supplied to decrypt private key') + } + describe 'Private key files' do + it 'should all have passwords set' do + expect(passwordless_keys).to be_empty, "Passwordless key files:\n\t- #{passwordless_keys.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-258128.rb b/controls/SV-258128.rb index 5303c3d..1f3589f 100644 --- a/controls/SV-258128.rb +++ b/controls/SV-258128.rb @@ -17,14 +17,21 @@ ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61869r926369_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000080-GPOS-00048' tag gid: 'V-258128' tag rid: 'SV-258128r926371_rule' tag stig_id: 'RHEL-09-611195' - tag gtitle: 'SRG-OS-000080-GPOS-00048' tag fix_id: 'F-61793r926370_fix' - tag 'documentable' tag cci: ['CCI-000213'] tag nist: ['AC-3'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe service('emergency') do + its('params.ExecStart') { should include '/usr/lib/systemd/systemd-sulogin-shell emergency' } + end end diff --git a/controls/SV-258129.rb b/controls/SV-258129.rb index 02a5e78..bb2dfeb 100644 --- a/controls/SV-258129.rb +++ b/controls/SV-258129.rb @@ -27,4 +27,9 @@ tag 'documentable' tag cci: ['CCI-000213'] tag nist: ['AC-3'] + tag 'host', 'container' + + describe ini('/usr/lib/systemd/system/rescue.service') do + its('Service.ExecStart') { should match %r{^-/usr/lib/systemd/systemd-sulogin-shell rescue$} } + end end diff --git a/controls/SV-258130.rb b/controls/SV-258130.rb index 6a85914..09a091e 100644 --- a/controls/SV-258130.rb +++ b/controls/SV-258130.rb @@ -21,14 +21,31 @@ rm -f /etc/*.keytab' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61871r926375_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000120-GPOS-00061' tag gid: 'V-258130' tag rid: 'SV-258130r926377_rule' tag stig_id: 'RHEL-09-611205' - tag gtitle: 'SRG-OS-000120-GPOS-00061' tag fix_id: 'F-61795r926376_fix' - tag 'documentable' tag cci: ['CCI-000803'] tag nist: ['IA-7'] + tag 'host' + tag 'container' + + krb5_server = package('krb5-server') + krb5_workstation = package('krb5-workstation') + + if (krb5_server.installed? && krb5_server.version >= '1.17-18.el8') || (krb5_workstation.installed? && krb5_workstation.version >= '1.17-18.el8') + impact 0.0 + describe 'The system has krb5-workstation and server version 1.17-18 or higher' do + skip 'The system has krb5-workstation and server version 1.17-18 or higner, this requirement is Not Applicable.' + end + else + keytabs = command('ls /etc/*.keytab').stdout.split + describe 'The system' do + it 'should not have keytab files for Kerberos' do + expect(keytabs).to be_empty, "Keytab files:\n\t- #{keytabs.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-258131.rb b/controls/SV-258131.rb index 05aac34..9e1c8c5 100644 --- a/controls/SV-258131.rb +++ b/controls/SV-258131.rb @@ -1,14 +1,27 @@ control 'SV-258131' do title 'RHEL 9, for PKI-based authentication, must validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.' - desc 'Without path validation, an informed trust decision by the relying party cannot be made when presented with any certificate not already explicitly trusted. + desc 'Without path validation, an informed trust decision by the relying +party cannot be made when presented with any certificate not already explicitly +trusted. -A trust anchor is an authoritative entity represented via a public key and associated data. It is used in the context of public key infrastructures, X.509 digital certificates, and DNSSEC. + A trust anchor is an authoritative entity represented via a public key and +associated data. It is used in the context of public key infrastructures, X.509 +digital certificates, and DNSSEC. -When there is a chain of trust, usually the top entity to be trusted becomes the trust anchor; it can be, for example, a Certification Authority (CA). A certification path starts with the subject certificate and proceeds through a number of intermediate certificates up to a trusted root certificate, typically issued by a trusted CA. + When there is a chain of trust, usually the top entity to be trusted +becomes the trust anchor; it can be, for example, a Certification Authority +(CA). A certification path starts with the subject certificate and proceeds +through a number of intermediate certificates up to a trusted root certificate, +typically issued by a trusted CA. -This requirement verifies that a certification path to an accepted trust anchor is used for certificate validation and that the path includes status information. Path validation is necessary for a relying party to make an informed trust decision when presented with any certificate not already explicitly trusted. Status information for certification paths includes certificate revocation lists or online certificate status protocol responses. Validation of the certificate status information is out of scope for this requirement. - -' + This requirement verifies that a certification path to an accepted trust +anchor is used for certificate validation and that the path includes status +information. Path validation is necessary for a relying party to make an +informed trust decision when presented with any certificate not already +explicitly trusted. Status information for certification paths includes +certificate revocation lists or online certificate status protocol responses. +Validation of the certificate status information is out of scope for this +requirement.' desc 'check', 'Verify RHEL 9 for PKI-based authentication has valid certificates by constructing a certification path (which includes status information) to an accepted trust anchor. Check that the system has a valid DoD root CA installed with the following command: @@ -37,15 +50,39 @@ /etc/sssd/pki/sssd_auth_ca_db.pem' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61872r926378_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000066-GPOS-00034' + tag satisfies: ['SRG-OS-000066-GPOS-00034', 'SRG-OS-000384-GPOS-00167'] tag gid: 'V-258131' tag rid: 'SV-258131r926380_rule' tag stig_id: 'RHEL-09-631010' - tag gtitle: 'SRG-OS-000066-GPOS-00034' tag fix_id: 'F-61796r926379_fix' - tag satisfies: ['SRG-OS-000066-GPOS-00034', 'SRG-OS-000384-GPOS-00167'] - tag 'documentable' tag cci: ['CCI-000185', 'CCI-001991'] - tag nist: ['IA-5 (2) (b) (1)', 'IA-5 (2) (d)'] + tag nist: ['IA-5 (2) (a)', 'IA-5 (2) (b) (1)', 'IA-5 (2) (d)'] + tag 'host' + tag 'container' + + only_if('If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.', impact: 0.0) { + !input('smart_card_enabled') + } + + root_ca_file = input('root_ca_file') + describe file(root_ca_file) do + it { should exist } + end + + describe 'Ensure the RootCA is a DoD-issued certificate with a valid date' do + if file(root_ca_file).exist? + subject { x509_certificate(root_ca_file) } + it 'has the correct issuer_dn' do + expect(subject.issuer_dn).to match('/C=US/O=U.S. Government/OU=DoD/OU=PKI/CN=DoD Root CA 3') + end + it 'has the correct subject_dn' do + expect(subject.subject_dn).to match('/C=US/O=U.S. Government/OU=DoD/OU=PKI/CN=DoD Root CA 3') + end + it 'is valid' do + expect(subject.validity_in_days).to be > 0 + end + end + end end diff --git a/controls/SV-258132.rb b/controls/SV-258132.rb index 4eec6ea..3c5d2a7 100644 --- a/controls/SV-258132.rb +++ b/controls/SV-258132.rb @@ -23,14 +23,22 @@ $ sudo systemctl restart sssd.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61873r926381_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000068-GPOS-00036' tag gid: 'V-258132' tag rid: 'SV-258132r926383_rule' tag stig_id: 'RHEL-09-631015' - tag gtitle: 'SRG-OS-000068-GPOS-00036' tag fix_id: 'F-61797r926382_fix' - tag 'documentable' tag cci: ['CCI-000187'] - tag nist: ['IA-5 (2) (a) (2)'] + tag nist: ['IA-5 (2) (c)', 'IA-5 (2) (a) (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe file('/etc/sssd/sssd.conf') do + it { should exist } + its('content') { should match(/^\s*\[certmap.*\]\s*$/) } + end end diff --git a/controls/SV-258133.rb b/controls/SV-258133.rb index d10a274..cc37cde 100644 --- a/controls/SV-258133.rb +++ b/controls/SV-258133.rb @@ -27,14 +27,38 @@ offline_credentials_expiration = 1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61874r926384_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000383-GPOS-00166' tag gid: 'V-258133' tag rid: 'SV-258133r926386_rule' tag stig_id: 'RHEL-09-631020' - tag gtitle: 'SRG-OS-000383-GPOS-00166' tag fix_id: 'F-61798r926385_fix' - tag 'documentable' tag cci: ['CCI-002007'] tag nist: ['IA-5 (13)'] + tag 'host' + + sssd_config = parse_config_file('/etc/sssd/sssd.conf') + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('smart_card_enabled') + impact 0.0 + describe 'The system is not utilizing smart card authentication' do + skip 'The system is not utilizing smart card authentication, this control + is Not Applicable.' + end + else + describe.one do + describe 'Cache credentials enabled' do + subject { sssd_config.content } + it { should_not match(/cache_credentials\s*=\s*true/) } + end + describe 'Offline credentials expiration' do + subject { sssd_config } + its('pam.offline_credentials_expiration') { should cmp '1' } + end + end + end end diff --git a/controls/SV-258134.rb b/controls/SV-258134.rb index 800f264..9c6b652 100644 --- a/controls/SV-258134.rb +++ b/controls/SV-258134.rb @@ -1,8 +1,6 @@ control 'SV-258134' do title 'RHEL 9 must have the AIDE package installed.' - desc 'Without verification of the security functions, security functions may not operate correctly, and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. - -' + desc 'Without verification of the security functions, security functions may not operate correctly, and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters.' desc 'check', %q(Verify that RHEL 9 has the Advanced Intrusion Detection Environment (AIDE) package installed with the following command: $ sudo dnf list --installed aide @@ -75,8 +73,24 @@ tag stig_id: 'RHEL-09-651010' tag gtitle: 'SRG-OS-000363-GPOS-00150' tag fix_id: 'F-61799r926388_fix' - tag satisfies: ['SRG-OS-000363-GPOS-00150', 'SRG-OS-000445-GPOS-00199'] tag 'documentable' - tag cci: ['CCI-001744', 'CCI-002696'] - tag nist: ['CM-3 (5)', 'SI-6 a'] + tag cci: ['CCI-002696', 'CCI-001744'] + tag nist: ['SI-6 a', 'CM-3 (5)'] + tag 'host' + + file_integrity_tool = input('file_integrity_tool') + + only_if('Control not applicable within a container', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + if file_integrity_tool == 'aide' + describe command('/usr/sbin/aide --check') do + its('stdout') { should_not include "Couldn't open file" } + end + end + + describe package(file_integrity_tool) do + it { should be_installed } + end end diff --git a/controls/SV-258135.rb b/controls/SV-258135.rb index deafe91..21706fc 100644 --- a/controls/SV-258135.rb +++ b/controls/SV-258135.rb @@ -49,4 +49,31 @@ tag 'documentable' tag cci: ['CCI-001744', 'CCI-002699', 'CCI-002702'] tag nist: ['CM-3 (5)', 'SI-6 b', 'SI-6 d'] + tag 'host' + + file_integrity_tool = input('file_integrity_tool') + + only_if('Control not applicable within a container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe package(file_integrity_tool) do + it { should be_installed } + end + describe.one do + describe file("/etc/cron.daily/#{file_integrity_tool}") do + its('content') { should match %r{/bin/mail} } + end + describe file("/etc/cron.weekly/#{file_integrity_tool}") do + its('content') { should match %r{/bin/mail} } + end + describe crontab('root').where { command =~ /#{file_integrity_tool}/ } do + its('commands.flatten') { should include(match %r{/bin/mail}) } + end + if file("/etc/cron.d/#{file_integrity_tool}").exist? + describe crontab(path: "/etc/cron.d/#{file_integrity_tool}") do + its('commands') { should include(match %r{/bin/mail}) } + end + end + end end diff --git a/controls/SV-258136.rb b/controls/SV-258136.rb index 80ba903..5a6a2f0 100644 --- a/controls/SV-258136.rb +++ b/controls/SV-258136.rb @@ -25,4 +25,21 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + file_integrity_tool = input('file_integrity_tool') + + only_if('Control not applicable within a container', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + if file_integrity_tool == 'aide' + describe parse_config_file('/etc/aide.conf') do + its('ALL') { should match(/sha512/) } + end + else + describe 'Manual Review' do + skip "Review the selected file integrity tool (#{file_integrity_tool}) configuration to ensure it is using FIPS 140-2/140-3-approved cryptographic hashes for validating file contents and directories." + end + end end diff --git a/controls/SV-258137.rb b/controls/SV-258137.rb index a1b9859..d4f56f0 100644 --- a/controls/SV-258137.rb +++ b/controls/SV-258137.rb @@ -6,9 +6,7 @@ It is not uncommon for attackers to replace the audit tools or inject code into the existing tools to provide the capability to hide or erase system activity from the audit logs. -To address this risk, audit tools must be cryptographically signed to provide the capability to identify when the audit tools have been modified, manipulated, or replaced. An example is a checksum hash of the file or files. - -' +To address this risk, audit tools must be cryptographically signed to provide the capability to identify when the audit tools have been modified, manipulated, or replaced. An example is a checksum hash of the file or files.' desc 'check', 'Check that AIDE is properly configured to protect the integrity of the audit tools with the following command: $ sudo cat /etc/aide.conf | grep /usr/sbin/au @@ -18,7 +16,6 @@ /usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512 If AIDE is not installed, ask the system administrator (SA) how file integrity checks are performed on the system. @@ -31,19 +28,50 @@ /usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61878r926396_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000256-GPOS-00097' tag gid: 'V-258137' - tag rid: 'SV-258137r926398_rule' + tag rid: 'SV-258137r943021_rule' tag stig_id: 'RHEL-09-651025' - tag gtitle: 'SRG-OS-000256-GPOS-00097' - tag fix_id: 'F-61802r926397_fix' - tag satisfies: ['SRG-OS-000256-GPOS-00097', 'SRG-OS-000257-GPOS-00098', 'SRG-OS-000258-GPOS-00099', 'SRG-OS-000278-GPOS-00108'] - tag 'documentable' - tag cci: ['CCI-001493', 'CCI-001494', 'CCI-001495', 'CCI-001496'] - tag nist: ['AU-9 a', 'AU-9', 'AU-9', 'AU-9 (3)'] + tag fix_id: 'F-61802r943020_fix' + tag cci: ['CCI-001496', 'CCI-001493', 'CCI-001494', 'CCI-001495'] + tag nist: ['AU-9 (3)', 'AU-9 a', 'AU-9'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_tools = %w[/usr/sbin/auditctl + /usr/sbin/auditd + /usr/sbin/ausearch + /usr/sbin/aureport + /usr/sbin/autrace + /usr/sbin/rsyslogd + /usr/sbin/augenrules] + + if package('aide').installed? + audit_tools.each do |tool| + describe "selection_line: #{tool}" do + subject { aide_conf.where { selection_line.eql?(tool) } } + its('rules.flatten') { should include 'p' } + its('rules.flatten') { should include 'i' } + its('rules.flatten') { should include 'n' } + its('rules.flatten') { should include 'u' } + its('rules.flatten') { should include 'g' } + its('rules.flatten') { should include 's' } + its('rules.flatten') { should include 'b' } + its('rules.flatten') { should include 'acl' } + its('rules.flatten') { should include 'xattrs' } + its('rules.flatten') { should include 'sha512' } + end + end + else + describe 'The system is not utilizing Advanced Intrusion Detection Environment (AIDE)' do + skip 'The system is not utilizing Advanced Intrusion Detection Environment (AIDE), manual review is required.' + end + end end diff --git a/controls/SV-258138.rb b/controls/SV-258138.rb index 5b393c9..e4335af 100644 --- a/controls/SV-258138.rb +++ b/controls/SV-258138.rb @@ -15,14 +15,30 @@ If AIDE is installed, ensure the "acl" rule is present on all uncommented file and directory selection lists.' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61879r926399_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258138' tag rid: 'SV-258138r926401_rule' tag stig_id: 'RHEL-09-651030' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61803r926400_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe package('aide') do + it { should be_installed } + end + + findings = [] + aide_conf.where { !selection_line.start_with? '!' }.entries.each do |selection| + findings.append(selection.selection_line) unless selection.rules.include? 'acl' + end + + describe "List of monitored files/directories without 'acl' rule" do + subject { findings } + it { should be_empty } + end end diff --git a/controls/SV-258139.rb b/controls/SV-258139.rb index 3f41f79..369e2a0 100644 --- a/controls/SV-258139.rb +++ b/controls/SV-258139.rb @@ -10,19 +10,37 @@ All= p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux If the "xattrs" rule is not being used on all uncommented selection lines in the "/etc/aide.conf" file, or extended attributes are not being checked by another file integrity tool, this is a finding.' - desc 'fix', 'Configure the file integrity tool to check file and directory extended attributes. + desc 'fix', 'Configure the file integrity tool to check file and directory extended +attributes. -If AIDE is installed, ensure the "xattrs" rule is present on all uncommented file and directory selection lists.' + If AIDE is installed, ensure the "xattrs" rule is present on all +uncommented file and directory selection lists.' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61880r926402_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258139' tag rid: 'SV-258139r926404_rule' tag stig_id: 'RHEL-09-651035' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61804r926403_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe package('aide') do + it { should be_installed } + end + + findings = [] + aide_conf.where { !selection_line.start_with? '!' }.entries.each do |selection| + findings.append(selection.selection_line) unless selection.rules.include? 'xattrs' + end + + describe "List of monitored files/directories without 'xattrs' rule" do + subject { findings } + it { should be_empty } + end end diff --git a/controls/SV-258140.rb b/controls/SV-258140.rb index 42dbc82..d450ec8 100644 --- a/controls/SV-258140.rb +++ b/controls/SV-258140.rb @@ -1,8 +1,6 @@ control 'SV-258140' do title 'RHEL 9 must have the rsyslog package installed.' - desc 'rsyslogd is a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Couple this utility with "gnutls" (which is a secure communications library implementing the SSL, TLS, and DTLS protocols), to create a method to securely encrypt and offload auditing. - -' + desc 'rsyslogd is a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Couple this utility with "gnutls" (which is a secure communications library implementing the SSL, TLS, and DTLS protocols), to create a method to securely encrypt and offload auditing.' desc 'check', 'Verify that RHEL 9 has the rsyslogd package installed with the following command: $ sudo dnf list --installed rsyslog @@ -17,15 +15,27 @@ $ sudo dnf install rsyslogd' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61881r926405_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000479-GPOS-00224' tag gid: 'V-258140' tag rid: 'SV-258140r926407_rule' tag stig_id: 'RHEL-09-652010' - tag gtitle: 'SRG-OS-000479-GPOS-00224' tag fix_id: 'F-61805r926406_fix' - tag satisfies: ['SRG-OS-000479-GPOS-00224', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000154', 'CCI-000366', 'CCI-001851'] - tag nist: ['AU-6 (4)', 'CM-6 b', 'AU-4 (1)'] + tag cci: ['CCI-000366', 'CCI-000154', 'CCI-001851'] + tag nist: ['CM-6 b', 'AU-6 (4)', 'AU-4 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternative_logging_method') != '' + describe 'manual check' do + skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.' + end + else + describe package('rsyslog') do + it { should be_installed } + end + end end diff --git a/controls/SV-258141.rb b/controls/SV-258141.rb index e1afbd0..d35aa75 100644 --- a/controls/SV-258141.rb +++ b/controls/SV-258141.rb @@ -1,8 +1,6 @@ control 'SV-258141' do title 'RHEL 9 must have the packages required for encrypting offloaded audit logs installed.' - desc 'The rsyslog-gnutls package provides Transport Layer Security (TLS) support for the rsyslog daemon, which enables secure remote logging. - -' + desc 'The rsyslog-gnutls package provides Transport Layer Security (TLS) support for the rsyslog daemon, which enables secure remote logging.' desc 'check', 'Verify that RHEL 9 has the rsyslog-gnutls package installed with the following command: $ sudo dnf list --installed rsyslog-gnutls @@ -17,15 +15,27 @@ $ sudo dnf install rsyslog-gnutls' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61882r926408_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258141' tag rid: 'SV-258141r926410_rule' tag stig_id: 'RHEL-09-652015' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61806r926409_fix' - tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000120-GPOS-00061'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-000803'] tag nist: ['CM-6 b', 'IA-7'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternative_logging_method') != '' + describe 'manual check' do + skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.' + end + else + describe package('rsyslog-gnutls') do + it { should be_installed } + end + end end diff --git a/controls/SV-258142.rb b/controls/SV-258142.rb index 2f15ea8..1aa2209 100644 --- a/controls/SV-258142.rb +++ b/controls/SV-258142.rb @@ -13,14 +13,22 @@ $ sudo systemctl enable --now rsyslog' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61883r926411_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258142' tag rid: 'SV-258142r926413_rule' tag stig_id: 'RHEL-09-652020' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61807r926412_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe service('rsyslog') do + it { should be_enabled } + it { should be_running } + end end diff --git a/controls/SV-258143.rb b/controls/SV-258143.rb index 311b4e9..3a4e86b 100644 --- a/controls/SV-258143.rb +++ b/controls/SV-258143.rb @@ -42,4 +42,21 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host', 'container' + + if input('log_aggregator') + describe 'N/A' do + skip 'This control is NA because the system is a log aggregation server.' + end + else + modload = command('grep -i modload /etc/rsyslog.conf /etc/rsyslog.d/*').stdout.strip.split + serverrun = command('grep -i serverrun /etc/rsyslog.conf /etc/rsyslog.d/*').stdout.strip.split + + describe 'Rsyslog config' do + it 'should not accept remote logs' do + expect(modload).to be_empty, "ModLoad settings found:\n\t- #{modload.join("\n\t- ")}" + expect(serverrun).to be_empty, "ServerRun settings found:\n\t- #{serverrun.join("\n\t- ")}" + end + end + end end diff --git a/controls/SV-258144.rb b/controls/SV-258144.rb index e9bbc09..c4133ce 100644 --- a/controls/SV-258144.rb +++ b/controls/SV-258144.rb @@ -19,14 +19,45 @@ $ sudo systemctl restart rsyslog.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61885r926417_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000032-GPOS-00013' tag gid: 'V-258144' tag rid: 'SV-258144r926419_rule' tag stig_id: 'RHEL-09-652030' - tag gtitle: 'SRG-OS-000032-GPOS-00013' tag fix_id: 'F-61809r926418_fix' - tag 'documentable' tag cci: ['CCI-000067'] tag nist: ['AC-17 (1)'] + tag 'host' + tag 'container-conditional' + + only_if('Control not applicable; remote access not configured within containerized RHEL', impact: 0.0) { + !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?) + } + + rsyslog = file('/etc/rsyslog.conf') + + describe rsyslog do + it { should exist } + end + + if rsyslog.exist? + + auth_pattern = %r{^\s*[a-z.;*]*auth(,[a-z,]+)*\.\*\s*/*} + authpriv_pattern = %r{^\s*[a-z.;*]*authpriv(,[a-z,]+)*\.\*\s*/*} + daemon_pattern = %r{^\s*[a-z.;*]*daemon(,[a-z,]+)*\.\*\s*/*} + + rsyslog_conf = command('grep -E \'(auth.*|authpriv.*|daemon.*)\' /etc/rsyslog.conf') + + describe 'Logged remote access methods' do + it 'should include auth.*' do + expect(rsyslog_conf.stdout).to match(auth_pattern), 'auth.* not configured for logging' + end + it 'should include authpriv.*' do + expect(rsyslog_conf.stdout).to match(authpriv_pattern), 'authpriv.* not configured for logging' + end + it 'should include daemon.*' do + expect(rsyslog_conf.stdout).to match(daemon_pattern), 'daemon.* not configured for logging' + end + end + end end diff --git a/controls/SV-258145.rb b/controls/SV-258145.rb index 33515cd..218ea44 100644 --- a/controls/SV-258145.rb +++ b/controls/SV-258145.rb @@ -28,4 +28,9 @@ tag 'documentable' tag cci: ['CCI-001851'] tag nist: ['AU-4 (1)'] + tag 'host' + + describe parse_config_file('/etc/audit/plugins.d/syslog.conf') do + its('active') { should cmp 'yes' } + end end diff --git a/controls/SV-258146.rb b/controls/SV-258146.rb index 109883d..9e1cf90 100644 --- a/controls/SV-258146.rb +++ b/controls/SV-258146.rb @@ -10,9 +10,7 @@ anon - anonymous authentication x509/fingerprint - certificate fingerprint authentication x509/certvalid - certificate validation only -x509/name - certificate validation and subject name authentication - -' +x509/name - certificate validation and subject name authentication' desc 'check', %q(Verify RHEL 9 authenticates the remote logging server for offloading audit logs with the following command: $ sudo grep -i '$ActionSendStreamDriverAuthMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf @@ -27,15 +25,31 @@ $ActionSendStreamDriverAuthMode x509/name' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61887r926423_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000342-GPOS-00133' + tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224'] tag gid: 'V-258146' tag rid: 'SV-258146r926425_rule' tag stig_id: 'RHEL-09-652040' - tag gtitle: 'SRG-OS-000342-GPOS-00133' tag fix_id: 'F-61811r926424_fix' - tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224'] - tag 'documentable' tag cci: ['CCI-001851'] tag nist: ['AU-4 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternative_logging_method') != '' + describe 'manual check' do + skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.' + end + else + describe 'rsyslog configuration' do + subject { + command("grep -i '^\$ActionSendStreamDriverAuthMode' #{input('logging_conf_files').join(' ')} | awk -F ':' '{ print $2 }'").stdout + } + it { should match %r{\$ActionSendStreamDriverAuthMode\s+x509/name} } + end + end end diff --git a/controls/SV-258147.rb b/controls/SV-258147.rb index f88bee7..5a9848b 100644 --- a/controls/SV-258147.rb +++ b/controls/SV-258147.rb @@ -10,9 +10,7 @@ anon - anonymous authentication x509/fingerprint - certificate fingerprint authentication x509/certvalid - certificate validation only -x509/name - certificate validation and subject name authentication - -' +x509/name - certificate validation and subject name authentication' desc 'check', %q(Verify RHEL 9 encrypts audit records offloaded onto a different system or media from the system being audited via rsyslog with the following command: $ sudo grep -i '$ActionSendStreamDriverMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf @@ -25,15 +23,38 @@ $ActionSendStreamDriverMode 1' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61888r926426_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000342-GPOS-00133' + tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224'] tag gid: 'V-258147' tag rid: 'SV-258147r926428_rule' tag stig_id: 'RHEL-09-652045' - tag gtitle: 'SRG-OS-000342-GPOS-00133' tag fix_id: 'F-61812r926427_fix' - tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224'] - tag 'documentable' tag cci: ['CCI-001851'] tag nist: ['AU-4 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternative_logging_method') != '' + describe 'manual check' do + skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.' + end + else + describe 'rsyslog configuration' do + subject { + command("grep -i '^\$DefaultNetstreamDriver' #{input('logging_conf_files').join(' ')} | awk -F ':' '{ print $2 }'").stdout + } + it { should match(/\$DefaultNetstreamDriver\s+gtls/) } + end + + describe 'rsyslog configuration' do + subject { + command("grep -i '^\$ActionSendStreamDriverMode' #{input('logging_conf_files').join(' ')} | awk -F ':' '{ print $2 }'").stdout + } + it { should match(/\$ActionSendStreamDriverMode\s+1/) } + end + end end diff --git a/controls/SV-258148.rb b/controls/SV-258148.rb index da68e44..74feb77 100644 --- a/controls/SV-258148.rb +++ b/controls/SV-258148.rb @@ -30,4 +30,34 @@ tag 'documentable' tag cci: ['CCI-001851'] tag nist: ['AU-4 (1)'] + tag 'host', 'container' + + setting = 'DefaultNetstreamDriver' + expected_value = 'gtls' + + pattern = /[^#]\$#{setting}\s*(?\w+)$/ + setting_check = command("grep -i #{setting} /etc/rsyslog.conf /etc/rsyslog.d/*.conf").stdout.strip.scan(pattern).flatten + + describe 'Rsyslogd DefaultNetstreamDriver' do + if setting_check.empty? + it 'should be set' do + expect(setting_check).to_not be_empty, "'#{setting}' not found (or commented out) in conf file(s)" + end + else + it 'should only be set once' do + expect(setting_check.length).to eq(1), "'#{setting}' set more than once in conf file(s)" + end + it "should be set to '#{expected_value}'" do + expect(setting_check.first).to eq(expected_value), "'#{setting}' set to '#{setting_check.first}' in conf file(s)" + end + end + end + + # netstream_driver = command('grep -i $DefaultNetstreamDriver /etc/rsyslog.conf /etc/rsyslog.d/*').stdout.strip + + # describe "Rsyslog config" do + # it "should encrypt audit records for transfer" do + # expect(modload).to be_empty, "ModLoad settings found:\n\t- #{modload.join("\n\t- ")}" + # end + # end end diff --git a/controls/SV-258149.rb b/controls/SV-258149.rb index a7984d4..3d95cd3 100644 --- a/controls/SV-258149.rb +++ b/controls/SV-258149.rb @@ -12,9 +12,7 @@ UDP *.* @remotesystemname TCP *.* @@remotesystemname RELP *.* :omrelp:remotesystemname:2514 -Note that a port number was given as there is no standard port for RELP. - -' +Note that a port number was given as there is no standard port for RELP.' desc 'check', 'Verify that RHEL 9 audit system offloads audit records onto a different system or media from the system being audited via rsyslog using TCP with the following command: $ sudo grep @@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf @@ -29,15 +27,28 @@ *.* @@[remoteloggingserver]:[port]"' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61890r926432_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000479-GPOS-00224' + tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224', 'SRG-OS-000480-GPOS-00227'] tag gid: 'V-258149' tag rid: 'SV-258149r926434_rule' tag stig_id: 'RHEL-09-652055' - tag gtitle: 'SRG-OS-000479-GPOS-00224' tag fix_id: 'F-61814r926433_fix' - tag satisfies: ['SRG-OS-000479-GPOS-00224', 'SRG-OS-000480-GPOS-00227', 'SRG-OS-000342-GPOS-00133'] - tag 'documentable' - tag cci: ['CCI-000366', 'CCI-001851'] - tag nist: ['CM-6 b', 'AU-4 (1)'] + tag cci: ['CCI-001851', 'CCI-000366'] + tag nist: ['AU-4 (1)', 'CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternative_logging_method') != '' + describe 'manual check' do + skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.' + end + else + describe command("grep @@ #{input('logging_conf_files').join(' ')}") do + its('stdout') { should match(/^[^#]*:\*\.\*\s*@@[a-z.0-9]*:?[0-9]*?/) } + end + end end diff --git a/controls/SV-258150.rb b/controls/SV-258150.rb index 5c478e5..12b9011 100644 --- a/controls/SV-258150.rb +++ b/controls/SV-258150.rb @@ -1,6 +1,8 @@ control 'SV-258150' do title 'RHEL 9 must use cron logging.' - desc 'Cron logging can be used to trace the successful or unsuccessful execution of cron jobs. It can also be used to spot intrusions into the use of the cron facility by unauthorized and malicious users.' + desc 'Cron logging can be used to trace the successful or unsuccessful +execution of cron jobs. It can also be used to spot intrusions into the use of +the cron facility by unauthorized and malicious users.' desc 'check', 'Verify that "rsyslog" is configured to log cron events with the following command: Note: If another logging package is used, substitute the utility configuration file for "/etc/rsyslog.conf" or "/etc/rsyslog.d/*.conf" files. @@ -17,23 +19,35 @@ /etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none /var/log/messages If "rsyslog" is not logging messages for the cron facility or all facilities, this is a finding.' - desc 'fix', 'Configure "rsyslog" to log all cron messages by adding or updating the following line to "/etc/rsyslog.conf" or a configuration file in the /etc/rsyslog.d/ directory: + desc 'fix', 'Configure "rsyslog" to log all cron messages by adding or updating the +following line to "/etc/rsyslog.conf" or a configuration file in the +/etc/rsyslog.d/ directory: -cron.* /var/log/cron + cron.* /var/log/cron -The rsyslog daemon must be restarted for the changes to take effect: - -$ sudo systemctl restart rsyslog.service' + The rsyslog daemon must be restarted for the changes to take effect: + $ sudo systemctl restart rsyslog.service' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61891r926435_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000480-GPOS-00227' tag gid: 'V-258150' tag rid: 'SV-258150r926437_rule' tag stig_id: 'RHEL-09-652060' - tag gtitle: 'SRG-OS-000480-GPOS-00227' tag fix_id: 'F-61815r926436_fix' - tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe.one do + describe command("grep -hsv \"^#\" #{input('logging_conf_files').join(' ')} | grep ^cron") do + its('stdout') { should match %r{cron\.\*\s*/var/log/cron} } + end + describe command("grep -hsv \"^#\" #{input('logging_conf_files').join(' ')} | grep /var/log/messages") do + its('stdout') { should match %r{\*.info;mail.none;authpriv.none;cron.none\s*/var/log/messages} } + end + end end diff --git a/controls/SV-258151.rb b/controls/SV-258151.rb index 18215eb..a6f07da 100644 --- a/controls/SV-258151.rb +++ b/controls/SV-258151.rb @@ -4,9 +4,7 @@ Audit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. -Associating event types with detected events in audit logs provides a means of investigating an attack, recognizing resource utilization or capacity thresholds, or identifying an improperly configured RHEL 9 system. - -' +Associating event types with detected events in audit logs provides a means of investigating an attack, recognizing resource utilization or capacity thresholds, or identifying an improperly configured RHEL 9 system.' desc 'check', 'Verify that RHEL 9 audit service package is installed. Check that the audit service package is installed with the following command: @@ -23,15 +21,22 @@ $ sudo dnf install audit' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61892r926438_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000062-GPOS-00031' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000254-GPOS-00095', 'SRG-OS-000255-GPOS-00096', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000358-GPOS-00145', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000475-GPOS-00220', 'SRG-OS-000055-GPOS-00026'] tag gid: 'V-258151' tag rid: 'SV-258151r926440_rule' tag stig_id: 'RHEL-09-653010' - tag gtitle: 'SRG-OS-000062-GPOS-00031' tag fix_id: 'F-61816r926439_fix' - tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000254-GPOS-00095', 'SRG-OS-000255-GPOS-00096', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000358-GPOS-00145', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000475-GPOS-00220', 'SRG-OS-000055-GPOS-00026'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000131', 'CCI-000132', 'CCI-000133', 'CCI-000134', 'CCI-000135', 'CCI-000154', 'CCI-000158', 'CCI-000159', 'CCI-000169', 'CCI-000172', 'CCI-001464', 'CCI-001487', 'CCI-001814', 'CCI-001875', 'CCI-001876', 'CCI-001877', 'CCI-001878', 'CCI-001879', 'CCI-001880', 'CCI-001881', 'CCI-001882', 'CCI-001889', 'CCI-001914', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 b', 'AU-3 c', 'AU-3 d', 'AU-3 e', 'AU-3 (1)', 'AU-6 (4)', 'AU-7 (1)', 'AU-8 a', 'AU-12 a', 'AU-12 c', 'AU-14 (1)', 'AU-3 f', 'CM-5 (1)', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 b', 'AU-7 b', 'AU-8 b', 'AU-12 (3)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000131', 'CCI-000132', 'CCI-000133', 'CCI-000134', 'CCI-000135', 'CCI-000154', 'CCI-000158', 'CCI-000159', 'CCI-000172', 'CCI-001464', 'CCI-001487', 'CCI-001814', 'CCI-001875', 'CCI-001876', 'CCI-001877', 'CCI-001878', 'CCI-001879', 'CCI-001880', 'CCI-001881', 'CCI-001882', 'CCI-001889', 'CCI-001914', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 b', 'AU-3 c', 'AU-3 d', 'AU-3 e', 'AU-3 (1)', 'AU-6 (4)', 'AU-7 (1)', 'AU-8 a', 'AU-12 c', 'AU-14 (1)', 'AU-3 f', 'CM-5 (1)', 'AU-7 a', 'AU-7 b', 'AU-8 b', 'AU-12 (3)', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe package('audit') do + it { should be_installed } + end end diff --git a/controls/SV-258152.rb b/controls/SV-258152.rb index 2c2a097..981dac5 100644 --- a/controls/SV-258152.rb +++ b/controls/SV-258152.rb @@ -2,9 +2,7 @@ title 'RHEL 9 audit service must be enabled.' desc 'Without establishing what type of events occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. Ensuring the "auditd" service is active ensures audit records generated by the kernel are appropriately recorded. -Additionally, a properly configured audit subsystem ensures that actions of individual system users can be uniquely traced to those users so they can be held accountable for their actions. - -' +Additionally, a properly configured audit subsystem ensures that actions of individual system users can be uniquely traced to those users so they can be held accountable for their actions.' desc 'check', 'Verify the audit service is configured to produce audit records with the following command: $ systemctl status auditd.service @@ -19,15 +17,23 @@ $ sudo systemctl enable --now auditd' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61893r926441_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000062-GPOS-00031' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000254-GPOS-00095', 'SRG-OS-000255-GPOS-00096', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000358-GPOS-00145', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000475-GPOS-00220'] tag gid: 'V-258152' tag rid: 'SV-258152r926443_rule' tag stig_id: 'RHEL-09-653015' - tag gtitle: 'SRG-OS-000062-GPOS-00031' tag fix_id: 'F-61817r926442_fix' - tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000254-GPOS-00095', 'SRG-OS-000255-GPOS-00096', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000358-GPOS-00145', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000475-GPOS-00220'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000131', 'CCI-000132', 'CCI-000133', 'CCI-000134', 'CCI-000135', 'CCI-000154', 'CCI-000158', 'CCI-000169', 'CCI-000172', 'CCI-001464', 'CCI-001487', 'CCI-001814', 'CCI-001875', 'CCI-001876', 'CCI-001877', 'CCI-001878', 'CCI-001879', 'CCI-001880', 'CCI-001881', 'CCI-001882', 'CCI-001889', 'CCI-001914', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 b', 'AU-3 c', 'AU-3 d', 'AU-3 e', 'AU-3 (1)', 'AU-6 (4)', 'AU-7 (1)', 'AU-12 a', 'AU-12 c', 'AU-14 (1)', 'AU-3 f', 'CM-5 (1)', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 b', 'AU-7 b', 'AU-8 b', 'AU-12 (3)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000131', 'CCI-000132', 'CCI-000133', 'CCI-000134', 'CCI-000135', 'CCI-000154', 'CCI-000158', 'CCI-000172', 'CCI-001464', 'CCI-001487', 'CCI-001814', 'CCI-001875', 'CCI-001876', 'CCI-001877', 'CCI-001878', 'CCI-001879', 'CCI-001880', 'CCI-001881', 'CCI-001882', 'CCI-001889', 'CCI-001914', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 b', 'AU-3 c', 'AU-3 d', 'AU-3 e', 'AU-3 (1)', 'AU-6 (4)', 'AU-7 (1)', 'AU-12 c', 'AU-14 (1)', 'AU-3 f', 'CM-5 (1)', 'AU-7 a', 'AU-7 b', 'AU-8 b', 'AU-12 (3)', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe service('auditd') do + it { should be_enabled } + it { should be_running } + end end diff --git a/controls/SV-258153.rb b/controls/SV-258153.rb index 5781a0a..beb4507 100644 --- a/controls/SV-258153.rb +++ b/controls/SV-258153.rb @@ -19,14 +19,23 @@ If availability has been determined to be more important, and this decision is documented with the information system security officer (ISSO), configure the operating system to notify SA staff and ISSO staff in the event of an audit processing failure by setting the "disk_error_action" to "SYSLOG".' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61894r926444_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000047-GPOS-00023' tag gid: 'V-258153' tag rid: 'SV-258153r926446_rule' tag stig_id: 'RHEL-09-653020' - tag gtitle: 'SRG-OS-000047-GPOS-00023' tag fix_id: 'F-61818r926445_fix' - tag 'documentable' tag cci: ['CCI-000140'] tag nist: ['AU-5 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + disk_error_action = input('disk_error_action').map(&:upcase) + + describe auditd_conf do + its('disk_error_action.upcase') { should be_in disk_error_action } + end end diff --git a/controls/SV-258154.rb b/controls/SV-258154.rb index 91c606d..2817ec7 100644 --- a/controls/SV-258154.rb +++ b/controls/SV-258154.rb @@ -19,14 +19,23 @@ If availability has been determined to be more important, and this decision is documented with the information system security officer (ISSO), configure the operating system to notify SA staff and ISSO staff in the event of an audit processing failure by setting the "disk_full_action" to "SYSLOG".' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61895r926447_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000047-GPOS-00023' tag gid: 'V-258154' tag rid: 'SV-258154r926449_rule' tag stig_id: 'RHEL-09-653025' - tag gtitle: 'SRG-OS-000047-GPOS-00023' tag fix_id: 'F-61819r926448_fix' - tag 'documentable' tag cci: ['CCI-000140'] tag nist: ['AU-5 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + disk_full_action = input('disk_full_action').map(&:upcase) + + describe auditd_conf do + its('disk_full_action.upcase') { should be_in disk_full_action } + end end diff --git a/controls/SV-258155.rb b/controls/SV-258155.rb index 9bcf80f..ea91e9f 100644 --- a/controls/SV-258155.rb +++ b/controls/SV-258155.rb @@ -2,9 +2,7 @@ title "RHEL 9 must allocate audit record storage capacity to store at least one week's worth of audit records." desc 'To ensure RHEL 9 systems have a sufficient storage capacity in which to write the audit logs, RHEL 9 needs to be able to allocate audit record storage capacity. -The task of allocating audit record storage capacity is usually performed during initial installation of RHEL 9. - -' +The task of allocating audit record storage capacity is usually performed during initial installation of RHEL 9.' desc 'check', 'Verify RHEL 9 allocates audit record storage capacity to store at least one week of audit records when audit records are not immediately sent to a central audit record storage facility. Note: The partition size needed to capture a week of audit records is based on the activity level of the system and the total storage capacity available. Typically 10.0 GB of storage space for audit records should be sufficient. @@ -20,22 +18,49 @@ /dev/sda2 24G 10.4G 13.6G 43% /var/log/audit If the audit record partition is not allocated for sufficient storage capacity, this is a finding.' - desc 'fix', 'Allocate enough storage capacity for at least one week of audit records when audit records are not immediately sent to a central audit record storage facility. + desc 'fix', 'Allocate enough storage capacity for at least one week of audit records +when audit records are not immediately sent to a central audit record storage +facility. -If audit records are stored on a partition made specifically for audit records, resize the partition with sufficient space to contain one week of audit records. + If audit records are stored on a partition made specifically for audit +records, resize the partition with sufficient space to contain one week of +audit records. -If audit records are not stored on a partition made specifically for audit records, a new partition with sufficient space will need be to be created.' + If audit records are not stored on a partition made specifically for audit +records, a new partition with sufficient space will need be to be created.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61896r926450_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000341-GPOS-00132' tag gid: 'V-258155' tag rid: 'SV-258155r926452_rule' tag stig_id: 'RHEL-09-653030' - tag gtitle: 'SRG-OS-000341-GPOS-00132' tag fix_id: 'F-61820r926451_fix' - tag satisfies: ['SRG-OS-000341-GPOS-00132', 'SRG-OS-000342-GPOS-00133'] - tag 'documentable' tag cci: ['CCI-001849', 'CCI-001851'] tag nist: ['AU-4', 'AU-4 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_log_dir = command("dirname #{auditd_conf.log_file}").stdout.strip + + describe file(audit_log_dir) do + it { should exist } + it { should be_directory } + end + + # Fetch partition sizes in 1K blocks for consistency + partition_info = command("df -B 1K #{audit_log_dir}").stdout.split("\n") + partition_sz_arr = partition_info.last.gsub(/\s+/m, ' ').strip.split(' ') + + # Get unused space percentage + percentage_space_unused = (100 - partition_sz_arr[4].to_i) + + describe "auditd_conf's space_left threshold" do + it 'should be under the amount of space currently available (in 1K blocks) for the audit log directory' do + expect(auditd_conf.space_left.to_i).to be <= percentage_space_unused + end + end end diff --git a/controls/SV-258156.rb b/controls/SV-258156.rb index 4fd28c3..4560165 100644 --- a/controls/SV-258156.rb +++ b/controls/SV-258156.rb @@ -1,6 +1,8 @@ control 'SV-258156' do title 'RHEL 9 must take action when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity.' - desc 'If security personnel are not notified immediately when storage volume reaches 75 percent utilization, they are unable to plan for audit record storage capacity expansion.' + desc 'If security personnel are not notified immediately when storage volume + reaches 75 percent utilization, they are unable to plan for audit record + storage capacity expansion.' desc 'check', 'Verify RHEL 9 takes action when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity with the following command: $ sudo grep -w space_left /etc/audit/auditd.conf @@ -13,14 +15,27 @@ space_left = 25%' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61897r926453_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000343-GPOS-00134' tag gid: 'V-258156' tag rid: 'SV-258156r926455_rule' tag stig_id: 'RHEL-09-653035' - tag gtitle: 'SRG-OS-000343-GPOS-00134' tag fix_id: 'F-61821r926454_fix' - tag 'documentable' tag cci: ['CCI-001855'] tag nist: ['AU-5 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternative_logging_method') != '' + describe 'manual check' do + skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.' + end + else + describe auditd_conf do + its('space_left.to_i') { should cmp >= input('audit_storage_threshold') } + end + end end diff --git a/controls/SV-258157.rb b/controls/SV-258157.rb index 320e7f7..51d72ae 100644 --- a/controls/SV-258157.rb +++ b/controls/SV-258157.rb @@ -1,6 +1,8 @@ control 'SV-258157' do title 'RHEL 9 must notify the system administrator (SA) and information system security officer (ISSO) (at a minimum) when allocated audit record storage volume 75 percent utilization.' - desc 'If security personnel are not notified immediately when storage volume reaches 75 percent utilization, they are unable to plan for audit record storage capacity expansion.' + desc 'If security personnel are not notified immediately when storage volume +reaches 75 percent utilization, they are unable to plan for audit record +storage capacity expansion.' desc 'check', 'Verify RHEL 9 notifies the SA and ISSO (at a minimum) when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity with the following command: $ sudo grep -w space_left_action /etc/audit/auditd.conf @@ -15,14 +17,23 @@ space_left_action = email' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61898r926456_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000343-GPOS-00134' tag gid: 'V-258157' tag rid: 'SV-258157r926458_rule' tag stig_id: 'RHEL-09-653040' - tag gtitle: 'SRG-OS-000343-GPOS-00134' tag fix_id: 'F-61822r926457_fix' - tag 'documentable' tag cci: ['CCI-001855'] tag nist: ['AU-5 (1)'] + tag 'host' + + alert_method = input('alert_method') + + only_if('This requirement is Not Applicable in the container', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe auditd_conf do + its('space_left_action.downcase') { should cmp alert_method } + end end diff --git a/controls/SV-258158.rb b/controls/SV-258158.rb index f9db991..a31b27c 100644 --- a/controls/SV-258158.rb +++ b/controls/SV-258158.rb @@ -23,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-001855'] tag nist: ['AU-5 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + admin_space_left = input('admin_space_left') + + describe auditd_conf do + its('admin_space_left') { should cmp admin_space_left } + end end diff --git a/controls/SV-258159.rb b/controls/SV-258159.rb index fd657c2..ae204f3 100644 --- a/controls/SV-258159.rb +++ b/controls/SV-258159.rb @@ -29,4 +29,15 @@ tag 'documentable' tag cci: ['CCI-001855'] tag nist: ['AU-5 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + admin_space_left_action = input('admin_space_left_action').upcase + + describe auditd_conf do + its('admin_space_left_action.upcase') { should cmp admin_space_left_action } + end end diff --git a/controls/SV-258160.rb b/controls/SV-258160.rb index 0f331cd..ed27770 100644 --- a/controls/SV-258160.rb +++ b/controls/SV-258160.rb @@ -25,4 +25,17 @@ tag 'documentable' tag cci: ['CCI-000140'] tag nist: ['AU-5 b'] + tag 'host' + + # TODO: should probably make all audit conf inputs into one hash for ease of use + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + max_log_file_action = input('max_log_file_action').upcase + + describe auditd_conf do + its('max_log_file_action.upcase') { should cmp max_log_file_action } + end end diff --git a/controls/SV-258161.rb b/controls/SV-258161.rb index c1105de..1ad475b 100644 --- a/controls/SV-258161.rb +++ b/controls/SV-258161.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must label all offloaded audit logs before sending them to the central log server.' desc 'Enriched logging is needed to determine who, what, and when events occur on a system. Without this, determining root cause of an event will be much more difficult. -When audit logs are not labeled before they are sent to a central log server, the audit data will not be able to be analyzed and tied back to the correct system. - -' +When audit logs are not labeled before they are sent to a central log server, the audit data will not be able to be analyzed and tied back to the correct system.' desc 'check', 'Verify that RHEL 9 Audit Daemon is configured to label all offloaded audit logs, with the following command: $ sudo grep name_format /etc/audit/auditd.conf @@ -12,22 +10,28 @@ name_format = hostname If the "name_format" option is not "hostname", "fqd", or "numeric", or the line is commented out, this is a finding.' - desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the "name_format" option: + desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the "name_format" +option: -name_format = hostname + name_format = hostname -The audit daemon must be restarted for changes to take effect.' + The audit daemon must be restarted for changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61902r926468_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000039-GPOS-00017' tag gid: 'V-258161' tag rid: 'SV-258161r926470_rule' tag stig_id: 'RHEL-09-653060' - tag gtitle: 'SRG-OS-000039-GPOS-00017' tag fix_id: 'F-61826r926469_fix' - tag satisfies: ['SRG-OS-000039-GPOS-00017', 'SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224'] - tag 'documentable' - tag cci: ['CCI-000132', 'CCI-001851'] - tag nist: ['AU-3 c', 'AU-4 (1)'] + tag cci: ['CCI-001851', 'CCI-000132'] + tag nist: ['AU-4 (1)', 'AU-3 c'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe parse_config_file('/etc/audit/auditd.conf') do + its('name_format') { should match(/^hostname$|^fqd$|^numeric$/i) } + end end diff --git a/controls/SV-258162.rb b/controls/SV-258162.rb index de07be4..b48d49e 100644 --- a/controls/SV-258162.rb +++ b/controls/SV-258162.rb @@ -2,9 +2,7 @@ title 'RHEL 9 must take appropriate action when the internal event queue is full.' desc 'The audit system should have an action setup in the event the internal event queue becomes full so that no data is lost. Information stored in one location is vulnerable to accidental or incidental deletion or alteration. -Offloading is a common process in information systems with limited audit storage capacity. - -' +Offloading is a common process in information systems with limited audit storage capacity.' desc 'check', 'Verify that RHEL 9 audit system is configured to take an appropriate action when the internal event queue is full: $ sudo grep -i overflow_action /etc/audit/auditd.conf @@ -14,22 +12,36 @@ If the value of the "overflow_action" option is not set to "syslog", "single", "halt" or the line is commented out, ask the system administrator (SA) to indicate how the audit logs are offloaded to a different system or media. If there is no evidence that the transfer of the audit logs being offloaded to another system or media takes appropriate action if the internal event queue becomes full, this is a finding.' - desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the "overflow_action" option: + desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the +"overflow_action" option: -overflow_action = syslog + overflow_action = syslog -The audit daemon must be restarted for changes to take effect.' + The audit daemon must be restarted for changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61903r926471_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000342-GPOS-00133' + tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224'] tag gid: 'V-258162' tag rid: 'SV-258162r926473_rule' tag stig_id: 'RHEL-09-653065' - tag gtitle: 'SRG-OS-000342-GPOS-00133' tag fix_id: 'F-61827r926472_fix' - tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224'] - tag 'documentable' tag cci: ['CCI-001851'] tag nist: ['AU-4 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + if input('alternative_logging_method') != '' + describe 'manual check' do + skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.' + end + else + describe parse_config_file('/etc/audit/auditd.conf') do + its('overflow_action') { should match(/syslog$|single$|halt$/i) } + end + end end diff --git a/controls/SV-258163.rb b/controls/SV-258163.rb index 5f9feaa..151ebe3 100644 --- a/controls/SV-258163.rb +++ b/controls/SV-258163.rb @@ -1,12 +1,18 @@ control 'SV-258163' do title 'RHEL 9 System Administrator (SA) and/or information system security officer (ISSO) (at a minimum) must be alerted of an audit processing failure event.' - desc 'It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. - -Audit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded. - -This requirement applies to each audit data storage repository (i.e., distinct information system component where audit records are stored), the centralized audit storage capacity of organizations (i.e., all audit data storage repositories combined), or both. - -' + desc 'It is critical for the appropriate personnel to be aware if a system +is at risk of failing to process audit logs as required. Without this +notification, the security personnel may be unaware of an impending failure of +the audit capability, and system operation may be adversely affected. + + Audit processing failures include software/hardware errors, failures in the +audit capturing mechanisms, and audit storage capacity being reached or +exceeded. + + This requirement applies to each audit data storage repository (i.e., +distinct information system component where audit records are stored), the +centralized audit storage capacity of organizations (i.e., all audit data +storage repositories combined), or both.' desc 'check', 'Verify that RHEL 9 is configured to notify the SA and/or ISSO (at a minimum) in the event of an audit processing failure with the following command: $ sudo grep action_mail_acct /etc/audit/auditd.conf @@ -23,15 +29,20 @@ The audit daemon must be restarted for changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61904r926474_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000046-GPOS-00022' tag gid: 'V-258163' tag rid: 'SV-258163r926476_rule' tag stig_id: 'RHEL-09-653070' - tag gtitle: 'SRG-OS-000046-GPOS-00022' tag fix_id: 'F-61828r926475_fix' - tag satisfies: ['SRG-OS-000046-GPOS-00022', 'SRG-OS-000343-GPOS-00134'] - tag 'documentable' tag cci: ['CCI-000139', 'CCI-001855'] tag nist: ['AU-5 a', 'AU-5 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe auditd_conf do + its('action_mail_acct') { should cmp 'root' } + end end diff --git a/controls/SV-258164.rb b/controls/SV-258164.rb index cb53057..07ae8c2 100644 --- a/controls/SV-258164.rb +++ b/controls/SV-258164.rb @@ -2,9 +2,7 @@ title 'RHEL 9 audit system must audit local events.' desc %q(Without establishing what type of events occurred, the source of events, where events occurred, and the outcome of events, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. -If option "local_events" isn't set to "yes" only events from network will be aggregated. - -) +If option "local_events" isn't set to "yes" only events from network will be aggregated.) desc 'check', %q(Verify that the RHEL 9 audit system is configured to audit local events with the following command: $ sudo grep local_events /etc/audit/auditd.conf @@ -19,15 +17,20 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61905r926477_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000062-GPOS-00031' tag gid: 'V-258164' tag rid: 'SV-258164r926479_rule' tag stig_id: 'RHEL-09-653075' - tag gtitle: 'SRG-OS-000062-GPOS-00031' tag fix_id: 'F-61829r926478_fix' - tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' - tag cci: ['CCI-000169', 'CCI-000366'] - tag nist: ['AU-12 a', 'CM-6 b'] + tag cci: ['CCI-000366', 'CCI-000169'] + tag nist: ['CM-6 b', 'AU-12 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe parse_config_file('/etc/audit/auditd.conf') do + its('local_events') { should eq 'yes' } + end end diff --git a/controls/SV-258165.rb b/controls/SV-258165.rb index 3c52b24..941eaf6 100644 --- a/controls/SV-258165.rb +++ b/controls/SV-258165.rb @@ -1,8 +1,6 @@ control 'SV-258165' do title 'RHEL 9 audit logs must be group-owned by root or by a restricted logging group to prevent unauthorized read access.' - desc 'Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. - -' + desc 'Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality.' desc 'check', 'Verify the audit logs are group-owned by "root" or a restricted logging group. First determine if a group other than "root" has been assigned to the audit logs with the following command: @@ -33,15 +31,21 @@ $ sudo chgrp ${GROUP} /var/log/audit) impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61906r926480_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000057-GPOS-00027' + tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084'] tag gid: 'V-258165' tag rid: 'SV-258165r926482_rule' tag stig_id: 'RHEL-09-653080' - tag gtitle: 'SRG-OS-000057-GPOS-00027' tag fix_id: 'F-61830r926481_fix' - tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084'] - tag 'documentable' tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164', 'CCI-001314'] - tag nist: ['AU-9 a', 'AU-9 a', 'AU-9 a', 'SI-11 b'] + tag nist: ['AU-9', 'AU-9 a', 'SI-11 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe file(auditd_conf('/etc/audit/auditd.conf').log_file) do + its('group') { should be_in input('var_log_audit_group') } + end end diff --git a/controls/SV-258166.rb b/controls/SV-258166.rb index d3bbbdf..2f587cc 100644 --- a/controls/SV-258166.rb +++ b/controls/SV-258166.rb @@ -1,8 +1,6 @@ control 'SV-258166' do title 'RHEL 9 audit log directory must be owned by root to prevent unauthorized read access.' - desc 'Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. - -' + desc 'Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality.' desc 'check', 'Verify the audit logs directory is owned by "root". First determine where the audit logs are stored with the following command: @@ -23,15 +21,22 @@ $ sudo chown root /var/log/audit' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61907r926483_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000057-GPOS-00027' + tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084'] tag gid: 'V-258166' tag rid: 'SV-258166r926485_rule' tag stig_id: 'RHEL-09-653085' - tag gtitle: 'SRG-OS-000057-GPOS-00027' tag fix_id: 'F-61831r926484_fix' - tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084'] - tag 'documentable' tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164', 'CCI-001314'] - tag nist: ['AU-9 a', 'AU-9 a', 'AU-9 a', 'SI-11 b'] + tag nist: ['AU-9', 'AU-9 a', 'SI-11 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + log_dir = auditd_conf('/etc/audit/auditd.conf').log_file.split('/')[0..-2].join('/') + describe directory(log_dir) do + its('owner') { should eq 'root' } + end end diff --git a/controls/SV-258167.rb b/controls/SV-258167.rb index ce3ef78..e19d104 100644 --- a/controls/SV-258167.rb +++ b/controls/SV-258167.rb @@ -2,9 +2,7 @@ title 'RHEL 9 audit logs file must have mode 0600 or less permissive to prevent unauthorized access to the audit log.' desc "Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, Personally Identifiable Information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements. - -" +The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements." desc 'check', 'Verify the audit logs have a mode of "0600". First determine where the audit logs are stored with the following command: @@ -41,15 +39,24 @@ $ sudo chmod 0400 $log_file.*' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61908r926486_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000057-GPOS-00027' + tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084'] tag gid: 'V-258167' tag rid: 'SV-258167r926488_rule' tag stig_id: 'RHEL-09-653090' - tag gtitle: 'SRG-OS-000057-GPOS-00027' tag fix_id: 'F-61832r926487_fix' - tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084'] - tag 'documentable' tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164', 'CCI-001314'] - tag nist: ['AU-9 a', 'AU-9 a', 'AU-9 a', 'SI-11 b'] + tag nist: ['AU-9', 'AU-9 a', 'SI-11 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + log_file = auditd_conf('/etc/audit/auditd.conf').log_file + + describe file(log_file) do + it { should_not be_more_permissive_than('0600') } + end end diff --git a/controls/SV-258168.rb b/controls/SV-258168.rb index 25f581d..df21d51 100644 --- a/controls/SV-258168.rb +++ b/controls/SV-258168.rb @@ -7,22 +7,33 @@ freq = 100 -If "freq" isn't set to a value of "100" or greater, the value is missing, or the line is commented out, this is a finding.) - desc 'fix', 'Configure RHEL 9 to flush audit to disk by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": +If "freq" isn't set to a value between "1" and "100", the value is missing, or the line is commented out, this is a finding.) + desc 'fix', 'Configure RHEL 9 to flush audit to disk by adding or updating the following rule in "/etc/audit/auditd.conf": freq = 100 The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61909r926489_chk' + tag check_id: 'C-61909r943022_chk' tag severity: 'medium' tag gid: 'V-258168' - tag rid: 'SV-258168r926491_rule' + tag rid: 'SV-258168r943024_rule' tag stig_id: 'RHEL-09-653095' tag gtitle: 'SRG-OS-000051-GPOS-00024' - tag fix_id: 'F-61833r926490_fix' + tag fix_id: 'F-61833r943023_fix' tag 'documentable' tag cci: ['CCI-000154'] tag nist: ['AU-6 (4)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + freq = input('audit_flush_threshold') + + describe auditd_conf do + its('freq.to_i') { should cmp >= freq } + end end diff --git a/controls/SV-258169.rb b/controls/SV-258169.rb index 27976c3..c456652 100644 --- a/controls/SV-258169.rb +++ b/controls/SV-258169.rb @@ -1,12 +1,18 @@ control 'SV-258169' do title 'RHEL 9 must produce audit records containing information to establish the identity of any individual or process associated with the event.' - desc 'Without establishing what type of events occurred, the source of events, where events occurred, and the outcome of events, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. - -Audit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. - -Enriched logging aids in making sense of who, what, and when events occur on a system. Without this, determining root cause of an event will be much more difficult. - -' + desc 'Without establishing what type of events occurred, the source of +events, where events occurred, and the outcome of events, it would be difficult +to establish, correlate, and investigate the events leading up to an outage or +attack. + + Audit record content that may be necessary to satisfy this requirement +includes, for example, time stamps, source and destination addresses, +user/process identifiers, event descriptions, success/fail indications, +filenames involved, and access control or flow control rules invoked. + + Enriched logging aids in making sense of who, what, and when events occur +on a system. Without this, determining root cause of an event will be much +more difficult.' desc 'check', 'Verify that RHEL 9 audit system is configured to resolve audit information before writing to disk, with the following command: $ sudo grep log_format /etc/audit/auditd.conf @@ -14,22 +20,28 @@ log_format = ENRICHED If the "log_format" option is not "ENRICHED", or the line is commented out, this is a finding.' - desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the "log_format" option: + desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the "log_format" +option: -log_format = ENRICHED + log_format = ENRICHED -The audit daemon must be restarted for changes to take effect.' + The audit daemon must be restarted for changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61910r926492_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000255-GPOS-00096' tag gid: 'V-258169' tag rid: 'SV-258169r926494_rule' tag stig_id: 'RHEL-09-653100' - tag gtitle: 'SRG-OS-000255-GPOS-00096' tag fix_id: 'F-61834r926493_fix' - tag satisfies: ['SRG-OS-000255-GPOS-00096', 'SRG-OS-000480-GPOS-00227'] - tag 'documentable' tag cci: ['CCI-000366', 'CCI-001487'] tag nist: ['CM-6 b', 'AU-3 f'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe parse_config_file('/etc/audit/auditd.conf') do + its('log_format') { should eq 'ENRICHED' } + end end diff --git a/controls/SV-258170.rb b/controls/SV-258170.rb index c9ad31b..6fc5583 100644 --- a/controls/SV-258170.rb +++ b/controls/SV-258170.rb @@ -27,4 +27,13 @@ tag 'documentable' tag cci: ['CCI-000366'] tag nist: ['CM-6 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe auditd_conf do + its('write_logs.upcase') { should cmp 'YES' } + end end diff --git a/controls/SV-258171.rb b/controls/SV-258171.rb index b9d54d7..6fb0109 100644 --- a/controls/SV-258171.rb +++ b/controls/SV-258171.rb @@ -1,28 +1,48 @@ control 'SV-258171' do title 'RHEL 9 must allow only the information system security manager (ISSM) (or individuals or roles appointed by the ISSM) to select which auditable events are to be audited.' - desc "Without the capability to restrict the roles and individuals that can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. Misconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one." + desc "Without the capability to restrict the roles and individuals that can +select which events are audited, unauthorized personnel may be able to prevent +the auditing of critical events. Misconfigured audits may degrade the system's +performance by overwhelming the audit log. Misconfigured audits may also make +it more difficult to establish, correlate, and investigate the events relating +to an incident or identify those responsible for one." desc 'check', 'Verify that the files in directory "/etc/audit/rules.d/" and "/etc/audit/auditd.conf" file have a mode of "0640" or less permissive with the following command: -$ sudo stat -c "%a %n" /etc/audit/rules.d/*.rules +# stat -c "%a %n" /etc/audit/rules.d/*.rules 640 /etc/audit/rules.d/audit.rules If the files in the "/etc/audit/rules.d/" directory or the "/etc/audit/auditd.conf" file have a mode more permissive than "0640", this is a finding.' - desc 'fix', 'Configure the files in directory "/etc/audit/rules.d/" and the "/etc/audit/auditd.conf" file to have a mode of "0640" with the following commands: + desc 'fix', 'Configure the files in directory "/etc/audit/rules.d/" and the +"/etc/audit/auditd.conf" file to have a mode of "0640" with the following +commands: -$ sudo chmod 0640 /etc/audit/rules.d/audit.rules -$ sudo chmod 0640 /etc/audit/rules.d/[customrulesfile].rules -$ sudo chmod 0640 /etc/audit/auditd.conf' + $ sudo chmod 0640 /etc/audit/rules.d/audit.rules + $ sudo chmod 0640 /etc/audit/rules.d/[customrulesfile].rules + $ sudo chmod 0640 /etc/audit/auditd.conf' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61912r926498_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000063-GPOS-00032' tag gid: 'V-258171' - tag rid: 'SV-258171r926500_rule' + tag rid: 'SV-258171r943057_rule' tag stig_id: 'RHEL-09-653110' - tag gtitle: 'SRG-OS-000063-GPOS-00032' tag fix_id: 'F-61836r926499_fix' - tag 'documentable' tag cci: ['CCI-000171'] tag nist: ['AU-12 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + rules_files = bash('ls -d /etc/audit/rules.d/*.rules').stdout.strip.split.append('/etc/audit/auditd.conf') + + failing_files = rules_files.select { |rf| file(rf).more_permissive_than?(input('audit_conf_mode')) } + + describe 'Audit configuration files' do + it "should be no more permissive than '#{input('audit_conf_mode')}'" do + expect(failing_files).to be_empty, "Failing files:\n\t- #{failing_files.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258172.rb b/controls/SV-258172.rb index 582b454..ad108a9 100644 --- a/controls/SV-258172.rb +++ b/controls/SV-258172.rb @@ -23,4 +23,15 @@ tag 'documentable' tag cci: ['CCI-000171'] tag nist: ['AU-12 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + mode = input('expected_modes')['auditd_conf'] + + describe file(auditd_conf.conf_path) do + it { should_not be_more_permissive_than(mode) } + end end diff --git a/controls/SV-258173.rb b/controls/SV-258173.rb index d0180ef..ded79ab 100644 --- a/controls/SV-258173.rb +++ b/controls/SV-258173.rb @@ -1,14 +1,20 @@ control 'SV-258173' do title 'RHEL 9 must allocate an audit_backlog_limit of sufficient size to capture processes that start prior to the audit daemon.' - desc 'Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. + desc 'Without the capability to generate audit records, it would be +difficult to establish, correlate, and investigate the events relating to an +incident or identify those responsible for one. -If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created. + If auditing is enabled late in the startup process, the actions of some +startup processes may not be audited. Some audit systems also maintain state +information only available if auditing is enabled before a given process is +created. -Audit records can be generated from various components within the information system (e.g., module or policy filter). + Audit records can be generated from various components within the +information system (e.g., module or policy filter). -Allocating an audit_backlog_limit of sufficient size is critical in maintaining a stable boot process. With an insufficient limit allocated, the system is susceptible to boot failures and crashes. - -' + Allocating an audit_backlog_limit of sufficient size is critical in +maintaining a stable boot process. With an insufficient limit allocated, the +system is susceptible to boot failures and crashes.' desc 'check', %q(Verify RHEL 9 allocates a sufficient audit_backlog_limit to capture processes that start prior to the audit daemon with the following command: $ sudo grubby --info=ALL | grep args | grep -v 'audit_backlog_limit=8192' @@ -19,15 +25,34 @@ $ sudo grubby --update-kernel=ALL --args=audit_backlog_limit=8192' impact 0.3 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61914r926504_chk' tag severity: 'low' + tag gtitle: 'SRG-OS-000254-GPOS-00095' tag gid: 'V-258173' tag rid: 'SV-258173r926506_rule' tag stig_id: 'RHEL-09-653120' - tag gtitle: 'SRG-OS-000254-GPOS-00095' tag fix_id: 'F-61838r926505_fix' - tag satisfies: ['SRG-OS-000254-GPOS-00095', 'SRG-OS-000341-GPOS-00132'] - tag 'documentable' - tag cci: ['CCI-001464', 'CCI-001849'] - tag nist: ['AU-14 (1)', 'AU-4'] + tag cci: ['CCI-001849', 'CCI-001464'] + tag nist: ['AU-4', 'AU-14 (1)'] + tag 'host' + + only_if('Control not applicable within a container without sudo enabled', impact: 0.0) do + !virtualization.system.eql?('docker') + end + + expected_audit_backlog_limit = input('expected_audit_backlog_limit') + + grubby = command('grubby --info=ALL').stdout + + arg_match = parse_config(grubby)['args'].match(/audit_backlog_limit\s*=\s*(?\d+)/) + + describe 'Audit backlog limit' do + it 'should be set' do + expect(arg_match).not_to be_nil, 'Setting for audit_backlog_limit not found in grubby output' + end + unless arg_match.nil? + it "should be at least #{expected_audit_backlog_limit}" do + expect(arg_match[:actual_audit_backlog_limit].to_i).to be >= expected_audit_backlog_limit + end + end + end end diff --git a/controls/SV-258174.rb b/controls/SV-258174.rb index d6d5fd2..106b58f 100644 --- a/controls/SV-258174.rb +++ b/controls/SV-258174.rb @@ -1,10 +1,18 @@ control 'SV-258174' do title 'RHEL 9 must have mail aliases to notify the information system security officer (ISSO) and system administrator (SA) (at a minimum) in the event of an audit processing failure.' - desc 'It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. + desc 'It is critical for the appropriate personnel to be aware if a system +is at risk of failing to process audit logs as required. Without this +notification, the security personnel may be unaware of an impending failure of +the audit capability, and system operation may be adversely affected. -Audit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded. + Audit processing failures include software/hardware errors, failures in the +audit capturing mechanisms, and audit storage capacity being reached or +exceeded. -This requirement applies to each audit data storage repository (i.e., distinct information system component where audit records are stored), the centralized audit storage capacity of organizations (i.e., all audit data storage repositories combined), or both.' + This requirement applies to each audit data storage repository (i.e., +distinct information system component where audit records are stored), the +centralized audit storage capacity of organizations (i.e., all audit data +storage repositories combined), or both.' desc 'check', 'Verify that RHEL 9 is configured to notify the appropriate interactive users in the event of an audit processing failure. Find the alias maps that are being used with the following command: @@ -28,14 +36,31 @@ $ sudo newaliases' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61915r926507_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000046-GPOS-00022' tag gid: 'V-258174' tag rid: 'SV-258174r926509_rule' tag stig_id: 'RHEL-09-653125' - tag gtitle: 'SRG-OS-000046-GPOS-00022' tag fix_id: 'F-61839r926508_fix' - tag 'documentable' tag cci: ['CCI-000139'] tag nist: ['AU-5 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + alternative_logging = input('alternative_logging') + + if alternative_logging == true + describe 'Alternative logging' do + it 'should handle sysadmin and ISSO notification' do + expect(alternative_logging).to eq(true) + end + end + else + describe command('grep "postmaster:\s*root$" /etc/aliases') do + its('stdout.strip') { should match(/postmaster:\s*root/) } + end + end end diff --git a/controls/SV-258175.rb b/controls/SV-258175.rb index 64e8c17..93fd43e 100644 --- a/controls/SV-258175.rb +++ b/controls/SV-258175.rb @@ -25,4 +25,13 @@ tag 'documentable' tag cci: ['CCI-001851'] tag nist: ['AU-4 (1)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe package('audispd-plugins') do + it { should be_installed } + end end diff --git a/controls/SV-258176.rb b/controls/SV-258176.rb index 927b2b0..45afb60 100644 --- a/controls/SV-258176.rb +++ b/controls/SV-258176.rb @@ -1,8 +1,11 @@ control 'SV-258176' do title 'RHEL 9 must audit uses of the "execve" system call.' - desc 'Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised information system accounts, is a serious and ongoing concern and can have significant adverse impacts on organizations. Auditing the use of privileged functions is one way to detect such misuse and identify the risk from insider threats and the advanced persistent threat. - -' + desc 'Misuse of privileged functions, either intentionally or +unintentionally by authorized users, or by unauthorized external entities that +have compromised information system accounts, is a serious and ongoing concern +and can have significant adverse impacts on organizations. Auditing the use of +privileged functions is one way to detect such misuse and identify the risk +from insider threats and the advanced persistent threat.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "execve" system call with the following command: $ sudo auditctl -l | grep execve @@ -25,15 +28,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61917r926513_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000326-GPOS-00126' + tag satisfies: ['SRG-OS-000326-GPOS-00126', 'SRG-OS-000327-GPOS-00127'] tag gid: 'V-258176' tag rid: 'SV-258176r926515_rule' tag stig_id: 'RHEL-09-654010' - tag gtitle: 'SRG-OS-000326-GPOS-00126' tag fix_id: 'F-61841r926514_fix' - tag satisfies: ['SRG-OS-000326-GPOS-00126', 'SRG-OS-000327-GPOS-00127'] - tag 'documentable' tag cci: ['CCI-002233', 'CCI-002234'] tag nist: ['AC-6 (8)', 'AC-6 (9)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_syscalls = ['execve'] + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('uid!=euid', 'gid!=egid', 'euid=0', 'egid=0') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258177.rb b/controls/SV-258177.rb index c0f5b1b..57e76fa 100644 --- a/controls/SV-258177.rb +++ b/controls/SV-258177.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "chmod", "fchmod", and "fchmodat" system calls with the following command: $ sudo auditctl -l | grep chmod @@ -28,15 +26,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61918r926516_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000458-GPOS-00203'] tag gid: 'V-258177' tag rid: 'SV-258177r926518_rule' tag stig_id: 'RHEL-09-654015' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61842r926517_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000458-GPOS-00203'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['chmod', 'fchmod', 'fchmodat'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258178.rb b/controls/SV-258178.rb index 2155fda..3040172 100644 --- a/controls/SV-258178.rb +++ b/controls/SV-258178.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "chown", "fchown", "fchownat", and "lchown" system calls with the following command: $ sudo auditctl -l | grep chown @@ -27,15 +25,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61919r926519_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000474-GPOS-00219'] tag gid: 'V-258178' tag rid: 'SV-258178r926521_rule' tag stig_id: 'RHEL-09-654020' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61843r926520_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000474-GPOS-00219'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['chown'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258179.rb b/controls/SV-258179.rb index cee5222..8986595 100644 --- a/controls/SV-258179.rb +++ b/controls/SV-258179.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "setxattr", "fsetxattr", "lsetxattr", "removexattr", "fremovexattr", and "lremovexattr" system calls with the following command: $ sudo auditctl -l | grep xattr @@ -31,15 +29,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61920r926522_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000474-GPOS-00219', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000064-GPOS-00033'] tag gid: 'V-258179' tag rid: 'SV-258179r926524_rule' tag stig_id: 'RHEL-09-654025' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61844r926523_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000474-GPOS-00219', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000064-GPOS-00033'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['setxattr', 'fsetxattr', 'lsetxattr', 'removexattr', 'fremovexattr', 'lremovexattr'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258180.rb b/controls/SV-258180.rb index 8b0f981..90ae978 100644 --- a/controls/SV-258180.rb +++ b/controls/SV-258180.rb @@ -34,4 +34,29 @@ tag 'documentable' tag cci: ['CCI-000130', 'CCI-000169', 'CCI-000172', 'CCI-002884'] tag nist: ['AU-3 a', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['umount'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258181.rb b/controls/SV-258181.rb index 390acf5..b038ec9 100644 --- a/controls/SV-258181.rb +++ b/controls/SV-258181.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "chacl" command with the following command: $ sudo auditctl -l | grep chacl @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61922r926528_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210'] tag gid: 'V-258181' tag rid: 'SV-258181r926530_rule' tag stig_id: 'RHEL-09-654035' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61846r926529_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/chacl' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258182.rb b/controls/SV-258182.rb index 32c9ead..5930503 100644 --- a/controls/SV-258182.rb +++ b/controls/SV-258182.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "setfacl" command with the following command: $ sudo auditctl -l | grep setfacl @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61923r926531_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258182' tag rid: 'SV-258182r926533_rule' tag stig_id: 'RHEL-09-654040' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61847r926532_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/setfacl' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258183.rb b/controls/SV-258183.rb index 4297c62..115df91 100644 --- a/controls/SV-258183.rb +++ b/controls/SV-258183.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "chcon" command with the following command: $ sudo auditctl -l | grep chcon @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61924r926534_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] tag gid: 'V-258183' tag rid: 'SV-258183r926536_rule' tag stig_id: 'RHEL-09-654045' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61848r926535_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/chcon' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258184.rb b/controls/SV-258184.rb index 04695f1..dab15ef 100644 --- a/controls/SV-258184.rb +++ b/controls/SV-258184.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "semanage" command with the following command: $ sudo auditctl -l | grep semanage @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61925r926537_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] tag gid: 'V-258184' tag rid: 'SV-258184r926539_rule' tag stig_id: 'RHEL-09-654050' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61849r926538_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/semanage' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258185.rb b/controls/SV-258185.rb index 104f4f7..b2c5fa8 100644 --- a/controls/SV-258185.rb +++ b/controls/SV-258185.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "setfiles" command with the following command: $ sudo auditctl -l | grep setfiles @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61926r926540_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] tag gid: 'V-258185' tag rid: 'SV-258185r926542_rule' tag stig_id: 'RHEL-09-654055' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61850r926541_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/setfiles' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258186.rb b/controls/SV-258186.rb index e1b5f45..dc8d979 100644 --- a/controls/SV-258186.rb +++ b/controls/SV-258186.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "setsebool" command with the following command: $ sudo auditctl -l | grep setsebool @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61927r926543_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] tag gid: 'V-258186' tag rid: 'SV-258186r926545_rule' tag stig_id: 'RHEL-09-654060' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61851r926544_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/setsebool' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258187.rb b/controls/SV-258187.rb index 125e3f4..c013a1c 100644 --- a/controls/SV-258187.rb +++ b/controls/SV-258187.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', %q(Verify that RHEL 9 is configured to audit successful/unsuccessful attempts to use the "rename", "unlink", "rmdir", "renameat", and "unlinkat" system calls with the following command: $ sudo auditctl -l | grep 'rename\|unlink\|rmdir' @@ -25,15 +23,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61928r926546_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000467-GPOS-00211', 'SRG-OS-000468-GPOS-00212'] tag gid: 'V-258187' tag rid: 'SV-258187r926548_rule' tag stig_id: 'RHEL-09-654065' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61852r926547_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000467-GPOS-00211', 'SRG-OS-000468-GPOS-00212'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['rename', 'unlink', 'rmdir', 'renameat', 'unlinkat'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258188.rb b/controls/SV-258188.rb index 771796f..526c545 100644 --- a/controls/SV-258188.rb +++ b/controls/SV-258188.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', %q(Verify that RHEL 9 is configured to audit successful/unsuccessful attempts to use the "truncate", "ftruncate", "creat", "open", "openat", and "open_by_handle_at" system calls with the following command: $ sudo auditctl -l | grep 'open\|truncate\|creat' @@ -35,15 +33,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61929r926549_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000461-GPOS-00205'] tag gid: 'V-258188' tag rid: 'SV-258188r926551_rule' tag stig_id: 'RHEL-09-654070' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61853r926550_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000461-GPOS-00205'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['truncate', 'ftruncate', 'creat', 'open', 'openat', 'open_by_handle_at'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258189.rb b/controls/SV-258189.rb index 24ac596..7c12ed5 100644 --- a/controls/SV-258189.rb +++ b/controls/SV-258189.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "delete_module" system call with the following command: $ sudo auditctl -l | grep delete_module @@ -25,15 +23,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61930r926552_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222'] tag gid: 'V-258189' tag rid: 'SV-258189r926554_rule' tag stig_id: 'RHEL-09-654075' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61854r926553_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['delete_module'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258190.rb b/controls/SV-258190.rb index d8501cd..bf0866d 100644 --- a/controls/SV-258190.rb +++ b/controls/SV-258190.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "init_module" and "finit_module" system calls with the following command: $ sudo auditctl -l | grep init_module @@ -25,15 +23,38 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61931r926555_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222'] tag gid: 'V-258190' tag rid: 'SV-258190r926557_rule' tag stig_id: 'RHEL-09-654080' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61855r926556_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_syscalls = ['init_module', 'finit_module'] + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258191.rb b/controls/SV-258191.rb index 8199049..ebc98c0 100644 --- a/controls/SV-258191.rb +++ b/controls/SV-258191.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "chage" command with the following command: $ sudo auditctl -l | grep chage @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61932r926558_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258191' tag rid: 'SV-258191r926560_rule' tag stig_id: 'RHEL-09-654085' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61856r926559_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/chage' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258192.rb b/controls/SV-258192.rb index f5c9d55..9ea1fa4 100644 --- a/controls/SV-258192.rb +++ b/controls/SV-258192.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "chsh" command with the following command: $ sudo auditctl -l | grep chsh @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61933r926561_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258192' tag rid: 'SV-258192r926563_rule' tag stig_id: 'RHEL-09-654090' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61857r926562_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/chsh' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258193.rb b/controls/SV-258193.rb index 87d838e..81607ed 100644 --- a/controls/SV-258193.rb +++ b/controls/SV-258193.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "crontab" command with the following command: $ sudo auditctl -l | grep crontab @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61934r926564_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258193' tag rid: 'SV-258193r926566_rule' tag stig_id: 'RHEL-09-654095' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61858r926565_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/crontab' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258194.rb b/controls/SV-258194.rb index 16b0f2c..a83b523 100644 --- a/controls/SV-258194.rb +++ b/controls/SV-258194.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "gpasswd" command with the following command: $ sudo auditctl -l | grep gpasswd @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61935r926567_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258194' tag rid: 'SV-258194r926569_rule' tag stig_id: 'RHEL-09-654100' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61859r926568_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/gpasswd' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258195.rb b/controls/SV-258195.rb index 1dae118..90bfa47 100644 --- a/controls/SV-258195.rb +++ b/controls/SV-258195.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "kmod" command with the following command: $ sudo auditctl -l | grep kmod @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61936r926570_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222'] tag gid: 'V-258195' tag rid: 'SV-258195r926572_rule' tag stig_id: 'RHEL-09-654105' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61860r926571_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/kmod' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258196.rb b/controls/SV-258196.rb index 52cc8a9..8c95755 100644 --- a/controls/SV-258196.rb +++ b/controls/SV-258196.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "newgrp" command with the following command: $ sudo auditctl -l | grep newgrp @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61937r926573_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258196' tag rid: 'SV-258196r926575_rule' tag stig_id: 'RHEL-09-654110' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61861r926574_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/newgrp' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258197.rb b/controls/SV-258197.rb index ca9d9c1..7650aab 100644 --- a/controls/SV-258197.rb +++ b/controls/SV-258197.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "pam_timestamp_check" command with the following command: $ sudo auditctl -l | grep timestamp @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61938r926576_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258197' tag rid: 'SV-258197r926578_rule' tag stig_id: 'RHEL-09-654115' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61862r926577_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/pam_timestamp_check' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258198.rb b/controls/SV-258198.rb index 6f22cca..f9595f1 100644 --- a/controls/SV-258198.rb +++ b/controls/SV-258198.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', %q(Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/gshadow" with the following command: $ sudo auditctl -l | egrep '(/usr/bin/passwd)' @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61939r926579_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258198' tag rid: 'SV-258198r926581_rule' tag stig_id: 'RHEL-09-654120' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61863r926580_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/passwd' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258199.rb b/controls/SV-258199.rb index 4877740..af8b26c 100644 --- a/controls/SV-258199.rb +++ b/controls/SV-258199.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "postdrop" command with the following command: $ sudo auditctl -l | grep postdrop @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61940r926582_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258199' tag rid: 'SV-258199r926584_rule' tag stig_id: 'RHEL-09-654125' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61864r926583_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/postdrop' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258200.rb b/controls/SV-258200.rb index 15b1750..00b6c85 100644 --- a/controls/SV-258200.rb +++ b/controls/SV-258200.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "postqueue" command with the following command: $ sudo auditctl -l | grep postqueue @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61941r926585_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258200' tag rid: 'SV-258200r926587_rule' tag stig_id: 'RHEL-09-654130' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61865r926586_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/postqueue' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258201.rb b/controls/SV-258201.rb index 0513fe4..01b7f14 100644 --- a/controls/SV-258201.rb +++ b/controls/SV-258201.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "ssh-agent" command with the following command: $ sudo auditctl -l | grep ssh-agent @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61942r926588_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258201' tag rid: 'SV-258201r926590_rule' tag stig_id: 'RHEL-09-654135' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61866r926589_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/ssh-agent' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258202.rb b/controls/SV-258202.rb index f60a85c..6612cec 100644 --- a/controls/SV-258202.rb +++ b/controls/SV-258202.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "ssh-keysign" command with the following command: $ sudo auditctl -l | grep ssh-keysign @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61943r926591_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258202' tag rid: 'SV-258202r926593_rule' tag stig_id: 'RHEL-09-654140' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61867r926592_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/libexec/openssh/ssh-keysign' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258203.rb b/controls/SV-258203.rb index 6a7c21c..f9eec97 100644 --- a/controls/SV-258203.rb +++ b/controls/SV-258203.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "su" command with the following command: $ sudo auditctl -l | grep /usr/bin/su @@ -23,15 +21,30 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61944r926594_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000064-GPOS-0003', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000064-GPOS-00033'] tag gid: 'V-258203' tag rid: 'SV-258203r926596_rule' tag stig_id: 'RHEL-09-654145' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61868r926595_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/su' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258204.rb b/controls/SV-258204.rb index d62a690..cf4b65e 100644 --- a/controls/SV-258204.rb +++ b/controls/SV-258204.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "sudo" command with the following command: $ sudo auditctl -l | grep /usr/bin/sudo @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61945r926597_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210'] tag gid: 'V-258204' tag rid: 'SV-258204r926599_rule' tag stig_id: 'RHEL-09-654150' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61869r926598_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/sudo' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258205.rb b/controls/SV-258205.rb index a6b2ae6..cde690d 100644 --- a/controls/SV-258205.rb +++ b/controls/SV-258205.rb @@ -34,4 +34,22 @@ tag 'documentable' tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/sudoedit' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258206.rb b/controls/SV-258206.rb index c5d61b6..4183286 100644 --- a/controls/SV-258206.rb +++ b/controls/SV-258206.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "unix_chkpwd" command with the following command: $ sudo auditctl -l | grep unix_chkpwd @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61947r926603_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258206' tag rid: 'SV-258206r926605_rule' tag stig_id: 'RHEL-09-654160' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61871r926604_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/unix_chkpwd' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258207.rb b/controls/SV-258207.rb index ae92d18..13d5869 100644 --- a/controls/SV-258207.rb +++ b/controls/SV-258207.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "unix_update" command with the following command: $ sudo auditctl -l | grep unix_update @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61948r926606_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033'] tag gid: 'V-258207' tag rid: 'SV-258207r926608_rule' tag stig_id: 'RHEL-09-654165' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61872r926607_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/unix_update' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258208.rb b/controls/SV-258208.rb index 6854926..f82d729 100644 --- a/controls/SV-258208.rb +++ b/controls/SV-258208.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "userhelper" command with the following command: $ sudo auditctl -l | grep userhelper @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61949r926609_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258208' tag rid: 'SV-258208r926611_rule' tag stig_id: 'RHEL-09-654170' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61873r926610_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/userhelper' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258209.rb b/controls/SV-258209.rb index c388980..eefaad7 100644 --- a/controls/SV-258209.rb +++ b/controls/SV-258209.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "usermod" command with the following command: $ sudo auditctl -l | grep usermod @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61950r926612_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210'] tag gid: 'V-258209' tag rid: 'SV-258209r926614_rule' tag stig_id: 'RHEL-09-654175' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61874r926613_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/sbin/usermod' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258210.rb b/controls/SV-258210.rb index 4179dd9..da91a54 100644 --- a/controls/SV-258210.rb +++ b/controls/SV-258210.rb @@ -6,9 +6,7 @@ When a user logs on, the auid is set to the uid of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -' +The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.' desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the "mount" command with the following command: $ sudo auditctl -l | grep /usr/bin/mount @@ -23,15 +21,31 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61951r926615_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258210' tag rid: 'SV-258210r926617_rule' tag stig_id: 'RHEL-09-654180' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61875r926616_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/mount' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258211.rb b/controls/SV-258211.rb index 27d0fcb..daf49d5 100644 --- a/controls/SV-258211.rb +++ b/controls/SV-258211.rb @@ -25,4 +25,22 @@ tag 'documentable' tag cci: ['CCI-000172'] tag nist: ['AU-12 c'] + tag 'host' + + audit_command = '/usr/sbin/init' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258212.rb b/controls/SV-258212.rb index 29c11ee..b9745a4 100644 --- a/controls/SV-258212.rb +++ b/controls/SV-258212.rb @@ -25,4 +25,22 @@ tag 'documentable' tag cci: ['CCI-000172'] tag nist: ['AU-12 c'] + tag 'host' + + audit_command = '/usr/sbin/poweroff' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258213.rb b/controls/SV-258213.rb index 989b20c..5827c78 100644 --- a/controls/SV-258213.rb +++ b/controls/SV-258213.rb @@ -25,4 +25,22 @@ tag 'documentable' tag cci: ['CCI-000172'] tag nist: ['AU-12 c'] + tag 'host' + + audit_command = '/usr/sbin/reboot' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258214.rb b/controls/SV-258214.rb index 1d77344..1d4c5b6 100644 --- a/controls/SV-258214.rb +++ b/controls/SV-258214.rb @@ -25,4 +25,22 @@ tag 'documentable' tag cci: ['CCI-000172'] tag nist: ['AU-12 c'] + tag 'host' + + audit_command = '/usr/sbin/shutdown' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258215.rb b/controls/SV-258215.rb index d090bec..ab1e3c6 100644 --- a/controls/SV-258215.rb +++ b/controls/SV-258215.rb @@ -1,8 +1,6 @@ control 'SV-258215' do title 'Successful/unsuccessful uses of the umount system call in RHEL 9 must generate an audit record.' - desc 'The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users. - -' + desc 'The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.' desc 'check', 'Verify that RHEL 9 generates an audit record for all uses of the "umount" and system call with the following command: $ sudo grep "umount" /etc/audit/audit.* @@ -14,20 +12,36 @@ If the command does not return a line, or the line is commented out, this is a finding.' desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the "umount" system call by adding or updating the following rules in "/etc/audit/audit.rules" and adding the following rules to "/etc/audit/rules.d/perm_mod.rules" or updating the existing rules in files in the "/etc/audit/rules.d/" directory: --a always,exit -F arch=b32 -S umount -F auid>=1000 -F auid!=unset -k perm_mod -a always,exit -F arch=b64 -S umount -F auid>=1000 -F auid!=unset -k perm_mod +-a always,exit -F arch=b32 -S umount -F auid>=1000 -F auid!=unset -k privileged-umount The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61956r926630_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] tag gid: 'V-258215' - tag rid: 'SV-258215r926632_rule' + tag rid: 'SV-258215r943018_rule' tag stig_id: 'RHEL-09-654205' - tag gtitle: 'SRG-OS-000037-GPOS-00015' - tag fix_id: 'F-61880r926631_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag fix_id: 'F-61880r943017_fix' + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/usr/bin/umount' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258216.rb b/controls/SV-258216.rb index 118f7b5..563d06b 100644 --- a/controls/SV-258216.rb +++ b/controls/SV-258216.rb @@ -29,4 +29,30 @@ tag 'documentable' tag cci: ['CCI-000130', 'CCI-000169', 'CCI-000172', 'CCI-002884'] tag nist: ['AU-3 a', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_syscalls = ['umount2'] + + describe 'Syscall' do + audit_syscalls.each do |audit_syscall| + it "#{audit_syscall} is audited properly" do + audit_rule = auditd.syscall(audit_syscall) + expect(audit_rule).to exist + expect(audit_rule.action.uniq).to cmp 'always' + expect(audit_rule.list.uniq).to cmp 'exit' + if os.arch.match(/64/) + expect(audit_rule.arch.uniq).to include('b32', 'b64') + else + expect(audit_rule.arch.uniq).to cmp 'b32' + end + expect(audit_rule.fields.flatten).to include('uid!=euid', 'gid!=egid', 'euid=0', 'egid=0') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall]) + end + end + end end diff --git a/controls/SV-258217.rb b/controls/SV-258217.rb index 36a5726..cc31b09 100644 --- a/controls/SV-258217.rb +++ b/controls/SV-258217.rb @@ -1,8 +1,6 @@ control 'SV-258217' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/sudoers.' - desc 'The actions taken by system administrators must be audited to keep a record of what was executed on the system, as well as for accountability purposes. Editing the sudoers file may be sign of an attacker trying to establish persistent methods to a system, auditing the editing of the sudoers files mitigates this risk. - -' + desc 'The actions taken by system administrators must be audited to keep a record of what was executed on the system, as well as for accountability purposes. Editing the sudoers file may be sign of an attacker trying to establish persistent methods to a system, auditing the editing of the sudoers files mitigates this risk.' desc 'check', 'Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/sudoers" with the following command: $ sudo auditctl -l | grep /etc/sudoers @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61958r926636_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000004-GPOS-00004' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] tag gid: 'V-258217' tag rid: 'SV-258217r926638_rule' tag stig_id: 'RHEL-09-654215' - tag gtitle: 'SRG-OS-000004-GPOS-00004' tag fix_id: 'F-61882r926637_fix' - tag satisfies: ['SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] - tag 'documentable' - tag cci: ['CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] - tag nist: ['AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] + tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/etc/sudoers' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258218.rb b/controls/SV-258218.rb index 8b86a4c..4686d53 100644 --- a/controls/SV-258218.rb +++ b/controls/SV-258218.rb @@ -1,8 +1,6 @@ control 'SV-258218' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/sudoers.d/ directory.' - desc 'The actions taken by system administrators must be audited to keep a record of what was executed on the system, as well as for accountability purposes. Editing the sudoers file may be sign of an attacker trying to establish persistent methods to a system, auditing the editing of the sudoers files mitigates this risk. - -' + desc 'The actions taken by system administrators must be audited to keep a record of what was executed on the system, as well as for accountability purposes. Editing the sudoers file may be sign of an attacker trying to establish persistent methods to a system, auditing the editing of the sudoers files mitigates this risk.' desc 'check', 'Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/sudoers.d/" with the following command: $ sudo auditctl -l | grep /etc/sudoers.d @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61959r926639_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000004-GPOS-00004' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] tag gid: 'V-258218' tag rid: 'SV-258218r926641_rule' tag stig_id: 'RHEL-09-654220' - tag gtitle: 'SRG-OS-000004-GPOS-00004' tag fix_id: 'F-61883r926640_fix' - tag satisfies: ['SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] - tag 'documentable' - tag cci: ['CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] - tag nist: ['AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] + tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/etc/sudoers.d' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258219.rb b/controls/SV-258219.rb index 927152f..b4f453c 100644 --- a/controls/SV-258219.rb +++ b/controls/SV-258219.rb @@ -1,8 +1,6 @@ control 'SV-258219' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/group.' - desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications must be investigated for legitimacy. - -' + desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications must be investigated for legitimacy.' desc 'check', %q(Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/group" with the following command: $ sudo auditctl -l | egrep '(/etc/group)' @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61960r926642_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000004-GPOS-00004' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] tag gid: 'V-258219' tag rid: 'SV-258219r926644_rule' tag stig_id: 'RHEL-09-654225' - tag gtitle: 'SRG-OS-000004-GPOS-00004' tag fix_id: 'F-61884r926643_fix' - tag satisfies: ['SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] - tag 'documentable' - tag cci: ['CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] - tag nist: ['AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] + tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/etc/group' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258220.rb b/controls/SV-258220.rb index d69724c..4cdf07f 100644 --- a/controls/SV-258220.rb +++ b/controls/SV-258220.rb @@ -1,8 +1,6 @@ control 'SV-258220' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/gshadow.' - desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -' + desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.' desc 'check', %q(Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/gshadow" with the following command: $ sudo auditctl -l | egrep '(/etc/gshadow)' @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61961r926645_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000004-GPOS-00004' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] tag gid: 'V-258220' tag rid: 'SV-258220r926647_rule' tag stig_id: 'RHEL-09-654230' - tag gtitle: 'SRG-OS-000004-GPOS-00004' tag fix_id: 'F-61885r926646_fix' - tag satisfies: ['SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] - tag 'documentable' - tag cci: ['CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] - tag nist: ['AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] + tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/etc/gshadow' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258221.rb b/controls/SV-258221.rb index 1507e05..e87b9fa 100644 --- a/controls/SV-258221.rb +++ b/controls/SV-258221.rb @@ -1,8 +1,6 @@ control 'SV-258221' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/opasswd.' - desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -' + desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.' desc 'check', %q(Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/security/opasswd" with the following command: $ sudo auditctl -l | egrep '(/etc/security/opasswd)' @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61962r926648_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000004-GPOS-00004' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000466-GPOS-00210'] tag gid: 'V-258221' tag rid: 'SV-258221r926650_rule' tag stig_id: 'RHEL-09-654235' - tag gtitle: 'SRG-OS-000004-GPOS-00004' tag fix_id: 'F-61886r926649_fix' - tag satisfies: ['SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] - tag 'documentable' - tag cci: ['CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] - tag nist: ['AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] + tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/etc/security/opasswd' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258222.rb b/controls/SV-258222.rb index 1139ec4..9707106 100644 --- a/controls/SV-258222.rb +++ b/controls/SV-258222.rb @@ -1,8 +1,6 @@ control 'SV-258222' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/passwd.' - desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -' + desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.' desc 'check', %q(Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/passwd" with the following command: $ sudo auditctl -l | egrep '(/etc/passwd)' @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61963r926651_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000004-GPOS-00004' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000274-GPOS-00104', 'SRG-OS-000275-GPOS-00105', 'SRG-OS-000276-GPOS-00106', 'SRG-OS-000277-GPOS-00107'] tag gid: 'V-258222' tag rid: 'SV-258222r926653_rule' tag stig_id: 'RHEL-09-654240' - tag gtitle: 'SRG-OS-000004-GPOS-00004' tag fix_id: 'F-61887r926652_fix' - tag satisfies: ['SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000274-GPOS-00104', 'SRG-OS-000275-GPOS-00105', 'SRG-OS-000276-GPOS-00106', 'SRG-OS-000277-GPOS-00107'] - tag 'documentable' - tag cci: ['CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-001683', 'CCI-001684', 'CCI-001685', 'CCI-001686', 'CCI-002130', 'CCI-002132', 'CCI-002884'] - tag nist: ['AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-001683', 'CCI-001684', 'CCI-001685', 'CCI-001686', 'CCI-002130', 'CCI-002132', 'CCI-002884'] + tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/etc/passwd' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258223.rb b/controls/SV-258223.rb index 792d9d3..e1cec05 100644 --- a/controls/SV-258223.rb +++ b/controls/SV-258223.rb @@ -1,8 +1,6 @@ control 'SV-258223' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/shadow.' - desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -' + desc 'In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy.' desc 'check', %q(Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/passwd with the following command: $ sudo auditctl -l | egrep '(/etc/shadow)' @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61964r926654_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000004-GPOS-00004' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] tag gid: 'V-258223' tag rid: 'SV-258223r926656_rule' tag stig_id: 'RHEL-09-654245' - tag gtitle: 'SRG-OS-000004-GPOS-00004' tag fix_id: 'F-61888r926655_fix' - tag satisfies: ['SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221'] - tag 'documentable' - tag cci: ['CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] - tag nist: ['AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'AC-2 (4)', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884'] + tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/etc/shadow' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258224.rb b/controls/SV-258224.rb index 2381453..17db967 100644 --- a/controls/SV-258224.rb +++ b/controls/SV-258224.rb @@ -30,4 +30,20 @@ tag 'documentable' tag cci: ['CCI-000172', 'CCI-002884'] tag nist: ['AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/var/log/faillock' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258225.rb b/controls/SV-258225.rb index a8cbd6f..bf6dc1a 100644 --- a/controls/SV-258225.rb +++ b/controls/SV-258225.rb @@ -1,8 +1,6 @@ control 'SV-258225' do title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/lastlog.' - desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -' + desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.' desc 'check', 'Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/var/log/lastlog" with the following command: $ sudo auditctl -l | grep /var/log/lastlog @@ -19,15 +17,29 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61966r926660_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000037-GPOS-00015' + tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000470-GPOS-00214'] tag gid: 'V-258225' tag rid: 'SV-258225r926662_rule' tag stig_id: 'RHEL-09-654255' - tag gtitle: 'SRG-OS-000037-GPOS-00015' tag fix_id: 'F-61890r926661_fix' - tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000470-GPOS-00214'] - tag 'documentable' - tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884'] - tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)'] + tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884'] + tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + audit_command = '/var/log/lastlog' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258226.rb b/controls/SV-258226.rb index 81212a7..c1ef124 100644 --- a/controls/SV-258226.rb +++ b/controls/SV-258226.rb @@ -30,4 +30,20 @@ tag 'documentable' tag cci: ['CCI-000172', 'CCI-002884'] tag nist: ['AU-12 c', 'MA-4 (1) (a)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + audit_command = '/var/log/tallylog' + + describe 'Command' do + it "#{audit_command} is audited properly" do + audit_rule = auditd.file(audit_command) + expect(audit_rule).to exist + expect(audit_rule.permissions.flatten).to include('w', 'a') + expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command]) + end + end end diff --git a/controls/SV-258227.rb b/controls/SV-258227.rb index 22cb0a5..180aca8 100644 --- a/controls/SV-258227.rb +++ b/controls/SV-258227.rb @@ -30,4 +30,32 @@ tag 'documentable' tag cci: ['CCI-000139', 'CCI-000140'] tag nist: ['AU-5 a', 'AU-5 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + expected_panic_value = input('expected_panic_value') + panic_flag = command('grep "\\-f" /etc/audit/audit.rules').stdout.strip + + if input('high_availability_required') + impact 0.0 + describe 'N/A' do + skip 'This system is indicated as requiring high availability and cannot panic in the event of audit failure' + end + elsif panic_flag.empty? + describe 'The audit service' do + it 'is expected to configure fail behavior' do + expect(panic_flag).not_to be_empty, "The '-f' flag was not set in audit.rules" + end + end + else + value = panic_flag.split[1].to_i + describe 'The audit service ' do + it 'is expected to panic on a critical error' do + expect(value).to eq(expected_panic_value), "The '-f' flag was set to '#{value}' instead of '#{expected_panic_value}'" + end + end + end end diff --git a/controls/SV-258228.rb b/controls/SV-258228.rb index 41e7939..5064a71 100644 --- a/controls/SV-258228.rb +++ b/controls/SV-258228.rb @@ -1,8 +1,6 @@ control 'SV-258228' do title 'RHEL 9 audit system must protect logon UIDs from unauthorized change.' - desc 'If modification of login user identifiers (UIDs) is not prevented, they can be changed by nonprivileged users and make auditing complicated or impossible. - -' + desc 'If modification of login user identifiers (UIDs) is not prevented, they can be changed by nonprivileged users and make auditing complicated or impossible.' desc 'check', 'Verify the audit system prevents unauthorized changes to logon UIDs with the following command: $ sudo grep -i immutable /etc/audit/audit.rules @@ -17,15 +15,21 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61969r926669_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000462-GPOS-00206' + tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000475-GPOS-00220'] tag gid: 'V-258228' tag rid: 'SV-258228r926671_rule' tag stig_id: 'RHEL-09-654270' - tag gtitle: 'SRG-OS-000462-GPOS-00206' tag fix_id: 'F-61893r926670_fix' - tag satisfies: ['SRG-OS-000462-GPOS-00206', 'SRG-OS-000475-GPOS-00220', 'SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029'] - tag 'documentable' tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164', 'CCI-000172'] - tag nist: ['AU-9 a', 'AU-9 a', 'AU-9 a', 'AU-12 c'] + tag nist: ['AU-9', 'AU-9 a', 'AU-12 c'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe command('grep -i immutable /etc/audit/audit.rules') do + its('stdout.strip') { should cmp '--loginuid-immutable' } + end end diff --git a/controls/SV-258229.rb b/controls/SV-258229.rb index 588dcef..c4ab2a0 100644 --- a/controls/SV-258229.rb +++ b/controls/SV-258229.rb @@ -4,9 +4,7 @@ Audit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit RHEL 9 system activity. -In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. A system reboot would be noticeable, and a system administrator could then investigate the unauthorized changes. - -' +In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. A system reboot would be noticeable, and a system administrator could then investigate the unauthorized changes.' desc 'check', 'Verify the audit system prevents unauthorized changes with the following command: $ sudo grep "^\\s*[^#]" /etc/audit/audit.rules | tail -1 @@ -21,15 +19,21 @@ The audit daemon must be restarted for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61970r926672_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000057-GPOS-00027' + tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029'] tag gid: 'V-258229' tag rid: 'SV-258229r926674_rule' tag stig_id: 'RHEL-09-654275' - tag gtitle: 'SRG-OS-000057-GPOS-00027' tag fix_id: 'F-61894r926673_fix' - tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029'] - tag 'documentable' tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164'] - tag nist: ['AU-9 a', 'AU-9 a', 'AU-9 a'] + tag nist: ['AU-9', 'AU-9 a'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + describe command('grep "^\s*[^#]" /etc/audit/audit.rules | tail -1') do + its('stdout.strip') { should cmp '-e 2' } + end end diff --git a/controls/SV-258230.rb b/controls/SV-258230.rb index 4353db9..f7184d9 100644 --- a/controls/SV-258230.rb +++ b/controls/SV-258230.rb @@ -1,8 +1,6 @@ control 'SV-258230' do title 'RHEL 9 must enable FIPS mode.' - desc 'Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated. This includes NIST FIPS-validated cryptography for the following: Provisioning digital signatures, generating cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards. - -' + desc 'Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated. This includes NIST FIPS-validated cryptography for the following: Provisioning digital signatures, generating cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.' desc 'check', 'Verify that RHEL 9 is in FIPS mode with the following command: $ sudo fips-mode-setup --check @@ -17,15 +15,40 @@ Reboot the system for the changes to take effect.' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61971r926675_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000033-GPOS-00014' + tag satisfies: ['SRG-OS-000033-GPOS-00014', 'SRG-OS-000125-GPOS-00065', 'SRG-OS-000396-GPOS-00176', 'SRG-OS-000423-GPOS-00187', 'SRG-OS-000478-GPOS-00223'] tag gid: 'V-258230' tag rid: 'SV-258230r926677_rule' tag stig_id: 'RHEL-09-671010' - tag gtitle: 'SRG-OS-000033-GPOS-00014' tag fix_id: 'F-61895r926676_fix' - tag satisfies: ['SRG-OS-000033-GPOS-00014', 'SRG-OS-000125-GPOS-00065', 'SRG-OS-000396-GPOS-00176', 'SRG-OS-000423-GPOS-00187', 'SRG-OS-000478-GPOS-00223'] - tag 'documentable' tag cci: ['CCI-000068', 'CCI-000877', 'CCI-002418', 'CCI-002450'] tag nist: ['AC-17 (2)', 'MA-4 c', 'SC-8', 'SC-13 b'] + tag 'host' + + if virtualization.system.eql?('docker') + impact 0.0 + describe 'Control not applicable in a container' do + skip 'The host OS controls the FIPS mode settings. The host OS should also be scanned with the applicable OS validation profile.' + end + elsif input('use_fips') == false + impact 0.0 + describe 'This control is Not Applicable as FIPS is not required for this system' do + skip 'This control is Not Applicable as FIPS is not required for this system' + end + else + describe command('fips-mode-setup --check') do + its('stdout.strip') { should match(/FIPS mode is enabled/) } + end + + grub_config = command('grub2-editenv - list').stdout + + describe parse_config(grub_config) do + its('kernelopts') { should match(/fips=1/) } + end + + describe file('/proc/sys/crypto/fips_enabled') do + its('content.strip') { should cmp '1' } + end + end end diff --git a/controls/SV-258231.rb b/controls/SV-258231.rb index 323916c..cbb8771 100644 --- a/controls/SV-258231.rb +++ b/controls/SV-258231.rb @@ -2,9 +2,9 @@ title 'RHEL 9 must employ FIPS 140-3 approved cryptographic hashing algorithms for all stored passwords.' desc 'The system must use a strong hashing algorithm to store the password. -Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. - -' + Passwords need to be protected at all times, and encryption is the standard +method for protecting passwords. If passwords are not encrypted, they can be +plainly read (i.e., clear text) and easily compromised.' desc 'check', 'Verify that the interactive user account passwords are using a strong password hash with the following command: $ sudo cut -d: -f2 /etc/shadow @@ -14,18 +14,27 @@ Password hashes "!" or "*" indicate inactive accounts not available for logon and are not evaluated. If any interactive user password hash does not begin with "$6", this is a finding.' - desc 'fix', 'Lock all interactive user accounts not using SHA-512 hashing until the passwords can be regenerated with SHA-512.' + desc 'fix', 'Lock all interactive user accounts not using SHA-512 hashing +until the passwords can be regenerated with SHA-512.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61972r926678_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000073-GPOS-00041' tag gid: 'V-258231' tag rid: 'SV-258231r926680_rule' tag stig_id: 'RHEL-09-671015' - tag gtitle: 'SRG-OS-000073-GPOS-00041' tag fix_id: 'F-61896r926679_fix' - tag satisfies: ['SRG-OS-000073-GPOS-00041', 'SRG-OS-000120-GPOS-00061'] - tag 'documentable' tag cci: ['CCI-000196', 'CCI-000803'] tag nist: ['IA-5 (1) (c)', 'IA-7'] + tag 'host' + tag 'container' + + weak_pw_hash_users = inspec.shadow.where { password !~ /^[*!]{1,2}.*$|^\$6\$.*$|^$/ }.users + + describe 'All stored passwords' do + it 'should only be hashed with the SHA512 algorithm' do + message = "Users without SHA512 hashes:\n\t- #{weak_pw_hash_users.join("\n\t- ")}" + expect(weak_pw_hash_users).to be_empty, message + end + end end diff --git a/controls/SV-258232.rb b/controls/SV-258232.rb index d8b6371..731d9ca 100644 --- a/controls/SV-258232.rb +++ b/controls/SV-258232.rb @@ -27,4 +27,19 @@ tag 'documentable' tag cci: ['CCI-000068'] tag nist: ['AC-17 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + expected_value = input('approved_crypto_backend') + + setting_check = command('grep include /etc/ipsec.conf /etc/ipsec.d/*.conf').stdout.strip.match?(/^.*:?[^#]include\s*#{expected_value}$/) + + describe 'RHEL9 IPsec config' do + it "should include the conf file '#{expected_value}'" do + expect(setting_check).to eq(true), "Conf file '#{expected_value}' not included in ipsec config" + end + end end diff --git a/controls/SV-258233.rb b/controls/SV-258233.rb index 4235681..94ad3af 100644 --- a/controls/SV-258233.rb +++ b/controls/SV-258233.rb @@ -19,14 +19,20 @@ password sufficient pam_unix.so sha512' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61974r926684_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000073-GPOS-00041' tag gid: 'V-258233' tag rid: 'SV-258233r926686_rule' tag stig_id: 'RHEL-09-671025' - tag gtitle: 'SRG-OS-000073-GPOS-00041' tag fix_id: 'F-61898r926685_fix' - tag 'documentable' - tag cci: ['CCI-000196'] - tag nist: ['IA-5 (1) (c)'] + tag cci: ['CCI-000803', 'CCI-000196'] + tag nist: ['IA-7', 'IA-5 (1) (c)'] + tag 'host' + tag 'container' + + pam_auth_files = input('pam_auth_files') + + describe pam(pam_auth_files['system-auth']) do + its('lines') { should match_pam_rule('password sufficient pam_unix.so sha512') } + end end diff --git a/controls/SV-258234.rb b/controls/SV-258234.rb index 1a8fca6..e028e5c 100644 --- a/controls/SV-258234.rb +++ b/controls/SV-258234.rb @@ -28,4 +28,13 @@ tag 'documentable' tag cci: ['CCI-002450', 'CCI-002890', 'CCI-003123'] tag nist: ['SC-13 b', 'MA-4 (6)', 'MA-4 (6)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe package('crypto-policies') do + it { should be_installed } + end end diff --git a/controls/SV-258235.rb b/controls/SV-258235.rb index 0af9497..dd46145 100644 --- a/controls/SV-258235.rb +++ b/controls/SV-258235.rb @@ -26,4 +26,13 @@ tag 'documentable' tag cci: ['CCI-002450'] tag nist: ['SC-13 b'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe command('rpm -V crypto-policies') do + its('stdout') { should be_empty } + end end diff --git a/controls/SV-258236.rb b/controls/SV-258236.rb index 02f69d8..650d429 100644 --- a/controls/SV-258236.rb +++ b/controls/SV-258236.rb @@ -42,4 +42,33 @@ tag 'documentable' tag cci: ['CCI-002450', 'CCI-002890', 'CCI-003123'] tag nist: ['SC-13 b', 'MA-4 (6)', 'MA-4 (6)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + crypto_policies_dir = '/etc/crypto-policies/back-ends' + expected_link_path_dir = '/usr/share/crypto-policies/FIPS' + + crypto_policies = command("ls -l #{crypto_policies_dir} | awk \'{ print $9 }\'").stdout.strip.split("\n") + + failing_crypto_policies = {} + + crypto_policies.each do |crypto_policy| + service = "#{crypto_policies_dir}/#{crypto_policy}" + link_path = file(service).link_path + + if link_path.nil? + failing_crypto_policies[service] = 'No link path found' + elsif !link_path.match?(/^#{expected_link_path_dir}/) + failing_crypto_policies[service] = link_path + end + end + + describe 'Crypto policies' do + it 'should link to the correct libriries' do + expect(failing_crypto_policies).to be_empty, "Failing crypto policies:\n\t- #{failing_crypto_policies}" + end + end end diff --git a/controls/SV-258237.rb b/controls/SV-258237.rb index 6825e9a..5d93a24 100644 --- a/controls/SV-258237.rb +++ b/controls/SV-258237.rb @@ -27,4 +27,9 @@ tag 'documentable' tag cci: ['CCI-000803'] tag nist: ['IA-7'] + tag 'host' + + describe file('/etc/crypto-policies/back-ends/krb5.config') do + its('link_path') { should match(%r{/usr/share/crypto-policies/FIPS}) } + end end diff --git a/controls/SV-258238.rb b/controls/SV-258238.rb index e1c551e..b493cee 100644 --- a/controls/SV-258238.rb +++ b/controls/SV-258238.rb @@ -4,9 +4,7 @@ Transport Layer Security (TLS) encryption is a required security setting as a number of known vulnerabilities have been reported against Secure Sockets Layer (SSL) and earlier versions of TLS. Encryption of private information is essential to ensuring data confidentiality. If private information is not encrypted, it can be intercepted and easily read by an unauthorized party. SQL Server must use a minimum of FIPS 140-3 approved TLS version 1.2, and all non-FIPS-approved SSL and TLS versions must be disabled. NIST 800-53 specifies the preferred configurations for government systems. -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -' +Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.' desc 'check', 'Verify if GnuTLS uses defined DOD-approved TLS Crypto Policy with the following command: $ update-crypto-policies --show @@ -20,15 +18,25 @@ A reboot is required for the changes to take effect.' impact 0.7 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61979r926699_chk' tag severity: 'high' + tag gtitle: 'SRG-OS-000250-GPOS-00093' + tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000423-GPOS-00187'] tag gid: 'V-258238' tag rid: 'SV-258238r926701_rule' tag stig_id: 'RHEL-09-672030' - tag gtitle: 'SRG-OS-000250-GPOS-00093' tag fix_id: 'F-61903r926700_fix' - tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000423-GPOS-00187'] - tag 'documentable' tag cci: ['CCI-001453', 'CCI-002418'] tag nist: ['AC-17 (2)', 'SC-8'] + tag 'host' + tag 'container' + + gnutls = file('/etc/crypto-policies/back-ends/gnutls.config').content.upcase.strip.split(':') + unapproved_versions = input('unapproved_ssl_tls_versions').map(&:upcase) + failing_versions = unapproved_versions - gnutls + + describe 'GnuTLS' do + it 'should disable unapproved SSL/TLS versions' do + expect(failing_versions).to be_empty, "GnuTLS should not allow:\n\t- #{failing_versions.join("\n\t- ")}" + end + end end diff --git a/controls/SV-258239.rb b/controls/SV-258239.rb index 6b8f3f3..c7fe663 100644 --- a/controls/SV-258239.rb +++ b/controls/SV-258239.rb @@ -21,14 +21,24 @@ .include = /etc/crypto-policies/back-ends/opensslcnf.config' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61980r926702_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000250-GPOS-00093' + tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065'] tag gid: 'V-258239' tag rid: 'SV-258239r926704_rule' tag stig_id: 'RHEL-09-672035' - tag gtitle: 'SRG-OS-000250-GPOS-00093' tag fix_id: 'F-61904r926703_fix' - tag 'documentable' tag cci: ['CCI-001453'] tag nist: ['AC-17 (2)'] + tag 'host' + tag 'container-conditional' + + only_if("Checking the host's FIPS compliance can't be done within the container and should be reveiwed at the host level.") { + !(virtualization.system.eql?('docker') && !file('/etc/pki/tls/openssl.cnf').exist?) + } + + describe 'A line in the OpenSSL config file' do + subject { command('grep -i opensslcnf.config /etc/pki/tls/openssl.cnf').stdout.strip } + it { should match(/^\.include.*opensslcnf.config$/) } + end end diff --git a/controls/SV-258240.rb b/controls/SV-258240.rb index 299c535..dd47705 100644 --- a/controls/SV-258240.rb +++ b/controls/SV-258240.rb @@ -23,14 +23,28 @@ A reboot is required for the changes to take effect.' impact 0.5 ref 'DPMS Target Red Hat Enterprise Linux 9' - tag check_id: 'C-61981r926705_chk' tag severity: 'medium' + tag gtitle: 'SRG-OS-000250-GPOS-00093' + tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065'] tag gid: 'V-258240' tag rid: 'SV-258240r926707_rule' tag stig_id: 'RHEL-09-672040' - tag gtitle: 'SRG-OS-000250-GPOS-00093' tag fix_id: 'F-61905r926706_fix' - tag 'documentable' tag cci: ['CCI-001453'] tag nist: ['AC-17 (2)'] + tag 'host' + tag 'container' + + crypto_policies = package('crypto-policies') + + if crypto_policies.version < '20210617-1.gitc776d3e.el8.noarch' + describe parse_config_file('/etc/crypto-policies/back-ends/opensslcnf.config') do + its('MinProtocol') { should be_in ['TLSv1.2', 'TLSv1.3'] } + end + else + describe parse_config_file('/etc/crypto-policies/back-ends/opensslcnf.config') do + its(['TLS.MinProtocol']) { should be_in ['TLSv1.2', 'TLSv1.3'] } + its(['DTLS.MinProtocol']) { should be_in ['DTLSv1.2', 'DTLSv1.3'] } + end + end end diff --git a/controls/SV-258241.rb b/controls/SV-258241.rb index 2a43874..aad752c 100644 --- a/controls/SV-258241.rb +++ b/controls/SV-258241.rb @@ -34,4 +34,13 @@ tag 'documentable' tag cci: ['CCI-002450', 'CCI-002890', 'CCI-003123'] tag nist: ['SC-13 b', 'MA-4 (6)', 'MA-4 (6)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe command('update-crypto-policies --show') do + its('stdout') { should match(/FIPS/) } + end end diff --git a/controls/SV-258242.rb b/controls/SV-258242.rb index 306337a..654d62e 100644 --- a/controls/SV-258242.rb +++ b/controls/SV-258242.rb @@ -34,4 +34,23 @@ tag 'documentable' tag cci: ['CCI-002418', 'CCI-002422'] tag nist: ['SC-8', 'SC-8 (2)'] + tag 'host' + + only_if('This control is Not Applicable to containers', impact: 0.0) { + !virtualization.system.eql?('docker') + } + + describe file('/etc/named.conf') do + it { should exist } + end + + bind_grep = command('grep include /etc/named.conf').stdout.lines.map(&:strip) + + bind_conf = bind_grep.any? { |line| line.match?(%r{/etc/crypto-policies/back-ends/bind.config$}i) } + + describe 'Bind config file' do + it 'should include system-wide crypto policies' do + expect(bind_conf).to eq(true), 'Bind conf files do not include /etc/crypto-policies/back-ends/bind.config' + end + end end diff --git a/hardened.threshold.yml b/hardened.threshold.yml index 36ecc86..88a6cec 100644 --- a/hardened.threshold.yml +++ b/hardened.threshold.yml @@ -1,5 +1,5 @@ compliance: - min: 84 + min: 75 error: total: max: 0 diff --git a/inspec.yml b/inspec.yml index 5e2dfd7..8cbade0 100644 --- a/inspec.yml +++ b/inspec.yml @@ -6,3 +6,1194 @@ license: Apache-2.0 summary: "InSpec profile aligned to DISA STIG for RHEL9" version: 1.2.0 inspec_version: ">= 6.0" + +supports: + - platform-name: redhat + release: 9.* + +### INPUTS ### +# Inputs are variables that can be referenced by any control in the profile, +# and are defined and given a default value in this file. + +# By default, each parameter is set to exactly comply with the STIG baseline +# wherever possible. Some STIG controls will require you to update an input +# to provide the profile with necessary context for your system. + +# For example, control SV-230379 checks that only 'necessary accounts' exist +# on the system. The list of 'necessary' accounts depends on the function of +# the system, and you will likely need to add approved accounts to the +# 'known_system_accounts' input. Also, depending on your local organizational +# security policy, you may need to deviate from the STIG on some controls to +# make the test profile 'stricter' or 'looser.' + +# In both cases, you can override the default values given in this file +# using an input file or a CLI flag at execution time. See InSpec's Inputs docs +# at https://docs.chef.io/inspec/profiles/inputs/ for details. + +# NOTE: DO NOT directly change the default values by editing this file. Use +# overrides instead. +### + +inputs: + # SV-230271, SV-237643 + - name: sudoers_config_files + description: 'The files and directories you keep your sudoers configs' + type: Array + value: + - '/etc/sudoers' + - '/etc/sudoers.d/*' + + #SV-230271 + - name: passwordless_admins + description: List of administrative groups permitted by ISSO to have NOPASSWD set in sudoers files + type: Array + value: [] + + # SV-244528, SV-244525 + - name: sshd_config_values + description: 'The agreed sshd server config values for the organization' + type: Hash + value: + GSSAPIAuthentication: 'no' + ClientAliveInterval: '600' + + # SV-230274 + - name: alternate_mfa_method + description: Name of the MFA method in place on the system (leave blank if using the default SSSD, give the name if using an approved alternate method) + type: String + value: '' + + # SV-230274 + - name: sssd_conf_files + description: File and directory globs to check for SSSD configuration + type: Array + value: + - /etc/sssd/sssd.conf + - /etc/sssd/conf.d/*.conf + + # SV-230275 + - name: piv_driver + description: OpenSC driver responsible for handling PIV cards + type: String + value: "PIV-II" + + # SV-230286, SV-230287 + - name: ssh_host_key_dirs + description: Directories where public host SSH keys for the server are stored + type: Array + value: + - /etc/ssh/ + - /home/ + + # SV-230286 + - name: ssh_pub_key_mode + description: All public ssh keyfiles on the filesystem should be equal or less permissive than this octet + type: String + value: '0644' + + + # SV-230287 + - name: ssh_private_key_mode + description: All private ssh keyfiles on the filesystem should be equal or less permissive than this octet + type: String + value: '0640' + + # SV-230471 + - name: audit_conf_mode + description: All audit config files on the filesystem should be equal or less permissive than this octet + type: String + value: '0640' + + # SV-230472 + - name: audit_tool_mode + description: All audit config tools on the filesystem should be equal or less permissive than this octet + type: String + value: '0755' + + # SV-230321 + - name: home_dir_mode + description: All interactive user home directories should have permissions equal to or less than this octet + type: String + value: "0750" + + - name: expected_modes + description: Expected modes of system files and/or directories + type: Hash + value: + home_dirs: "0750" + cron_dirs: "0700" + /etc/group: "0644" + /etc/group-: "0644" + /etc/gshadow: "0000" + /etc/gshadow-: "0000" + /etc/passwd: "0644" + /etc/passwd-: "0644" + /etc/shadow: "0000" + /etc/shadow-: "0000" + /etc/crontab: "0600" + /etc/ssh/sshd_config: "0600" + auditd_conf: "0640" + + # SV-230321 TODO: fold this into expected_system_file_mode + - name: initialization_file_mode + description: All initialization files (.bash_profile etc) should have permissions equal to or less than this octet + type: String + value: '0740' + + # SV-244543 + - name: alert_method + description: 'The method used to provide real-time information to the ISSO or AO' + type: String + value: email + + # SV-244547 + - name: peripherals_package + description: "The name of the package used to managed connected peripherals" + type: String + value: "usbguard" + + # SV-244548 + - name: peripherals_service + description: "The name of the service used to managed connected peripherals" + type: String + value: "usbguard" + + # SV-244549 + - name: allow_container_openssh_server + description: "If the OpenSSH Server has been approved outside standard container guidance to default transprots" + type: Boolean + value: false + + # SV-230360 + - name: maxclassrepeat + description: "The maximum number of repeating characters of the same character class for passwords" + type: Numeric + value: 4 + + # SV-230361 + - name: maxrepeat + description: "The maximum number of repeating characters when passwords are updated" + type: Numeric + value: 3 + + # SV-230362 + - name: minclass + description: "The minimum number of character classes that should change when passwords are updated" + type: Numeric + value: 4 + + # SV-258112 + - name: difok + description: "The minimum number of required changed characters when passwords are updated." + type: Numeric + value: 8 + + # SV-230363 + - name: pass_min_days + description: "The minimum password lifetime restriction in days" + type: Numeric + value: 1 + + # SV-230366 + - name: pass_max_days + description: "The maximum password lifetime restriction in days" + type: Numeric + value: 60 + + # SV-230328 + - name: separate_filesystem_exempt + description: "The system manages file system useage, LVM/XFS etc. or is managed by the service provider" + type: Boolean + value: false + + # SV-230309 + - name: disable_slow_controls + description: Controls that are known to consistently have long run times can be disabled with this attribute + type: Boolean + value: false + + # SV-230222 + - name: disconnected_system + description: The system is not connected to the public internet or doesn't have access to a RPM package server + type: Boolean + value: false + + # SV-230223 + - name: use_fips + description: "'(boolean)' Set to true if the system is required to use FIPS Encryption" + type: Boolean + value: true + + # SV-230224 + - name: data_at_rest_exempt + description: "'(boolean) Set to true if the system is exempt from using Data at Rest" + type: Boolean + value: false + + # SV-230368 + - name: min_reuse_generations + description: Number of reuse generations + type: Numeric + value: 5 + + # SV-251714 + - name: min_retry + description: Number of permitted password retries + type: Numeric + value: 3 + + # SV-230369, SV-230370 + - name: pass_min_len + description: Minimum number of characters for a new password + type: Numeric + value: 15 + + # SV-250315, SV-250316 + - name: "faillock_tally" + description: The default SELinux security context type of the non-default tally directory + type: String + value: "faillog_t" + + # SV-250317 + - name: network_router + description: This indicates if the system is acting as a rounter on the network + type: Boolean + value: false + + # SV-230266, SV-230267, SV-230268, SV-250317 + - name: sysctl_conf_files + description: The system files that have sysctl configuration information + type: Array + value: + - "/etc/sysctl.d/*.conf" + - "/run/sysctl.d/*.conf" + - "/usr/local/lib/sysctl.d/*.conf" + - "/usr/lib/sysctl.d/*.conf" + - "/lib/sysctl.d/*.conf" + - "/etc/sysctl.conf" + + # SV-230310, SV-230311 + - name: kernel_dump_expected_value + description: Expected value for the kernel dump setting + type: String + value: '|/bin/false' + + # SV-230313 + - name: core_dump_expected_value + description: Expected value for the core dump setting + type: Numeric + value: 0 + + # SV-230346 + - name: concurrent_sessions_permitted + description: Number of permitted concurrent sessions on this system + type: Numeric + value: 10 + + # SV-230234 + - name: grub_uefi_main_cfg + description: Main grub boot config file + type: String + value: "/boot/efi/EFI/redhat/grub.cfg" + + # SV-230234 + - name: grub_uefi_user_boot_files + description: Grub boot config files + type: Array + value: ["/boot/efi/EFI/redhat/user.cfg"] + + # SV-257787, SV-257789 + - name: grub_conf_path + description: Grub config filepath + type: String + value: '/etc/grub2.cfg' + + # SV-257787 + - name: grub_user_conf_path + description: Grub user config filepath + type: String + value: '/boot/grub2/user.cfg' + + # SV-257789 + - name: disallowed_grub_superusers + description: List of default users that cannot be the default GRUB superuser + type: Array + value: + - root + - admin + - administrator + + # SV-230317, SV-230320, SV-230321, SV-230322, SV-230325, SV-230328,SV-230264, SV-230267 + - name: exempt_home_users + description: Users exempt from home directory-based controls in array format + type: Array + value: + - root + + # SV-230309, SV-230317, SV-230320, SV-230321, SV-230322, SV-230325, SV-230328. SV-230384, SV-244531, SV-244532 + - name: non_interactive_shells + description: These shells do not allow a user to login + type: Array + value: + - "/sbin/nologin" + - "/sbin/halt" + - "/sbin/shutdown" + - "/bin/false" + - "/bin/sync" + - "/bin/true" + + # SV-258046 + - name: interactive_system_account_exemptions + description: System accounts that are exempt from the non-interactive shell requirement + type: Array + value: + - root + + # SV-230379 + - name: user_accounts + description: Accounts of known managed users + type: Array + value: ["vagrant"] + + # SV-230235 + - name: grub_main_cfg + description: Main grub boot config file + type: String + value: "/boot/grub2/grub.cfg" + + # SV-230256 + - name: unapproved_ssl_tls_versions + description: + type: Array + value: + - -VERS-DTLS0.9 + - -VERS-SSL3.0 + - -VERS-TLS1.0 + - -VERS-TLS1.1 + - -VERS-DTLS1.0 + + # SV-230235 + - name: grub_user_boot_files + description: Grub boot config files + type: Array + value: + - "/boot/grub2/user.cfg" + + # SV-230537 + - name: ipv4_enabled + description: Set to 'true' if IPv4 is enabled on the system. + type: Boolean + value: true + + # SV-230332, SV-230333 + - name: unsuccessful_attempts + description: The number of allowed failed login attempts + type: Numeric + value: 3 + + # SV-230332 + - name: central_account_management + description: The system is using a central account management system to manage user acoutns and security + type: Boolean + value: false + + # SV-230537 + - name: ipv6_enabled + description: Set to 'true' if IPv6 is enabled on the system. + type: Boolean + value: true + + # SV-230493 + - name: camera_installed + description: Device or system does not have a camera installed. + type: Boolean + value: true + + # SV-230503 + - name: bluetooth_installed + description: "Device or operating system has a Bluetooth adapter installed" + type: Boolean + value: true + + # SV-230379, SV-230242 + - name: known_system_accounts + description: System accounts that support approved system activities. + type: Array + value: + - adm + - bin + - chrony + - daemon + - dbus + - halt + - lp + - mail + - nobody + - ntp + - operator + - polkitd + - postfix + - root + - shutdown + - sshd + - sssd + - sync + - systemd-bus-proxy + - systemd-network + + # SV-230273, SV-230275, SV-230351, SV-230372, SV-230376 + - name: smart_card_enabled + description: Smart card status of the system + type: Boolean + value: false + + # SV-230263 + - name: file_integrity_tool + description: Name of tool + type: String + value: "aide" + + # SV-230484 + - name: authoritative_timeserver + description: Timeserver used in /etc/chrony.conf + type: String + value: 0.us.pool.ntp.mil + + # SV-230537 + - name: non_removable_media_fs + description: File systems listed in /etc/fstab which are not removable media devices + type: Array + value: ["/", "/tmp", "none", "/home", "/tmpfs"] + + # SV-230230 + - name: private_key_files + description: List of full paths to private key files on the system + type: Array + value: [] + + # SV-230251 + - name: openssh_server_required_algorithms + description: List of MACs employing FIPS 140-2-approved algorithms (order matters) + type: Array + value: + - "hmac-sha2-512" + - "hmac-sha2-256" + - "hmac-sha2-512-etm@openssh.com" + - "hmac-sha2-256-etm@openssh.com" + + # SV-230229 + - name: root_ca_file + description: Path to an accepted trust anchor certificate file (DoD) + type: String + value: "/etc/sssd/pki/sssd_auth_ca_db.pem" + + # SV-230333 + - name: unsuccessful_attempts + description: Maximum number of unsuccessful attempts before lockout + type: Numeric + value: 3 + + # SV-230353 + - name: system_inactivity_timeout + description: Maximum system inactivity timeout (time in seconds). + type: Numeric + value: 900 + + # SV-230373 + - name: days_of_inactivity + description: Maximum number of days if account inactivity before account lockout + type: Numeric + value: 35 + + # SV-230331, SV-230441, SV-230374 + - name: temporary_accounts + description: Temporary user accounts + type: Array + value: [] + + # SV-230331 + - name: temporary_account_max_days + description: Max number of days a temporary account should be permitted to exist + type: Numeric + value: 3 + + # SV-230227 + - name: banner_message_text_cli + description: Banner message text for command line interface logins. + type: String + value: + "You are accessing a U.S. Government (USG) Information System (IS) that is \ + provided for USG-authorized use only. By using this IS (which includes any \ + device attached to this IS), you consent to the following conditions: -The USG \ + routinely intercepts and monitors communications on this IS for purposes \ + including, but not limited to, penetration testing, COMSEC monitoring, network \ + operations and defense, personnel misconduct (PM), law enforcement (LE), and \ + counterintelligence (CI) investigations. -At any time, the USG may inspect and \ + seize data stored on this IS. -Communications using, or data stored on, this \ + IS are not private, are subject to routine monitoring, interception, and \ + search, and may be disclosed or used for any USG-authorized purpose. -This IS \ + includes security measures (e.g., authentication and access controls) to \ + protect USG interests--not for your personal benefit or privacy. \ + -Notwithstanding the above, using this IS does not constitute consent to PM, \ + LE or CI investigative searching or monitoring of the content of privileged \ + communications, or work product, related to personal representation or \ + services by attorneys, psychotherapists, or clergy, and their assistants. Such \ + communications and work product are private and confidential. See User \ + Agreement for details." + + # SV-230225 + - name: banner_message_text_ral + description: Banner message text for remote access logins. + type: String + value: + "You are accessing a U.S. Government (USG) Information System (IS) that is \ + provided for USG-authorized use only. By using this IS (which includes any \ + device attached to this IS), you consent to the following conditions: -The USG \ + routinely intercepts and monitors communications on this IS for purposes \ + including, but not limited to, penetration testing, COMSEC monitoring, network \ + operations and defense, personnel misconduct (PM), law enforcement (LE), and \ + counterintelligence (CI) investigations. -At any time, the USG may inspect and \ + seize data stored on this IS. -Communications using, or data stored on, this \ + IS are not private, are subject to routine monitoring, interception, and \ + search, and may be disclosed or used for any USG-authorized purpose. -This IS \ + includes security measures (e.g., authentication and access controls) to \ + protect USG interests--not for your personal benefit or privacy. \ + -Notwithstanding the above, using this IS does not constitute consent to PM, \ + LE or CI investigative searching or monitoring of the content of privileged \ + communications, or work product, related to personal representation or \ + services by attorneys, psychotherapists, or clergy, and their assistants. Such \ + communications and work product are private and confidential. See User \ + Agreement for details." + + # SV-230226 + - name: banner_message_text_gui + description: Banner message text for graphical user interface logins. + type: String + value: + "You are accessing a U.S. Government (USG) Information System (IS) that is \ + provided for USG-authorized use only. By using this IS (which includes any \ + device attached to this IS), you consent to the following conditions: -The USG \ + routinely intercepts and monitors communications on this IS for purposes \ + including, but not limited to, penetration testing, COMSEC monitoring, network \ + operations and defense, personnel misconduct (PM), law enforcement (LE), and \ + counterintelligence (CI) investigations. -At any time, the USG may inspect and \ + seize data stored on this IS. -Communications using, or data stored on, this \ + IS are not private, are subject to routine monitoring, interception, and \ + search, and may be disclosed or used for any USG-authorized purpose. -This IS \ + includes security measures (e.g., authentication and access controls) to \ + protect USG interests--not for your personal benefit or privacy. \ + -Notwithstanding the above, using this IS does not constitute consent to PM, \ + LE or CI investigative searching or monitoring of the content of privileged \ + communications, or work product, related to personal representation or \ + services by attorneys, psychotherapists, or clergy, and their assistants. Such \ + communications and work product are private and confidential. See User \ + Agreement for details." + + # SV-230346 + - name: maxlogins_limit + description: Amount of max logins allowed + type: Numeric + value: 10 + + # SV-230335 + - name: fail_interval + description: Interval of time in which the consecutive failed logon attempts must occur in order for the account to be locked out (time in seconds) + type: Numeric + value: 900 + + # SV-258057 + - name: lockout_time + description: Minimum amount of time account must be locked out after failed logins. '0' indicates an account should not unlock until reset by an admin. + type: Numeric + value: 0 + + - name: system_activity_timeout + description: The expected maximum delay in seconds before the system will lock the session + type: Numeric + value: 900 + + # SV-230338, SV-230339 + - name: log_directory + description: Documented tally log directory + type: String + value: /var/log/faillock + + # SV-230244 + - name: sshd_client_alive_count_max + description: all network connections associated with SSH traffic are terminated at the end of the session or after 10 minutes of inactivity + type: Numeric + value: 1 + + # SV-245540 + - name: linux_threat_prevention_package + description: Endpoint Security Linux Threat Prevention Tool Package + type: String + value: mcafeetp + + # SV-245540 + - name: linux_threat_prevention_service + description: Endpoint Security Linux Threat Prevention Tool Service + type: String + value: mfetpd + + # SV-230553 + - name: remove_xorg_x11_server_packages + description: Graphical Display Manager must not be installed + type: Array + value: + - xorg-x11-server-common + - xorg-x11-server-Xorg + - xorg-x11-server-utils + - xorg-x11-server-Xwayland + + # SV-251718 + - name: gui_required + description: Set to true if there is a documented requirement for the target system to have a graphical user interface enabled + type: Boolean + value: false + + # SV-230390 + - name: disk_error_action + description: Must take appropriate action when an audit processing failure occurs. + type: Array + value: + - SYSLOG + - SINGLE + - HALT + + # SV-230392 + - name: disk_full_action + description: Audit system must take appropriate action when the audit storage volume is full. + type: Array + value: + - SYSLOG + - SINGLE + - HALT + + # SV-258158 + - name: admin_space_left + description: The percentage of space left on the audit storage volume that will trigger the system to take action + type: String + value: "5%" + + # SV-258159 + - name: admin_space_left_action + description: Action the system should take when the audit storage volume is full + type: String + value: "SINGLE" + + # SV-258160 + - name: max_log_file_action + description: Action the system should take when the audit files have reached maximum size + type: String + value: "ROTATE" + + # SV-258168 + - name: audit_flush_threshold + description: Threshold at which the audit system should flush the audit logs to disk + type: Numeric + value: 100 + + # SV-230296 + - name: permit_root_login + description: Whether to permit direct logons to the root account using remote access via SSH + type: String + value: "no" + + # SV-230385, SV-230383 + - name: permissions_for_shells + description: Define default permissions for logon and non-logon shells. + type: Hash + value: + default_umask: "077" + bashrc_umask: "077" + cshrc_umask: "077" + profile_umask: "077" + + # SV-251707 + - name: permissions_for_libs + description: Define default permissions for system libraries + type: String + value: "0755" + + # SV-251707, SV-251708, SV-251709 + - name: system_libraries + description: Define system libraries which should have strict permissions enforced + type: Array + value: + - /lib + - /lib64 + - /usr/lib + - /usr/lib64 + + # SV-230257 + - name: system_command_dirs + description: Directories containing system command executables + type: Array + value: + - /bin + - /sbin + - /usr/bin + - /usr/sbin + - /usr/libexec + - /usr/local/bin + - /usr/local/sbin + + # SV-257887 + - name: audit_tools + description: Paths to tools related to audit function + tpye: Array + value: + - /sbin/auditctl + - /sbin/aureport + - /sbin/ausearch + - /sbin/autrace + - /sbin/auditd + - /sbin/rsyslogd + - /sbin/augenrules + + #SV-251709 + - name: required_system_accounts + description: List of system accounts permitted to group-own system libraries + type: Array + value: + - root + + # SV-230247 + - name: var_log_messages_group + description: Group owner of /var/log/messages file + type: Array + value: + - root + + # SV-230274 + - name: sssd_certificate_verification + description: Certificate status checking for multifactor authentication. + type: String + value: "ocsp_dgst=sha1" + + # SV-230372 + - name: sssd_conf_path + description: Path of the sssd_conf file + type: String + value: /etc/sssd/sssd.conf + + # SV-230398 + - name: var_log_audit_group + description: Group owner of /var/log/audit/audit.log + type: Array + value: + - root + + # SV-230523, SV-244545, SV-244546 + - name: use_fapolicyd + description: Whether to use fapolicyd, similar to SELinux whitelisting + type: Boolean + value: true + + # SV-230334 + - name: pam_auth_files + description: THe pam.d auth paths + type: Hash + value: + system-auth: /etc/pam.d/system-auth + password-auth: /etc/pam.d/password-auth + smartcard-auth: /etc/pam.d/smartcard-auth + + # SV-230335 + - name: security_faillock_conf + description: The security faillock configuration file + type: String + value: /etc/security/faillock.conf + + # SV-244544, SV-230504 + - name: external_firewall + description: "The system use an external firewall or service vs a local firewall service" + type: Boolean + value: false + + # SV-230500 + - name: firewalld_properties + description: Ports, Protocols and Services Rules + type: Hash + value: + default_zone: public + ports: [] + protocols: [] + services: + - cockpit + - dhcpv6-client + - ssh + + # SV-230511, SV-230512, SV-230513 + - name: mount_tmp_options + description: rhel_08_04012[3-5] - RHEL 9 must mount /tmp with the (nodev|nosuid|noexec) option. + type: Hash + value: + nodev: false + nosuid: false + noexec: false + + # SV-230271 + - name: skip_password_privilege_escalation + description: rhel_08_010380 - RHEL 8 must require users to provide a password for privilege escalation. + type: Boolean + value: false + + # SV-245540 + - name: skip_endpoint_security_tool + description: rhel_08_010001 - The RHEL 8 operating system must implement the Endpoint Security for Linux Threat Prevention tool. + type: Boolean + value: false + + # SV-250315, SV-250316 + - name: non_default_tally_dir + description: The directory used by pam_faillock + type: String + value: /var/log/faillock + + # SV-250706 + - name: users_allowed_blank_passwords + description: Users allowed to not have a password set + type: Array + value: [] + + # SV-256974 + - name: mail_package + description: Command that is used to send email messages + type: String + value: mailx + + # SV-256973 + - name: rpm_gpg_file + description: Red Hat uses GPG keys labels defined in file + type: String + value: /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release + + # SV-256973 + - name: rpm_gpg_keys + description: Red Hat uses GPG keys labels with matching fingerprints + type: Hash + value: + "release key 2": "567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51" + "auxiliary key": "6A6A A7C9 7C88 90AE C6AE BFE2 F76F 66C3 D408 2792" + + # SV-254520 + - name: administrator_users + description: List of users who are allowed to have an administrator-level SELinux role + type: Array + value: + - root + + # SV-254520 + - name: allowed_admin_selinux_roles + description: List of SELinux roles that administrator users are allowed to have (as defined by the organization) + type: Array + value: + - sysadm_u + - staff_u + + # SV-254520 + - name: allowed_non_admin_selinux_roles + description: List of SELinux roles that regular, non-administrator users are allowed to have (as defined by the organization) + type: Array + value: + - user_u + + # SV-258068 + - name: stop_idle_session_sec + description: Number of seconds the system can be idle before session timeout + type: Numeric + value: 900 + + # SV-230233 + - name: sha_crypt_min_rounds + description: Minimum rounds of hashing during password encryption + type: Numeric + value: 5000 + + # SV-230233 + - name: sha_crypt_max_rounds + description: Maximum rounds of hashing during password encryption + type: Numeric + value: 5000 + + # SV-230378 + - name: login_prompt_delay + description: Delay in seconds before the login prompt is displayed again after a failed login attempt + type: Numeric + value: 4 + + # SV-230387 + - name: logging_conf_files + description: Configuration files for the logging service + type: Array + value: + - /etc/rsyslog.conf + - /etc/rsyslog.d/*.conf + + # SV-230389 + - name: alternative_logging + description: Flag to indicate that a non-standard logging method is in use (instead of auditd and other built-in OS logging features) + type: Boolean + value: false + + # SV-230389 + - name: alternative_logging_method + description: Alternative tool for logging (instead of auditd and other built-in OS logging features) - leave blank if using default OS tools + type: String + value: "" + + # SV-230469 + - name: expected_backlog_limit + description: The maximum number of audit records that can be stored in the audit buffer + type: Numeric + value: 8192 + + # SV-230483 + - name: audit_storage_threshold + description: The percentage threshold of space remaining in the audit storage volume before the system should take action + type: Numeric + value: 25 + + # SV-230502 + - name: autofs_required + description: Set to true if there is a documented requirement for the target system to have autofs enabled + type: Boolean + value: false + + # SV-230503 + - name: usb_storage_required + description: Set to true if there is a documented requirement for the target system to use USB storage + type: Boolean + value: false + + # SV-230533 + - name: tftp_required + description: Set to true if there is a documented requirement for the target system to use TFTP + type: Boolean + value: false + + # SV-230558 + - name: ftp_required + description: Set to true if there is a documented requirement for the target system to use FTP + type: Boolean + value: false + + # SV-230554 + - name: promiscuous_mode_required + description: Set to true if there is a documented requirement for the target system to use promiscuous mode + type: Boolean + value: false + + # SV-230559 + - name: gssproxy_required + description: Set to true if there is a documented requirement for the target system to use gss_proxy + type: Boolean + value: false + + # SV-230560 + - name: iprutils_required + description: Set to true if there is a documented requirement for the target system to use iprutils + type: Boolean + value: false + + # SV-230561 + - name: tuned_required + description: Set to true if there is a documented requirement for the target system to use tuned + type: Boolean + value: false + + # SV-230640 + - name: kerberos_required + description: Set to true if there is a documented requirement for the target system to use Kerberos auth + type: Boolean + value: false + + # SV-230505 + - name: alternate_firewall_tool + description: Alternate firewall tool (other than firewalld) in use for the system - leave blank if using default OS tools + type: String + value: "" + + # SV-230506 + - name: wifi_hardware + description: Set to false if there is no wireless network capability on board the system + type: Boolean + value: true + + # SV-230506 + - name: system_is_workstation + description: Set to true if the system is a workstation + type: Boolean + value: false + + # Default values for expected keynames for all audit rules + # NOTE: DO NOT override this hash + # If you need to override these values, do so via adding the desired key/value to + # the `audit_rule_keynames_overrides` input instead -- overriding `audit_rule_keynames` + # directly will lose the values for any key you do not explictly define. + - name: audit_rule_keynames + description: The audit rules to be applied to the system + type: Hash + value: { + 'execve' : 'execpriv', + '/etc/shadow' : 'identity', + '/etc/security/opasswd' : 'identity', + '/etc/passwd' : 'identity', + '/etc/gshadow' : 'identity', + '/etc/group' : 'identity', + '/etc/sudoers' : 'identity', + '/etc/sudoers.d' : 'identity', + '/usr/bin/su' : 'privileged-priv_change', + 'setxattr' : 'perm_mod', + 'fsetxattr' : 'perm_mod', + 'lsetxattr' : 'perm_mod', + 'removexattr' : 'perm_mod', + 'fremovexattr' : 'perm_mod', + 'lremovexattr' : 'perm_mod', + '/usr/bin/chage' : 'privileged-chage', + '/usr/bin/chcon' : 'perm_mod', + '/usr/bin/ssh-agent' : 'privileged-ssh', + '/usr/bin/passwd' : 'privileged-passwd', + '/usr/bin/mount' : 'privileged-mount', + '/usr/bin/umount' : 'privileged-mount', + 'mount' : 'privileged-mount', + '/usr/sbin/unix_update' : 'privileged-unix-update', + '/usr/sbin/postdrop' : 'privileged-unix-update', + '/usr/sbin/postqueue' : 'privileged-unix-update', + '/usr/sbin/semanage' : 'privileged-unix-update', + '/usr/sbin/setfiles' : 'privileged-unix-update', + '/usr/sbin/userhelper' : 'privileged-unix-update', + '/usr/sbin/setsebool' : 'privileged-unix-update', + '/usr/sbin/unix_chkpwd' : 'privileged-unix-update', + '/usr/libexec/openssh/ssh-keysign' : 'privileged-ssh', + '/usr/bin/setfacl' : 'perm_mod', + '/usr/sbin/pam_timestamp_check' : 'privileged-pam_timestamp_check', + '/usr/bin/newgrp' : 'priv_cmd', + 'init_module' : 'module_chng', + 'finit_module' : 'module_chng', + 'rename' : 'delete', + 'unlink' : 'delete', + 'rmdir' : 'delete', + 'renameat' : 'delete', + 'unlinkat' : 'delete', + '/usr/bin/gpasswd' : 'privileged-gpasswd', + 'delete_module' : 'module_chng', + '/usr/bin/crontab' : 'privileged-crontab', + '/usr/bin/chsh' : 'priv_cmd', + 'truncate' : 'perm_access', + 'ftruncate' : 'perm_access', + 'creat' : 'perm_access', + 'open' : 'perm_access', + 'openat' : 'perm_access', + 'open_by_handle_at' : 'perm_access', + 'chown' : 'perm_mod', + 'fchown' : 'perm_mod', + 'fchownat' : 'perm_mod', + 'lchown' : 'perm_mod', + 'chmod' : 'perm_mod', + 'fchmod' : 'perm_mod', + 'fchmodat' : 'perm_mod', + '/usr/bin/sudo' : 'priv_cmd', + '/usr/sbin/usermod' : 'privileged-usermod', + '/usr/bin/chacl' : 'perm_mod', + '/usr/bin/kmod' : 'modules', + '/var/log/faillock' : 'logins', + '/var/log/lastlog' : 'logins', + '/usr/bin/sudoedit' : 'priv_cmd', + '/usr/sbin/init' : 'privileged-init', + '/usr/sbin/poweroff' : 'privileged-poweroff', + '/usr/sbin/reboot' : 'privileged-reboot', + '/usr/sbin/shutdown' : 'privileged-shutdown', + '/usr/bin/umount' : 'privileged-mount', + 'umount2' : 'perm_mod', + '/var/log/faillock' : 'logins', + '/var/log/tallylog' : 'logins' + } + + # Override values for expected keynames for all audit rules + # Override this hash to change the default values for the audit_rule_keynames + # Any keys you do not explictly add to this input will use the default values + # as given in `audit_rule_keynames` + # Example: + # { + # 'execve': 'my_org_specific_keyname_for_auditing_execve' + # } + - name: audit_rule_keynames_overrides + description: The audit rules to be applied to the system + type: Hash + value: {} + + # SV-257932 + - name: device_file_locations + description: Directories where device files live + type: Array + value: + - /dev + + # SV-257932 + - name: exempt_device_files + description: Full filepaths of files that are exempt from device file checks if the target host is a virtual machine + type: Array + value: + - /dev/vmci + + # SV-257938 + - name: approved_ppsm_clsa + description: Defines allowed ports, protocols, and services as defined in the approved site or program Ports, Protocols, and Services Management Component Local Service Assessment (PPSM CLSA) + type: Hash + value: + ports: [] + protocols: [] + services: + - ssh + + # SV-257989, SV-257990 + - name: approved_openssh_server_conf + description: Config values expected for openssh server (order matters, so these values are comma-delimited strings and not arrays) + type: Hash + value: + ciphers: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr + macs: hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512 + + - name: password_hash_rounds + description: Number of rounds for hashing passwords + type: Numeric + value: 5000 + + # SV-258227 + - name: expected_panic_value + description: Expected value for the audit.rules '-f' flag + type: Numeric + value: 2 + + # SV-258227 + - name: high_availability_required + description: Set to true if there is a documented requirement for the target system to have high availability (and therefore cannot panic on audit failure) + type: Boolean + value: false + + # SV-258232 + - name: approved_crypto_backend + description: FIPS 140-2/140-3 approved cryptographic module conf file + type: String + value: /etc/crypto-policies/back-ends/libreswan.config + + # SV-258173 + - name: expected_audit_backlog_limit + description: Expected value for the audit backlog limit + type: Numeric + value: 8192 + + # SV-257969 + - name: send_redirects + description: Set to true if there is a requirement for this system to be able to send redirects that is documented with the ISSO + type: Boolean + value: false + + # SV-257970 + - name: forwarding + description: Set to true if there is a requirement for this system to be able forward packets that is documented with the ISSO + type: Boolean + value: false \ No newline at end of file diff --git a/kitchen.disa.ec2.yml b/kitchen.disa.ec2.yml index be9fd8d..f1ad6b2 100644 --- a/kitchen.disa.ec2.yml +++ b/kitchen.disa.ec2.yml @@ -64,7 +64,7 @@ lifecycle: echo "" echo "+++ updating ec2-user sudo config for hardening phase +++\n\n" sudo chmod 600 /etc/sudoers && sudo sed -i'' "/ec2-user/d" /etc/sudoers && sudo chmod 400 /etc/sudoers - sudo dnf install git + sudo dnf -y install git #https://github.com/neillturner/kitchen-ansible/issues/295 transport: diff --git a/kitchen.ec2.yml b/kitchen.ec2.yml index c595eb0..35cc13f 100644 --- a/kitchen.ec2.yml +++ b/kitchen.ec2.yml @@ -72,6 +72,8 @@ lifecycle: echo "+++ updating ec2-user sudo config for hardening phase +++\n\n" sudo chmod 600 /etc/sudoers && sudo sed -i'' "/ec2-user/d" /etc/sudoers && sudo chmod 400 /etc/sudoers sudo dnf -y install git + echo "+++ add cinc-auditor for local shell +++\n\n" + curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-auditor transport: name: ssh diff --git a/rhel9-profile.json b/rhel9-profile.json new file mode 100644 index 0000000..1de0762 --- /dev/null +++ b/rhel9-profile.json @@ -0,0 +1,21326 @@ +{ + "controls": [ + { + "id": "SV-257777", + "code": "control 'SV-257777' do\n title 'RHEL 8 must be a vendor-supported release.'\n desc 'An operating system release is considered \"supported\" if the vendor continues to provide security patches for the product. With an unsupported release, it will not be possible to resolve security issues discovered in the system software.\n\n Red Hat offers the Extended Update Support (EUS) add-on to a Red Hat Enterprise Linux subscription, for a fee, for those customers who wish to standardize on a specific minor release for an extended period. The RHEL 8 minor releases eligible for EUS are 8.1, 8.2, 8.4, 8.6, and 8.8. Each RHEL 8 EUS stream is available for 24 months from the availability of the minor release. RHEL 8.10 will be the final minor release overall. For more details on the Red Hat Enterprise Linux Life Cycle visit https://access.redhat.com/support/policy/updates/errata/.\n\n Note: The life-cycle time spans and dates are subject to adjustment.'\n desc 'check', 'Verify the version of the operating system is vendor supported.\n\nNote: The lifecycle time spans and dates are subject to adjustment.\n\nCheck the version of the operating system with the following command:\n\n$ sudo cat /etc/redhat-release\n\nRed Hat Enterprise Linux Server release 8.6 (Ootpa)\n\nCurrent End of Extended Update Support for RHEL 8.1 is 30 November 2021.\n\nCurrent End of Extended Update Support for RHEL 8.2 is 30 April 2022.\n\nCurrent End of Extended Update Support for RHEL 8.4 is 31 May 2023.\n\nCurrent End of Maintenance Support for RHEL 8.5 is 31 May 2022.\n\nCurrent End of Extended Update Support for RHEL 8.6 is 31 May 2024.\n\nCurrent End of Maintenance Support for RHEL 8.7 is 31 May 2023.\n\nCurrent End of Extended Update Support for RHEL 8.8 is 31 May 2025.\n\nCurrent End of Maintenance Support for RHEL 8.9 is 31 May 2024.\n\nCurrent End of Maintenance Support for RHEL 8.10 is 31 May 2029.\n\nIf the release is not supported by the vendor, this is a finding.'\n desc 'fix', 'Upgrade to a supported version of RHEL 8.'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230221'\n tag rid: 'SV-257777r858734_rule'\n tag stig_id: 'RHEL-08-010000'\n tag fix_id: 'F-32865r567410_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n release = os.release\n\n EOMS_DATE = {\n /^8\\.1/ => '30 November 2021',\n /^8\\.2/ => '30 April 2022',\n /^8\\.3/ => '30 April 2021',\n /^8\\.4/ => '31 May 2023',\n /^8\\.5/ => '31 May 2022',\n /^8\\.6/ => '31 May 2024',\n /^8\\.7/ => '31 May 2023',\n /^8\\.8/ => '31 May 2025',\n /^8\\.9/ => '31 May 2024',\n /^8\\.10/ => '31 May 2029'\n }.find { |k, _v| k.match(release) }&.last\n\n describe \"The release \\\"#{release}\\\" is still be within the support window\" do\n it \"ending on #{EOMS_DATE}\" do\n expect(Date.today).to be <= Date.parse(EOMS_DATE)\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257777.rb" + }, + "title": "RHEL 8 must be a vendor-supported release.", + "desc": "An operating system release is considered \"supported\" if the vendor continues to provide security patches for the product. With an unsupported release, it will not be possible to resolve security issues discovered in the system software.\n\n Red Hat offers the Extended Update Support (EUS) add-on to a Red Hat Enterprise Linux subscription, for a fee, for those customers who wish to standardize on a specific minor release for an extended period. The RHEL 8 minor releases eligible for EUS are 8.1, 8.2, 8.4, 8.6, and 8.8. Each RHEL 8 EUS stream is available for 24 months from the availability of the minor release. RHEL 8.10 will be the final minor release overall. For more details on the Red Hat Enterprise Linux Life Cycle visit https://access.redhat.com/support/policy/updates/errata/.\n\n Note: The life-cycle time spans and dates are subject to adjustment.", + "descriptions": { + "default": "An operating system release is considered \"supported\" if the vendor continues to provide security patches for the product. With an unsupported release, it will not be possible to resolve security issues discovered in the system software.\n\n Red Hat offers the Extended Update Support (EUS) add-on to a Red Hat Enterprise Linux subscription, for a fee, for those customers who wish to standardize on a specific minor release for an extended period. The RHEL 8 minor releases eligible for EUS are 8.1, 8.2, 8.4, 8.6, and 8.8. Each RHEL 8 EUS stream is available for 24 months from the availability of the minor release. RHEL 8.10 will be the final minor release overall. For more details on the Red Hat Enterprise Linux Life Cycle visit https://access.redhat.com/support/policy/updates/errata/.\n\n Note: The life-cycle time spans and dates are subject to adjustment.", + "check": "Verify the version of the operating system is vendor supported.\n\nNote: The lifecycle time spans and dates are subject to adjustment.\n\nCheck the version of the operating system with the following command:\n\n$ sudo cat /etc/redhat-release\n\nRed Hat Enterprise Linux Server release 8.6 (Ootpa)\n\nCurrent End of Extended Update Support for RHEL 8.1 is 30 November 2021.\n\nCurrent End of Extended Update Support for RHEL 8.2 is 30 April 2022.\n\nCurrent End of Extended Update Support for RHEL 8.4 is 31 May 2023.\n\nCurrent End of Maintenance Support for RHEL 8.5 is 31 May 2022.\n\nCurrent End of Extended Update Support for RHEL 8.6 is 31 May 2024.\n\nCurrent End of Maintenance Support for RHEL 8.7 is 31 May 2023.\n\nCurrent End of Extended Update Support for RHEL 8.8 is 31 May 2025.\n\nCurrent End of Maintenance Support for RHEL 8.9 is 31 May 2024.\n\nCurrent End of Maintenance Support for RHEL 8.10 is 31 May 2029.\n\nIf the release is not supported by the vendor, this is a finding.", + "fix": "Upgrade to a supported version of RHEL 8." + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230221", + "rid": "SV-257777r858734_rule", + "stig_id": "RHEL-08-010000", + "fix_id": "F-32865r567410_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257778", + "code": "control 'SV-257778' do\n title 'RHEL 8 vendor packaged system security patches and updates must be installed and up to date.'\n desc 'Timely patching is critical for maintaining the operational\n availability, confidentiality, and integrity of information technology (IT)\n systems. However, failure to keep operating system and application software\n patched is a common mistake made by IT professionals. New patches are released\n daily, and it is often difficult for even experienced System Administrators to\n keep abreast of all the new patches. When new weaknesses in an operating system\n exist, patches are usually made available by the vendor to resolve the\n problems. If the most recent security patches and updates are not installed,\n unauthorized users may take advantage of weaknesses in the unpatched software.\n The lack of prompt attention to patching could result in a system compromise.'\n desc 'check', 'Verify the operating system security patches and updates are installed and\n up to date. Updates are required to be applied with a frequency determined by\n the site or Program Management Office (PMO).\n\n Obtain the list of available package security updates from Red Hat. The URL\n for updates is https://rhn.redhat.com/errata/. It is important to note that\n updates provided by Red Hat may not be present on the system if the underlying\n packages are not installed.\n\n Check that the available package security updates have been installed on\n the system with the following command:\n\n $ sudo yum history list | more\n\n Loaded plugins: langpacks, product-id, subscription-manager\n ID | Command line | Date and time | Action(s) | Altered\n\n -------------------------------------------------------------------------------\n 70 | install aide | 2020-03-05 10:58 | Install | 1\n 69 | update -y | 2020-03-04 14:34 | Update | 18 EE\n 68 | install vlc | 2020-02-21 17:12 | Install | 21\n 67 | update -y | 2020-02-21 17:04 | Update | 7 EE\n\n If package updates have not been performed on the system within the\n timeframe the site/program documentation requires, this is a finding.\n\n Typical update frequency may be overridden by Information Assurance\n Vulnerability Alert (IAVA) notifications from CYBERCOM.\n\n If the operating system is in non-compliance with the Information Assurance\n Vulnerability Management (IAVM) process, this is a finding.'\n desc 'fix', 'Install the operating system patches or updated packages\n available from Red Hat within 30 days or sooner as local policy dictates.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230222'\n tag rid: 'SV-257778r627750_rule'\n tag stig_id: 'RHEL-08-010010'\n tag fix_id: 'F-32866r567413_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n only_if(\"This control takes a long time to execute so it has been disabled through 'slow_controls'\") {\n !input('disable_slow_controls')\n }\n\n if input('disconnected_system')\n describe 'The system is set to a `disconnected` state and you must validate the state of the system packages manually' do\n skip 'The system is set to a `disconnected` state and you must validate the state of the system packages manually'\n end\n else\n updates = linux_update.updates\n package_names = updates.map { |h| h['name'] }\n\n describe.one do\n describe 'List of out-of-date packages' do\n subject { package_names }\n it { should be_empty }\n end\n updates.each do |update|\n describe package(update['name']) do\n its('version') { should eq update['version'] }\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257778.rb" + }, + "title": "RHEL 8 vendor packaged system security patches and updates must be installed and up to date.", + "desc": "Timely patching is critical for maintaining the operational\n availability, confidentiality, and integrity of information technology (IT)\n systems. However, failure to keep operating system and application software\n patched is a common mistake made by IT professionals. New patches are released\n daily, and it is often difficult for even experienced System Administrators to\n keep abreast of all the new patches. When new weaknesses in an operating system\n exist, patches are usually made available by the vendor to resolve the\n problems. If the most recent security patches and updates are not installed,\n unauthorized users may take advantage of weaknesses in the unpatched software.\n The lack of prompt attention to patching could result in a system compromise.", + "descriptions": { + "default": "Timely patching is critical for maintaining the operational\n availability, confidentiality, and integrity of information technology (IT)\n systems. However, failure to keep operating system and application software\n patched is a common mistake made by IT professionals. New patches are released\n daily, and it is often difficult for even experienced System Administrators to\n keep abreast of all the new patches. When new weaknesses in an operating system\n exist, patches are usually made available by the vendor to resolve the\n problems. If the most recent security patches and updates are not installed,\n unauthorized users may take advantage of weaknesses in the unpatched software.\n The lack of prompt attention to patching could result in a system compromise.", + "check": "Verify the operating system security patches and updates are installed and\n up to date. Updates are required to be applied with a frequency determined by\n the site or Program Management Office (PMO).\n\n Obtain the list of available package security updates from Red Hat. The URL\n for updates is https://rhn.redhat.com/errata/. It is important to note that\n updates provided by Red Hat may not be present on the system if the underlying\n packages are not installed.\n\n Check that the available package security updates have been installed on\n the system with the following command:\n\n $ sudo yum history list | more\n\n Loaded plugins: langpacks, product-id, subscription-manager\n ID | Command line | Date and time | Action(s) | Altered\n\n -------------------------------------------------------------------------------\n 70 | install aide | 2020-03-05 10:58 | Install | 1\n 69 | update -y | 2020-03-04 14:34 | Update | 18 EE\n 68 | install vlc | 2020-02-21 17:12 | Install | 21\n 67 | update -y | 2020-02-21 17:04 | Update | 7 EE\n\n If package updates have not been performed on the system within the\n timeframe the site/program documentation requires, this is a finding.\n\n Typical update frequency may be overridden by Information Assurance\n Vulnerability Alert (IAVA) notifications from CYBERCOM.\n\n If the operating system is in non-compliance with the Information Assurance\n Vulnerability Management (IAVM) process, this is a finding.", + "fix": "Install the operating system patches or updated packages\n available from Red Hat within 30 days or sooner as local policy dictates." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230222", + "rid": "SV-257778r627750_rule", + "stig_id": "RHEL-08-010010", + "fix_id": "F-32866r567413_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257779", + "code": "control 'SV-257779' do\n title 'RHEL 8 must display the Standard Mandatory DoD Notice and Consent\nBanner before granting local or remote access to the system via a command line\nuser logon.'\n desc 'Display of a standardized and approved use notification before\ngranting access to the operating system ensures privacy and security\nnotification verbiage used is consistent with applicable federal laws,\nExecutive Orders, directives, policies, regulations, standards, and guidance.\n\n System use notifications are required only for access via logon interfaces\nwith human users and are not required when such human interfaces do not exist.\n\n The banner must be formatted in accordance with applicable DoD policy. Use\nthe following verbiage for operating systems that can accommodate banners of\n1300 characters:\n\n \"You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only.\n\n By using this IS (which includes any device attached to this IS), you\nconsent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests--not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.\"'\n desc 'check', 'Verify RHEL 8 displays the Standard Mandatory DoD Notice and Consent Banner\nbefore granting access to the operating system via a command line user logon.\n\n Check that RHEL 8 displays a banner at the command line login screen with\nthe following command:\n\n $ sudo cat /etc/issue\n\n If the banner is set correctly it will return the following text:\n\n “You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only.\n\n By using this IS (which includes any device attached to this IS), you\nconsent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests--not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.”\n\n If the banner text does not match the Standard Mandatory DoD Notice and\nConsent Banner exactly, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to display the Standard Mandatory DoD Notice and Consent\nBanner before granting access to the system via command line logon.\n\n Edit the \"/etc/issue\" file to replace the default text with the Standard\nMandatory DoD Notice and Consent Banner. The DoD-required text is:\n\n \"You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only.\n\n By using this IS (which includes any device attached to this IS), you\nconsent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests -- not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.\"'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000023-GPOS-00006'\n tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088']\n tag gid: 'V-230227'\n tag rid: 'SV-257779r627750_rule'\n tag stig_id: 'RHEL-08-010060'\n tag fix_id: 'F-32871r567428_fix'\n tag cci: ['CCI-000048']\n tag nist: ['AC-8 a']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n banner_file = file('/etc/issue')\n\n describe banner_file do\n it { should exist }\n end\n\n if banner_file.exist?\n\n banner = banner_file.content.gsub(/[\\r\\n\\s]/, '')\n expected_banner = input('banner_message_text_cli').gsub(/[\\r\\n\\s]/, '')\n\n describe 'The CLI Login Banner ' do\n it 'is set to the standard banner and has the correct text' do\n expect(banner).to eq(expected_banner), 'Banner does not match expected text'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257779.rb" + }, + "title": "RHEL 8 must display the Standard Mandatory DoD Notice and Consent\nBanner before granting local or remote access to the system via a command line\nuser logon.", + "desc": "Display of a standardized and approved use notification before\ngranting access to the operating system ensures privacy and security\nnotification verbiage used is consistent with applicable federal laws,\nExecutive Orders, directives, policies, regulations, standards, and guidance.\n\n System use notifications are required only for access via logon interfaces\nwith human users and are not required when such human interfaces do not exist.\n\n The banner must be formatted in accordance with applicable DoD policy. Use\nthe following verbiage for operating systems that can accommodate banners of\n1300 characters:\n\n \"You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only.\n\n By using this IS (which includes any device attached to this IS), you\nconsent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests--not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.\"", + "descriptions": { + "default": "Display of a standardized and approved use notification before\ngranting access to the operating system ensures privacy and security\nnotification verbiage used is consistent with applicable federal laws,\nExecutive Orders, directives, policies, regulations, standards, and guidance.\n\n System use notifications are required only for access via logon interfaces\nwith human users and are not required when such human interfaces do not exist.\n\n The banner must be formatted in accordance with applicable DoD policy. Use\nthe following verbiage for operating systems that can accommodate banners of\n1300 characters:\n\n \"You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only.\n\n By using this IS (which includes any device attached to this IS), you\nconsent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests--not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.\"", + "check": "Verify RHEL 8 displays the Standard Mandatory DoD Notice and Consent Banner\nbefore granting access to the operating system via a command line user logon.\n\n Check that RHEL 8 displays a banner at the command line login screen with\nthe following command:\n\n $ sudo cat /etc/issue\n\n If the banner is set correctly it will return the following text:\n\n “You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only.\n\n By using this IS (which includes any device attached to this IS), you\nconsent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests--not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.”\n\n If the banner text does not match the Standard Mandatory DoD Notice and\nConsent Banner exactly, this is a finding.", + "fix": "Configure RHEL 8 to display the Standard Mandatory DoD Notice and Consent\nBanner before granting access to the system via command line logon.\n\n Edit the \"/etc/issue\" file to replace the default text with the Standard\nMandatory DoD Notice and Consent Banner. The DoD-required text is:\n\n \"You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only.\n\n By using this IS (which includes any device attached to this IS), you\nconsent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests -- not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.\"" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000023-GPOS-00006", + "satisfies": [ + "SRG-OS-000023-GPOS-00006", + "SRG-OS-000228-GPOS-00088" + ], + "gid": "V-230227", + "rid": "SV-257779r627750_rule", + "stig_id": "RHEL-08-010060", + "fix_id": "F-32871r567428_fix", + "cci": [ + "CCI-000048" + ], + "nist": [ + "AC-8 a" + ], + "host": null + } + }, + { + "id": "SV-257780", + "code": "control 'SV-257780' do\n title 'The RHEL 8 operating system must implement the Endpoint Security for\nLinux Threat Prevention tool.'\n desc \"Adding endpoint security tools can provide the capability to\nautomatically take actions in response to malicious behavior, which can provide\nadditional agility in reacting to network threats. These tools also often\ninclude a reporting capability to provide network awareness of the system,\nwhich may not otherwise exist in an organization's systems management regime.\"\n desc 'check', 'Check that the following package has been installed:\n\n $ sudo rpm -qa | grep -i mcafeetp\n\nIf the \"mcafeetp\" package is not installed, this is a finding.\n\nVerify that the daemon is running:\n\n $ sudo ps -ef | grep -i mfetpd\n\nIf the daemon is not running, this is a finding.'\n desc 'fix', 'Install and enable the latest Trellix ENSLTP package.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000191-GPOS-00080'\n tag gid: 'V-245540'\n tag rid: 'SV-257780r942951_rule'\n tag stig_id: 'RHEL-08-010001'\n tag fix_id: 'F-48770r942950_fix'\n tag cci: ['CCI-001233']\n tag nist: ['SI-2 (2)']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) do\n !virtualization.system.eql?('docker')\n end\n\n if input('skip_endpoint_security_tool')\n impact 0.0\n describe 'Implementing the Endpoint Security for Linux Threat Prevention tool is not applicable by agreement with the approval authority of the organization.' do\n skip 'Implementing the Endpoint Security for Linux Threat Prevention tool is not applicable by agreement with the approval authority of the organization.'\n end\n else\n linux_threat_prevention_package = input('linux_threat_prevention_package')\n linux_threat_prevention_service = input('linux_threat_prevention_service')\n describe package(linux_threat_prevention_package) do\n it { should be_installed }\n end\n\n describe processes(linux_threat_prevention_service) do\n it { should exist }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257780.rb" + }, + "title": "The RHEL 8 operating system must implement the Endpoint Security for\nLinux Threat Prevention tool.", + "desc": "Adding endpoint security tools can provide the capability to\nautomatically take actions in response to malicious behavior, which can provide\nadditional agility in reacting to network threats. These tools also often\ninclude a reporting capability to provide network awareness of the system,\nwhich may not otherwise exist in an organization's systems management regime.", + "descriptions": { + "default": "Adding endpoint security tools can provide the capability to\nautomatically take actions in response to malicious behavior, which can provide\nadditional agility in reacting to network threats. These tools also often\ninclude a reporting capability to provide network awareness of the system,\nwhich may not otherwise exist in an organization's systems management regime.", + "check": "Check that the following package has been installed:\n\n $ sudo rpm -qa | grep -i mcafeetp\n\nIf the \"mcafeetp\" package is not installed, this is a finding.\n\nVerify that the daemon is running:\n\n $ sudo ps -ef | grep -i mfetpd\n\nIf the daemon is not running, this is a finding.", + "fix": "Install and enable the latest Trellix ENSLTP package." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000191-GPOS-00080", + "gid": "V-245540", + "rid": "SV-257780r942951_rule", + "stig_id": "RHEL-08-010001", + "fix_id": "F-48770r942950_fix", + "cci": [ + "CCI-001233" + ], + "nist": [ + "SI-2 (2)" + ], + "host": null + } + }, + { + "id": "SV-257781", + "code": "control 'SV-257781' do\n title 'The graphical display manager must not be the default target on RHEL 8 unless approved.'\n desc 'Internet services that are not required for system or application processes must not be active to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.'\n desc 'check', 'Verify that the system is configured to boot to the command line:\n\n$ systemctl get-default\nmulti-user.target\n\nIf the system default target is not set to \"multi-user.target\" and the Information System Security Officer (ISSO) lacks a documented requirement for a graphical user interface, this is a finding.'\n desc 'fix', 'Document the requirement for a graphical user interface with the ISSO or reinstall the operating system without the graphical user interface. If reinstallation is not feasible, then continue with the following procedure:\n\nOpen an SSH session and enter the following commands:\n\n$ sudo systemctl set-default multi-user.target\n\nA reboot is required for the changes to take effect.'\n impact 0.5\n tag check_id: 'C-55155r809376_chk'\n tag severity: 'medium'\n tag gid: 'V-251718'\n tag rid: 'SV-257781r809378_rule'\n tag stig_id: 'RHEL-08-040321'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-55109r809377_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable inside the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('gui_required')\n impact 0.0\n describe 'skip' do\n skip 'A GUI is indicated as a requirement for this system. This control is Not Applicable.'\n end\n else\n get_default = command('systemctl get-default').stdout.strip\n\n describe get_default do\n it { should cmp 'multi-user.target' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257781.rb" + }, + "title": "The graphical display manager must not be the default target on RHEL 8 unless approved.", + "desc": "Internet services that are not required for system or application processes must not be active to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.", + "descriptions": { + "default": "Internet services that are not required for system or application processes must not be active to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.", + "check": "Verify that the system is configured to boot to the command line:\n\n$ systemctl get-default\nmulti-user.target\n\nIf the system default target is not set to \"multi-user.target\" and the Information System Security Officer (ISSO) lacks a documented requirement for a graphical user interface, this is a finding.", + "fix": "Document the requirement for a graphical user interface with the ISSO or reinstall the operating system without the graphical user interface. If reinstallation is not feasible, then continue with the following procedure:\n\nOpen an SSH session and enter the following commands:\n\n$ sudo systemctl set-default multi-user.target\n\nA reboot is required for the changes to take effect." + }, + "impact": 0, + "refs": [], + "tags": { + "check_id": "C-55155r809376_chk", + "severity": "medium", + "gid": "V-251718", + "rid": "SV-257781r809378_rule", + "stig_id": "RHEL-08-040321", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-55109r809377_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257782", + "code": "control 'SV-257782' do\n title 'RHEL 8 must enable the hardware random number generator entropy\ngatherer service.'\n desc 'The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems.\n\nThe rngd service feeds random data from hardware device to kernel random device. Quality (nonpredictable) random number generation is important for several security functions (i.e., ciphers).'\n desc 'check', 'Note: For RHEL versions 8.4 and above running with kernel FIPS mode enabled as specified by RHEL-08-010020, this requirement is Not Applicable.\n\nCheck that RHEL 8 has enabled the hardware random number generator entropy gatherer service.\n\nVerify the rngd service is enabled and active with the following commands:\n\n $ sudo systemctl is-enabled rngd\n enabled\n\n $ sudo systemctl is-active rngd\n active\n\nIf the service is not \"enabled\" and \"active\", this is a finding.'\n desc 'fix', 'Start the rngd service and enable the rngd service with the following commands:\n\n $ sudo systemctl start rngd.service\n\n $ sudo systemctl enable rngd.service'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230285'\n tag rid: 'SV-257782r928587_rule'\n tag stig_id: 'RHEL-08-010471'\n tag fix_id: 'F-32929r917875_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if os.release.to_f >= 8.4 && input('use_fips') == true\n impact 0.0\n describe 'For RHEL versions 8.4 and above running with kernel FIPS mode enabled as specified by RHEL-08-010020, this requirement is Not Applicable.' do\n skip \"Currently on release #{os.release}, this control is Not Applicable.\"\n end\n else\n describe service('rngd') do\n it { should be_enabled }\n it { should be_running }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257782.rb" + }, + "title": "RHEL 8 must enable the hardware random number generator entropy\ngatherer service.", + "desc": "The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems.\n\nThe rngd service feeds random data from hardware device to kernel random device. Quality (nonpredictable) random number generation is important for several security functions (i.e., ciphers).", + "descriptions": { + "default": "The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems.\n\nThe rngd service feeds random data from hardware device to kernel random device. Quality (nonpredictable) random number generation is important for several security functions (i.e., ciphers).", + "check": "Note: For RHEL versions 8.4 and above running with kernel FIPS mode enabled as specified by RHEL-08-010020, this requirement is Not Applicable.\n\nCheck that RHEL 8 has enabled the hardware random number generator entropy gatherer service.\n\nVerify the rngd service is enabled and active with the following commands:\n\n $ sudo systemctl is-enabled rngd\n enabled\n\n $ sudo systemctl is-active rngd\n active\n\nIf the service is not \"enabled\" and \"active\", this is a finding.", + "fix": "Start the rngd service and enable the rngd service with the following commands:\n\n $ sudo systemctl start rngd.service\n\n $ sudo systemctl enable rngd.service" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230285", + "rid": "SV-257782r928587_rule", + "stig_id": "RHEL-08-010471", + "fix_id": "F-32929r917875_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257783", + "code": "control 'SV-257783' do\n title 'RHEL 9 systemd-journald service must be enabled.'\n desc 'In the event of a system failure, RHEL 9 must preserve any information necessary to determine cause of failure and any information necessary to return to operations with least disruption to system processes.'\n desc 'check', 'Verify that \"systemd-journald\" is active with the following command:\n\n$ systemctl is-active systemd-journald\n\nactive\n\nIf the systemd-journald service is not active, this is a finding.'\n desc 'fix', 'To enable the systemd-journald service, run the following command:\n\n$ sudo systemctl enable --now systemd-journald'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61524r925334_chk'\n tag severity: 'medium'\n tag gid: 'V-257783'\n tag rid: 'SV-257783r925336_rule'\n tag stig_id: 'RHEL-09-211040'\n tag gtitle: 'SRG-OS-000269-GPOS-00103'\n tag fix_id: 'F-61448r925335_fix'\n tag 'documentable'\n tag cci: ['CCI-001665']\n tag nist: ['SC-24']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257783.rb" + }, + "title": "RHEL 9 systemd-journald service must be enabled.", + "desc": "In the event of a system failure, RHEL 9 must preserve any information necessary to determine cause of failure and any information necessary to return to operations with least disruption to system processes.", + "descriptions": { + "default": "In the event of a system failure, RHEL 9 must preserve any information necessary to determine cause of failure and any information necessary to return to operations with least disruption to system processes.", + "check": "Verify that \"systemd-journald\" is active with the following command:\n\n$ systemctl is-active systemd-journald\n\nactive\n\nIf the systemd-journald service is not active, this is a finding.", + "fix": "To enable the systemd-journald service, run the following command:\n\n$ sudo systemctl enable --now systemd-journald" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61524r925334_chk", + "severity": "medium", + "gid": "V-257783", + "rid": "SV-257783r925336_rule", + "stig_id": "RHEL-09-211040", + "gtitle": "SRG-OS-000269-GPOS-00103", + "fix_id": "F-61448r925335_fix", + "documentable": null, + "cci": [ + "CCI-001665" + ], + "nist": [ + "SC-24" + ] + } + }, + { + "id": "SV-257784", + "code": "control 'SV-257784' do\n title 'The systemd Ctrl-Alt-Delete burst key sequence in RHEL 8 must be\ndisabled.'\n desc 'A locally logged-on user who presses Ctrl-Alt-Delete when at the\nconsole can reboot the system. If accidentally pressed, as could happen in the\ncase of a mixed OS environment, this can create the risk of short-term loss of\navailability of systems due to unintentional reboot. In a graphical user\nenvironment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is\nreduced because the user will be prompted before any action is taken.'\n desc 'check', 'Verify RHEL 8 is not configured to reboot the system when Ctrl-Alt-Delete\nis pressed seven times within two seconds with the following command:\n\n $ sudo grep -i ctrl /etc/systemd/system.conf\n\n CtrlAltDelBurstAction=none\n\n If the \"CtrlAltDelBurstAction\" is not set to \"none\", commented out, or\nis missing, this is a finding.'\n desc 'fix', 'Configure the system to disable the CtrlAltDelBurstAction by added or\nmodifying the following line in the \"/etc/systemd/system.conf\" configuration\nfile:\n\n CtrlAltDelBurstAction=none\n\n Reload the daemon for this change to take effect.\n\n $ sudo systemctl daemon-reload'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230531'\n tag rid: 'SV-257784r627750_rule'\n tag stig_id: 'RHEL-08-040172'\n tag fix_id: 'F-33175r619890_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe parse_config_file('/etc/systemd/system.conf') do\n its('Manager') { should include('CtrlAltDelBurstAction' => 'none') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257784.rb" + }, + "title": "The systemd Ctrl-Alt-Delete burst key sequence in RHEL 8 must be\ndisabled.", + "desc": "A locally logged-on user who presses Ctrl-Alt-Delete when at the\nconsole can reboot the system. If accidentally pressed, as could happen in the\ncase of a mixed OS environment, this can create the risk of short-term loss of\navailability of systems due to unintentional reboot. In a graphical user\nenvironment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is\nreduced because the user will be prompted before any action is taken.", + "descriptions": { + "default": "A locally logged-on user who presses Ctrl-Alt-Delete when at the\nconsole can reboot the system. If accidentally pressed, as could happen in the\ncase of a mixed OS environment, this can create the risk of short-term loss of\navailability of systems due to unintentional reboot. In a graphical user\nenvironment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is\nreduced because the user will be prompted before any action is taken.", + "check": "Verify RHEL 8 is not configured to reboot the system when Ctrl-Alt-Delete\nis pressed seven times within two seconds with the following command:\n\n $ sudo grep -i ctrl /etc/systemd/system.conf\n\n CtrlAltDelBurstAction=none\n\n If the \"CtrlAltDelBurstAction\" is not set to \"none\", commented out, or\nis missing, this is a finding.", + "fix": "Configure the system to disable the CtrlAltDelBurstAction by added or\nmodifying the following line in the \"/etc/systemd/system.conf\" configuration\nfile:\n\n CtrlAltDelBurstAction=none\n\n Reload the daemon for this change to take effect.\n\n $ sudo systemctl daemon-reload" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230531", + "rid": "SV-257784r627750_rule", + "stig_id": "RHEL-08-040172", + "fix_id": "F-33175r619890_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257785", + "code": "control 'SV-257785' do\n title 'The x86 Ctrl-Alt-Delete key sequence must be disabled on RHEL 8.'\n desc 'A locally logged-on user, who presses Ctrl-Alt-Delete when at the\nconsole, can reboot the system. If accidentally pressed, as could happen in the\ncase of a mixed OS environment, this can create the risk of short-term loss of\navailability of systems due to unintentional reboot. In a graphical user\nenvironment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is\nreduced because the user will be prompted before any action is taken.'\n desc 'check', 'Verify RHEL 8 is not configured to reboot the system when Ctrl-Alt-Delete\nis pressed with the following command:\n\n $ sudo systemctl status ctrl-alt-del.target\n\n ctrl-alt-del.target\n Loaded: masked (Reason: Unit ctrl-alt-del.target is masked.)\n Active: inactive (dead)\n\n If the \"ctrl-alt-del.target\" is loaded and not masked, this is a finding.'\n desc 'fix', 'Configure the system to disable the Ctrl-Alt-Delete sequence for the command line with the following commands:\n\n$ sudo systemctl disable ctrl-alt-del.target\n\n$ sudo systemctl mask ctrl-alt-del.target\n\nCreated symlink /etc/systemd/system/ctrl-alt-del.target -> /dev/null\n\nReload the daemon for this change to take effect.\n\n$ sudo systemctl daemon-reload'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230529'\n tag rid: 'SV-257785r833338_rule'\n tag stig_id: 'RHEL-08-040170'\n tag fix_id: 'F-33173r833337_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n c = systemd_service('ctrl-alt-del.target')\n\n describe.one do\n describe c do\n its('params.LoadState') { should eq 'masked' }\n end\n describe c do\n its('params.LoadState') { should eq 'not-found' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257785.rb" + }, + "title": "The x86 Ctrl-Alt-Delete key sequence must be disabled on RHEL 8.", + "desc": "A locally logged-on user, who presses Ctrl-Alt-Delete when at the\nconsole, can reboot the system. If accidentally pressed, as could happen in the\ncase of a mixed OS environment, this can create the risk of short-term loss of\navailability of systems due to unintentional reboot. In a graphical user\nenvironment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is\nreduced because the user will be prompted before any action is taken.", + "descriptions": { + "default": "A locally logged-on user, who presses Ctrl-Alt-Delete when at the\nconsole, can reboot the system. If accidentally pressed, as could happen in the\ncase of a mixed OS environment, this can create the risk of short-term loss of\navailability of systems due to unintentional reboot. In a graphical user\nenvironment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is\nreduced because the user will be prompted before any action is taken.", + "check": "Verify RHEL 8 is not configured to reboot the system when Ctrl-Alt-Delete\nis pressed with the following command:\n\n $ sudo systemctl status ctrl-alt-del.target\n\n ctrl-alt-del.target\n Loaded: masked (Reason: Unit ctrl-alt-del.target is masked.)\n Active: inactive (dead)\n\n If the \"ctrl-alt-del.target\" is loaded and not masked, this is a finding.", + "fix": "Configure the system to disable the Ctrl-Alt-Delete sequence for the command line with the following commands:\n\n$ sudo systemctl disable ctrl-alt-del.target\n\n$ sudo systemctl mask ctrl-alt-del.target\n\nCreated symlink /etc/systemd/system/ctrl-alt-del.target -> /dev/null\n\nReload the daemon for this change to take effect.\n\n$ sudo systemctl daemon-reload" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230529", + "rid": "SV-257785r833338_rule", + "stig_id": "RHEL-08-040170", + "fix_id": "F-33173r833337_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257786", + "code": "control 'SV-257786' do\n title 'The debug-shell systemd service must be disabled on RHEL 8.'\n desc 'The debug-shell requires no authentication and provides root\nprivileges to anyone who has physical access to the machine. While this\nfeature is disabled by default, masking it adds an additional layer of\nassurance that it will not be enabled via a dependency in systemd. This also\nprevents attackers with physical access from trivially bypassing security on\nthe machine through valid troubleshooting configurations and gaining root\naccess when the system is rebooted.'\n desc 'check', 'Verify RHEL 8 is configured to mask the debug-shell systemd service with\nthe following command:\n\n $ sudo systemctl status debug-shell.service\n\n debug-shell.service\n Loaded: masked (Reason: Unit debug-shell.service is masked.)\n Active: inactive (dead)\n\n If the \"debug-shell.service\" is loaded and not masked, this is a finding.'\n desc 'fix', 'Configure the system to mask the debug-shell systemd service with the\nfollowing command:\n\n $ sudo systemctl mask debug-shell.service\n\n Created symlink /etc/systemd/system/debug-shell.service -> /dev/null\n\n Reload the daemon to take effect.\n\n $ sudo systemctl daemon-reload'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230532'\n tag rid: 'SV-257786r627750_rule'\n tag stig_id: 'RHEL-08-040180'\n tag fix_id: 'F-33176r619892_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n d = systemd_service('debug-shell.service')\n\n describe.one do\n describe d do\n its('params.LoadState') { should eq 'masked' }\n end\n describe d do\n its('params.LoadState') { should eq 'not-found' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257786.rb" + }, + "title": "The debug-shell systemd service must be disabled on RHEL 8.", + "desc": "The debug-shell requires no authentication and provides root\nprivileges to anyone who has physical access to the machine. While this\nfeature is disabled by default, masking it adds an additional layer of\nassurance that it will not be enabled via a dependency in systemd. This also\nprevents attackers with physical access from trivially bypassing security on\nthe machine through valid troubleshooting configurations and gaining root\naccess when the system is rebooted.", + "descriptions": { + "default": "The debug-shell requires no authentication and provides root\nprivileges to anyone who has physical access to the machine. While this\nfeature is disabled by default, masking it adds an additional layer of\nassurance that it will not be enabled via a dependency in systemd. This also\nprevents attackers with physical access from trivially bypassing security on\nthe machine through valid troubleshooting configurations and gaining root\naccess when the system is rebooted.", + "check": "Verify RHEL 8 is configured to mask the debug-shell systemd service with\nthe following command:\n\n $ sudo systemctl status debug-shell.service\n\n debug-shell.service\n Loaded: masked (Reason: Unit debug-shell.service is masked.)\n Active: inactive (dead)\n\n If the \"debug-shell.service\" is loaded and not masked, this is a finding.", + "fix": "Configure the system to mask the debug-shell systemd service with the\nfollowing command:\n\n $ sudo systemctl mask debug-shell.service\n\n Created symlink /etc/systemd/system/debug-shell.service -> /dev/null\n\n Reload the daemon to take effect.\n\n $ sudo systemctl daemon-reload" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230532", + "rid": "SV-257786r627750_rule", + "stig_id": "RHEL-08-040180", + "fix_id": "F-33176r619892_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257787", + "code": "control 'SV-257787' do\n title 'RHEL 9 must require a boot loader superuser password.'\n desc 'To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement.\n\nPassword protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode.'\n desc 'check', 'Verify the boot loader superuser password has been set and run the following command:\n\n$ sudo grep \"superusers\" /etc/grub2.cfg \n\npassword_pbkdf2 superusers-account ${GRUB2_PASSWORD} \n\nTo verify the boot loader superuser account password has been set, and the password encrypted, run the following command:\n\n$ sudo cat /boot/grub2/user.cfg \n\nGRUB2_PASSWORD=grub.pbkdf2.sha512.10000.C4E08AC72FBFF7E837FD267BFAD7AEB3D42DDC\n2C99F2A94DD5E2E75C2DC331B719FE55D9411745F82D1B6CFD9E927D61925F9BBDD1CFAA0080E0\n916F7AB46E0D.1302284FCCC52CD73BA3671C6C12C26FF50BA873293B24EE2A96EE3B57963E6D7\n0C83964B473EC8F93B07FE749AA6710269E904A9B08A6BBACB00A2D242AD828 \n\nIf a \"GRUB2_PASSWORD\" is not set, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to require a grub bootloader password for the grub superuser account.\n\nGenerate an encrypted grub2 password for the grub superuser account with the following command:\n\n$ sudo grub2-setpassword\nEnter password:\nConfirm password:'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61528r925346_chk'\n tag severity: 'medium'\n tag gid: 'V-257787'\n tag rid: 'SV-257787r925348_rule'\n tag stig_id: 'RHEL-09-212010'\n tag gtitle: 'SRG-OS-000080-GPOS-00048'\n tag fix_id: 'F-61452r925347_fix'\n tag 'documentable'\n tag cci: ['CCI-000213']\n tag nist: ['AC-3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257787.rb" + }, + "title": "RHEL 9 must require a boot loader superuser password.", + "desc": "To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement.\n\nPassword protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode.", + "descriptions": { + "default": "To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement.\n\nPassword protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode.", + "check": "Verify the boot loader superuser password has been set and run the following command:\n\n$ sudo grep \"superusers\" /etc/grub2.cfg \n\npassword_pbkdf2 superusers-account ${GRUB2_PASSWORD} \n\nTo verify the boot loader superuser account password has been set, and the password encrypted, run the following command:\n\n$ sudo cat /boot/grub2/user.cfg \n\nGRUB2_PASSWORD=grub.pbkdf2.sha512.10000.C4E08AC72FBFF7E837FD267BFAD7AEB3D42DDC\n2C99F2A94DD5E2E75C2DC331B719FE55D9411745F82D1B6CFD9E927D61925F9BBDD1CFAA0080E0\n916F7AB46E0D.1302284FCCC52CD73BA3671C6C12C26FF50BA873293B24EE2A96EE3B57963E6D7\n0C83964B473EC8F93B07FE749AA6710269E904A9B08A6BBACB00A2D242AD828 \n\nIf a \"GRUB2_PASSWORD\" is not set, this is a finding.", + "fix": "Configure RHEL 9 to require a grub bootloader password for the grub superuser account.\n\nGenerate an encrypted grub2 password for the grub superuser account with the following command:\n\n$ sudo grub2-setpassword\nEnter password:\nConfirm password:" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61528r925346_chk", + "severity": "medium", + "gid": "V-257787", + "rid": "SV-257787r925348_rule", + "stig_id": "RHEL-09-212010", + "gtitle": "SRG-OS-000080-GPOS-00048", + "fix_id": "F-61452r925347_fix", + "documentable": null, + "cci": [ + "CCI-000213" + ], + "nist": [ + "AC-3" + ] + } + }, + { + "id": "SV-257788", + "code": "control 'SV-257788' do\n title 'RHEL 9 must disable the ability of systemd to spawn an interactive boot process.'\n desc 'Using interactive or recovery boot, the console user could disable auditing, firewalls, or other services, weakening system security.'\n desc 'check', \"Verify that GRUB 2 is configured to disable interactive boot.\n\nCheck that the current GRUB 2 configuration disables the ability of systemd to spawn an interactive boot process with the following command:\n\n$ sudo grubby --info=ALL | grep args | grep 'systemd.confirm_spawn'\n\nIf any output is returned, this is a finding.\"\n desc 'fix', 'Configure RHEL 9 to allocate sufficient audit_backlog_limit to disable the ability of systemd to spawn an interactive boot process with the following command:\n\n$ sudo grubby --update-kernel=ALL --remove-args=\"systemd.confirm_spawn\"'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61529r925349_chk'\n tag severity: 'medium'\n tag gid: 'V-257788'\n tag rid: 'SV-257788r925351_rule'\n tag stig_id: 'RHEL-09-212015'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61453r925350_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257788.rb" + }, + "title": "RHEL 9 must disable the ability of systemd to spawn an interactive boot process.", + "desc": "Using interactive or recovery boot, the console user could disable auditing, firewalls, or other services, weakening system security.", + "descriptions": { + "default": "Using interactive or recovery boot, the console user could disable auditing, firewalls, or other services, weakening system security.", + "check": "Verify that GRUB 2 is configured to disable interactive boot.\n\nCheck that the current GRUB 2 configuration disables the ability of systemd to spawn an interactive boot process with the following command:\n\n$ sudo grubby --info=ALL | grep args | grep 'systemd.confirm_spawn'\n\nIf any output is returned, this is a finding.", + "fix": "Configure RHEL 9 to allocate sufficient audit_backlog_limit to disable the ability of systemd to spawn an interactive boot process with the following command:\n\n$ sudo grubby --update-kernel=ALL --remove-args=\"systemd.confirm_spawn\"" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61529r925349_chk", + "severity": "medium", + "gid": "V-257788", + "rid": "SV-257788r925351_rule", + "stig_id": "RHEL-09-212015", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61453r925350_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257789", + "code": "control 'SV-257789' do\n title 'RHEL 9 must require a unique superusers name upon booting into single-user and maintenance modes.'\n desc 'Having a nondefault grub superuser username makes password-guessing attacks less effective.'\n desc 'check', 'Verify the boot loader superuser account has been set with the following command:\n\n$ sudo grep -A1 \"superusers\" /etc/grub2.cfg \n\n set superusers=\"\"\nexport superusers\n \nThe is the actual account name different from common names like root, admin, or administrator.\n\nIf superusers contains easily guessable usernames, this is a finding.'\n desc 'fix', %q(Configure RHEL 9 to have a unique username for the grub superuser account.\n\nEdit the \"/etc/grub.d/01_users\" file and add or modify the following lines in the \"### BEGIN /etc/grub.d/01_users ###\" section:\n\nset superusers=\"superusers-account\"\nexport superusers\n\nOnce the superuser account has been added, update the grub.cfg file by running:\n\n$ sudo grubby --update-kernel=ALL')\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61530r925352_chk'\n tag severity: 'high'\n tag gid: 'V-257789'\n tag rid: 'SV-257789r925354_rule'\n tag stig_id: 'RHEL-09-212020'\n tag gtitle: 'SRG-OS-000080-GPOS-00048'\n tag fix_id: 'F-61454r925353_fix'\n tag 'documentable'\n tag cci: ['CCI-000213']\n tag nist: ['AC-3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257789.rb" + }, + "title": "RHEL 9 must require a unique superusers name upon booting into single-user and maintenance modes.", + "desc": "Having a nondefault grub superuser username makes password-guessing attacks less effective.", + "descriptions": { + "default": "Having a nondefault grub superuser username makes password-guessing attacks less effective.", + "check": "Verify the boot loader superuser account has been set with the following command:\n\n$ sudo grep -A1 \"superusers\" /etc/grub2.cfg \n\n set superusers=\"\"\nexport superusers\n \nThe is the actual account name different from common names like root, admin, or administrator.\n\nIf superusers contains easily guessable usernames, this is a finding.", + "fix": "Configure RHEL 9 to have a unique username for the grub superuser account.\n\nEdit the \"/etc/grub.d/01_users\" file and add or modify the following lines in the \"### BEGIN /etc/grub.d/01_users ###\" section:\n\nset superusers=\"superusers-account\"\nexport superusers\n\nOnce the superuser account has been added, update the grub.cfg file by running:\n\n$ sudo grubby --update-kernel=ALL'" + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61530r925352_chk", + "severity": "high", + "gid": "V-257789", + "rid": "SV-257789r925354_rule", + "stig_id": "RHEL-09-212020", + "gtitle": "SRG-OS-000080-GPOS-00048", + "fix_id": "F-61454r925353_fix", + "documentable": null, + "cci": [ + "CCI-000213" + ], + "nist": [ + "AC-3" + ] + } + }, + { + "id": "SV-257790", + "code": "control 'SV-257790' do\n title 'RHEL 9 /boot/grub2/grub.cfg file must be group-owned by root.'\n desc 'The \"root\" group is a highly privileged group. Furthermore, the group-owner of this file should not have any access privileges anyway.'\n desc 'check', 'Verify the group ownership of the \"/boot/grub2/grub.cfg\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /boot/grub2/grub.cfg \n\nroot /boot/grub2/grub.cfg\n\nIf \"/boot/grub2/grub.cfg\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /boot/grub2/grub.cfg to root by running the following command:\n\n$ sudo chgrp root /boot/grub2/grub.cfg'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61531r925355_chk'\n tag severity: 'medium'\n tag gid: 'V-257790'\n tag rid: 'SV-257790r925357_rule'\n tag stig_id: 'RHEL-09-212025'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61455r925356_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257790.rb" + }, + "title": "RHEL 9 /boot/grub2/grub.cfg file must be group-owned by root.", + "desc": "The \"root\" group is a highly privileged group. Furthermore, the group-owner of this file should not have any access privileges anyway.", + "descriptions": { + "default": "The \"root\" group is a highly privileged group. Furthermore, the group-owner of this file should not have any access privileges anyway.", + "check": "Verify the group ownership of the \"/boot/grub2/grub.cfg\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /boot/grub2/grub.cfg \n\nroot /boot/grub2/grub.cfg\n\nIf \"/boot/grub2/grub.cfg\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /boot/grub2/grub.cfg to root by running the following command:\n\n$ sudo chgrp root /boot/grub2/grub.cfg" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61531r925355_chk", + "severity": "medium", + "gid": "V-257790", + "rid": "SV-257790r925357_rule", + "stig_id": "RHEL-09-212025", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61455r925356_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257791", + "code": "control 'SV-257791' do\n title 'RHEL 9 /boot/grub2/grub.cfg file must be owned by root.'\n desc 'The \" /boot/grub2/grub.cfg\" file stores sensitive system configuration. Protection of this file is critical for system security.'\n desc 'check', 'Verify the ownership of the \"/boot/grub2/grub.cfg\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /boot/grub2/grub.cfg \n\nroot /boot/grub2/grub.cfg \n\nIf \"/boot/grub2/grub.cfg\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /boot/grub2/grub.cfg to root by running the following command:\n\n$ sudo chown root /boot/grub2/grub.cfg'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61532r925358_chk'\n tag severity: 'medium'\n tag gid: 'V-257791'\n tag rid: 'SV-257791r925360_rule'\n tag stig_id: 'RHEL-09-212030'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61456r925359_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257791.rb" + }, + "title": "RHEL 9 /boot/grub2/grub.cfg file must be owned by root.", + "desc": "The \" /boot/grub2/grub.cfg\" file stores sensitive system configuration. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \" /boot/grub2/grub.cfg\" file stores sensitive system configuration. Protection of this file is critical for system security.", + "check": "Verify the ownership of the \"/boot/grub2/grub.cfg\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /boot/grub2/grub.cfg \n\nroot /boot/grub2/grub.cfg \n\nIf \"/boot/grub2/grub.cfg\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /boot/grub2/grub.cfg to root by running the following command:\n\n$ sudo chown root /boot/grub2/grub.cfg" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61532r925358_chk", + "severity": "medium", + "gid": "V-257791", + "rid": "SV-257791r925360_rule", + "stig_id": "RHEL-09-212030", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61456r925359_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257792", + "code": "control 'SV-257792' do\n title 'RHEL 9 must disable virtual system calls.'\n desc 'System calls are special routines in the Linux kernel, which userspace applications ask to do privileged tasks. Invoking a system call is an expensive operation because the processor must interrupt the currently executing task and switch context to kernel mode and then back to userspace after the system call completes. Virtual system calls map into user space a page that contains some variables and the implementation of some system calls. This allows the system calls to be executed in userspace to alleviate the context switching expense.\n\nVirtual system calls provide an opportunity of attack for a user who has control of the return instruction pointer. Disabling virtual system calls help to prevent return oriented programming (ROP) attacks via buffer overflows and overruns. If the system intends to run containers based on RHEL 6 components, then virtual system calls will need enabled so the components function properly.\n\n'\n desc 'check', %q(Verify the current GRUB 2 configuration disables virtual system calls with the following command:\n\n$ sudo grubby --info=ALL | grep args | grep -v 'vsyscall=none'\n\nIf any output is returned, this is a finding.\n\nCheck that virtual system calls are disabled by default to persist in kernel updates with the following command: \n\n$ sudo grep vsyscall /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"vsyscall=none\"\n\nIf \"vsyscall\" is not set to \"none\", is missing or commented out, and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.)\n desc 'fix', 'Document the use of virtual system calls with the ISSO as an operational requirement or disable them with the following command:\n\n$ sudo grubby --update-kernel=ALL --args=\"vsyscall=none\"\n\nAdd or modify the following line in \"/etc/default/grub\" to ensure the configuration survives kernel updates:\n\nGRUB_CMDLINE_LINUX=\"vsyscall=none\"'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61533r925361_chk'\n tag severity: 'medium'\n tag gid: 'V-257792'\n tag rid: 'SV-257792r925363_rule'\n tag stig_id: 'RHEL-09-212035'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61457r925362_fix'\n tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000134-GPOS-00068']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-001084']\n tag nist: ['CM-6 b', 'SC-3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257792.rb" + }, + "title": "RHEL 9 must disable virtual system calls.", + "desc": "System calls are special routines in the Linux kernel, which userspace applications ask to do privileged tasks. Invoking a system call is an expensive operation because the processor must interrupt the currently executing task and switch context to kernel mode and then back to userspace after the system call completes. Virtual system calls map into user space a page that contains some variables and the implementation of some system calls. This allows the system calls to be executed in userspace to alleviate the context switching expense.\n\nVirtual system calls provide an opportunity of attack for a user who has control of the return instruction pointer. Disabling virtual system calls help to prevent return oriented programming (ROP) attacks via buffer overflows and overruns. If the system intends to run containers based on RHEL 6 components, then virtual system calls will need enabled so the components function properly.\n\n", + "descriptions": { + "default": "System calls are special routines in the Linux kernel, which userspace applications ask to do privileged tasks. Invoking a system call is an expensive operation because the processor must interrupt the currently executing task and switch context to kernel mode and then back to userspace after the system call completes. Virtual system calls map into user space a page that contains some variables and the implementation of some system calls. This allows the system calls to be executed in userspace to alleviate the context switching expense.\n\nVirtual system calls provide an opportunity of attack for a user who has control of the return instruction pointer. Disabling virtual system calls help to prevent return oriented programming (ROP) attacks via buffer overflows and overruns. If the system intends to run containers based on RHEL 6 components, then virtual system calls will need enabled so the components function properly.\n\n", + "check": "Verify the current GRUB 2 configuration disables virtual system calls with the following command:\n\n$ sudo grubby --info=ALL | grep args | grep -v 'vsyscall=none'\n\nIf any output is returned, this is a finding.\n\nCheck that virtual system calls are disabled by default to persist in kernel updates with the following command: \n\n$ sudo grep vsyscall /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"vsyscall=none\"\n\nIf \"vsyscall\" is not set to \"none\", is missing or commented out, and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.", + "fix": "Document the use of virtual system calls with the ISSO as an operational requirement or disable them with the following command:\n\n$ sudo grubby --update-kernel=ALL --args=\"vsyscall=none\"\n\nAdd or modify the following line in \"/etc/default/grub\" to ensure the configuration survives kernel updates:\n\nGRUB_CMDLINE_LINUX=\"vsyscall=none\"" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61533r925361_chk", + "severity": "medium", + "gid": "V-257792", + "rid": "SV-257792r925363_rule", + "stig_id": "RHEL-09-212035", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61457r925362_fix", + "satisfies": [ + "SRG-OS-000480-GPOS-00227", + "SRG-OS-000134-GPOS-00068" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-001084" + ], + "nist": [ + "CM-6 b", + "SC-3" + ] + } + }, + { + "id": "SV-257793", + "code": "control 'SV-257793' do\n title 'RHEL 8 must clear the page allocator to prevent use-after-free\nattacks.'\n desc 'Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Poisoning writes an arbitrary value to freed pages, so any modification or\nreference to that page after being freed or before being initialized will be\ndetected and prevented. This prevents many types of use-after-free\nvulnerabilities at little performance cost. Also prevents leak of data and\ndetection of corrupted memory.'\n desc 'check', 'Verify that GRUB 2 is configured to enable page poisoning to mitigate use-after-free vulnerabilities with the following commands:\n\nCheck that the current GRUB 2 configuration has page poisoning enabled:\n\n$ sudo grub2-editenv list | grep page_poison\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 page_poison=1 vsyscall=none audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf \"page_poison\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that page poisoning is enabled by default to persist in kernel updates:\n\n$ sudo grep page_poison /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"page_poison=1\"\n\nIf \"page_poison\" is not set to \"1\", is missing or commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to enable page poisoning with the following commands:\n\n $ sudo grubby --update-kernel=ALL --args=\"page_poison=1\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"page_poison=1\"'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000134-GPOS-00068'\n tag satisfies: ['SRG-OS-000134-GPOS-00068', 'SRG-OS-000433-GPOS-00192']\n tag gid: 'V-230277'\n tag rid: 'SV-257793r792884_rule'\n tag stig_id: 'RHEL-08-010421'\n tag fix_id: 'F-32921r567578_fix'\n tag cci: ['CCI-001084']\n tag nist: ['SC-3']\n tag 'host'\n\n grub_stdout = command('grub2-editenv - list').stdout\n setting = /page_poison\\s*=\\s*1/\n\n describe 'GRUB config' do\n it 'should enable page poisoning' do\n expect(parse_config(grub_stdout)['kernelopts']).to match(setting), 'Current GRUB configuration does not disable this setting'\n expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257793.rb" + }, + "title": "RHEL 8 must clear the page allocator to prevent use-after-free\nattacks.", + "desc": "Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Poisoning writes an arbitrary value to freed pages, so any modification or\nreference to that page after being freed or before being initialized will be\ndetected and prevented. This prevents many types of use-after-free\nvulnerabilities at little performance cost. Also prevents leak of data and\ndetection of corrupted memory.", + "descriptions": { + "default": "Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Poisoning writes an arbitrary value to freed pages, so any modification or\nreference to that page after being freed or before being initialized will be\ndetected and prevented. This prevents many types of use-after-free\nvulnerabilities at little performance cost. Also prevents leak of data and\ndetection of corrupted memory.", + "check": "Verify that GRUB 2 is configured to enable page poisoning to mitigate use-after-free vulnerabilities with the following commands:\n\nCheck that the current GRUB 2 configuration has page poisoning enabled:\n\n$ sudo grub2-editenv list | grep page_poison\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 page_poison=1 vsyscall=none audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf \"page_poison\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that page poisoning is enabled by default to persist in kernel updates:\n\n$ sudo grep page_poison /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"page_poison=1\"\n\nIf \"page_poison\" is not set to \"1\", is missing or commented out, this is a finding.", + "fix": "Configure RHEL 8 to enable page poisoning with the following commands:\n\n $ sudo grubby --update-kernel=ALL --args=\"page_poison=1\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"page_poison=1\"" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000134-GPOS-00068", + "satisfies": [ + "SRG-OS-000134-GPOS-00068", + "SRG-OS-000433-GPOS-00192" + ], + "gid": "V-230277", + "rid": "SV-257793r792884_rule", + "stig_id": "RHEL-08-010421", + "fix_id": "F-32921r567578_fix", + "cci": [ + "CCI-001084" + ], + "nist": [ + "SC-3" + ], + "host": null + } + }, + { + "id": "SV-257794", + "code": "control 'SV-257794' do\n title 'RHEL 8 must clear SLUB/SLAB objects to prevent use-after-free attacks.'\n desc 'Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Poisoning writes an arbitrary value to freed pages, so any modification or\nreference to that page after being freed or before being initialized will be\ndetected and prevented. This prevents many types of use-after-free\nvulnerabilities at little performance cost. Also prevents leak of data and\ndetection of corrupted memory.\n\n SLAB objects are blocks of physically-contiguous memory. SLUB is the\nunqueued SLAB allocator.'\n desc 'check', 'Verify that GRUB 2 is configured to enable poisoning of SLUB/SLAB objects to mitigate use-after-free vulnerabilities with the following commands:\n\nCheck that the current GRUB 2 configuration has poisoning of SLUB/SLAB objects enabled:\n\n$ sudo grub2-editenv list | grep slub_debug\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 slub_debug=P page_poison=1 vsyscall=none audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf \"slub_debug\" is not set to \"P\" or is missing, this is a finding.\n\nCheck that poisoning of SLUB/SLAB objects is enabled by default to persist in kernel updates:\n\n$ sudo grep slub_debug /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"slub_debug=P\"\n\nIf \"slub_debug\" is not set to \"P\", is missing or commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to enable poisoning of SLUB/SLAB objects with the\nfollowing commands:\n\n $ sudo grubby --update-kernel=ALL --args=\"slub_debug=P\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"slub_debug=P\"'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000134-GPOS-00068'\n tag satisfies: ['SRG-OS-000134-GPOS-00068', 'SRG-OS-000433-GPOS-00192']\n tag gid: 'V-230279'\n tag rid: 'SV-257794r792888_rule'\n tag stig_id: 'RHEL-08-010423'\n tag fix_id: 'F-32923r567584_fix'\n tag cci: ['CCI-001084']\n tag nist: ['SC-3']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n grub_stdout = command('grub2-editenv - list').stdout\n setting = /slub_debug\\s*=\\s*P/\n\n describe 'GRUB config' do\n it 'should enable page poisoning' do\n expect(parse_config(grub_stdout)['kernelopts']).to match(setting), 'Current GRUB configuration does not disable this setting'\n expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257794.rb" + }, + "title": "RHEL 8 must clear SLUB/SLAB objects to prevent use-after-free attacks.", + "desc": "Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Poisoning writes an arbitrary value to freed pages, so any modification or\nreference to that page after being freed or before being initialized will be\ndetected and prevented. This prevents many types of use-after-free\nvulnerabilities at little performance cost. Also prevents leak of data and\ndetection of corrupted memory.\n\n SLAB objects are blocks of physically-contiguous memory. SLUB is the\nunqueued SLAB allocator.", + "descriptions": { + "default": "Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Poisoning writes an arbitrary value to freed pages, so any modification or\nreference to that page after being freed or before being initialized will be\ndetected and prevented. This prevents many types of use-after-free\nvulnerabilities at little performance cost. Also prevents leak of data and\ndetection of corrupted memory.\n\n SLAB objects are blocks of physically-contiguous memory. SLUB is the\nunqueued SLAB allocator.", + "check": "Verify that GRUB 2 is configured to enable poisoning of SLUB/SLAB objects to mitigate use-after-free vulnerabilities with the following commands:\n\nCheck that the current GRUB 2 configuration has poisoning of SLUB/SLAB objects enabled:\n\n$ sudo grub2-editenv list | grep slub_debug\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 slub_debug=P page_poison=1 vsyscall=none audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf \"slub_debug\" is not set to \"P\" or is missing, this is a finding.\n\nCheck that poisoning of SLUB/SLAB objects is enabled by default to persist in kernel updates:\n\n$ sudo grep slub_debug /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"slub_debug=P\"\n\nIf \"slub_debug\" is not set to \"P\", is missing or commented out, this is a finding.", + "fix": "Configure RHEL 8 to enable poisoning of SLUB/SLAB objects with the\nfollowing commands:\n\n $ sudo grubby --update-kernel=ALL --args=\"slub_debug=P\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"slub_debug=P\"" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000134-GPOS-00068", + "satisfies": [ + "SRG-OS-000134-GPOS-00068", + "SRG-OS-000433-GPOS-00192" + ], + "gid": "V-230279", + "rid": "SV-257794r792888_rule", + "stig_id": "RHEL-08-010423", + "fix_id": "F-32923r567584_fix", + "cci": [ + "CCI-001084" + ], + "nist": [ + "SC-3" + ], + "host": null + } + }, + { + "id": "SV-257795", + "code": "control 'SV-257795' do\n title 'RHEL 8 must enable mitigations against processor-based\nvulnerabilities.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.\n\n Kernel page-table isolation is a kernel feature that mitigates the Meltdown\nsecurity vulnerability and hardens the kernel against attempts to bypass kernel\naddress space layout randomization (KASLR).'\n desc 'check', 'Verify RHEL 8 enables kernel page-table isolation with the following commands:\n\n$ sudo grub2-editenv list | grep pti\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 pti=on boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the \"pti\" entry does not equal \"on\", is missing, or the line is commented out, this is a finding.\n\nCheck that kernel page-table isolation is enabled by default to persist in kernel updates:\n\n$ sudo grep pti /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"pti=on\"\n\nIf \"pti\" is not set to \"on\", is missing or commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to enable kernel page-table isolation with the following\ncommand:\n\n $ sudo grubby --update-kernel=ALL --args=\"pti=on\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"pti=on\"'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230491'\n tag rid: 'SV-257795r818842_rule'\n tag stig_id: 'RHEL-08-040004'\n tag fix_id: 'F-33135r568220_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n grub_stdout = command('grub2-editenv - list').stdout\n\n describe parse_config(grub_stdout) do\n its('kernelopts') { should match(/pti=on/) }\n end\n describe parse_config_file('/etc/default/grub') do\n its('GRUB_CMDLINE_LINUX') { should match(/pti=on/) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257795.rb" + }, + "title": "RHEL 8 must enable mitigations against processor-based\nvulnerabilities.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.\n\n Kernel page-table isolation is a kernel feature that mitigates the Meltdown\nsecurity vulnerability and hardens the kernel against attempts to bypass kernel\naddress space layout randomization (KASLR).", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.\n\n Kernel page-table isolation is a kernel feature that mitigates the Meltdown\nsecurity vulnerability and hardens the kernel against attempts to bypass kernel\naddress space layout randomization (KASLR).", + "check": "Verify RHEL 8 enables kernel page-table isolation with the following commands:\n\n$ sudo grub2-editenv list | grep pti\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 pti=on boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the \"pti\" entry does not equal \"on\", is missing, or the line is commented out, this is a finding.\n\nCheck that kernel page-table isolation is enabled by default to persist in kernel updates:\n\n$ sudo grep pti /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"pti=on\"\n\nIf \"pti\" is not set to \"on\", is missing or commented out, this is a finding.", + "fix": "Configure RHEL 8 to enable kernel page-table isolation with the following\ncommand:\n\n $ sudo grubby --update-kernel=ALL --args=\"pti=on\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"pti=on\"" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230491", + "rid": "SV-257795r818842_rule", + "stig_id": "RHEL-08-040004", + "fix_id": "F-33135r568220_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257796", + "code": "control 'SV-257796' do\n title 'RHEL 8 must enable auditing of processes that start prior to the audit\ndaemon.'\n desc 'Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.'\n desc 'check', 'Verify RHEL 8 enables auditing of processes that start prior to the audit daemon with the following commands:\n\n$ sudo grub2-editenv list | grep audit\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the \"audit\" entry does not equal \"1\", is missing, or the line is commented out, this is a finding.\n\nCheck that auditing is enabled by default to persist in kernel updates:\n\n$ sudo grep audit /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"audit=1\"\n\nIf \"audit\" is not set to \"1\", is missing or commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to audit processes that start prior to the audit daemon\nwith the following command:\n\n $ sudo grubby --update-kernel=ALL --args=\"audit=1\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"audit=1\"'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218']\n tag gid: 'V-230468'\n tag rid: 'SV-257796r792904_rule'\n tag stig_id: 'RHEL-08-030601'\n tag fix_id: 'F-33112r568151_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n grub_config = command('grub2-editenv - list').stdout\n\n describe parse_config(grub_config) do\n its('kernelopts') { should match(/audit=1/) }\n end\n\n describe parse_config_file('/etc/default/grub') do\n its('GRUB_CMDLINE_LINUX') { should match(/audit=1/) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257796.rb" + }, + "title": "RHEL 8 must enable auditing of processes that start prior to the audit\ndaemon.", + "desc": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "descriptions": { + "default": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "check": "Verify RHEL 8 enables auditing of processes that start prior to the audit daemon with the following commands:\n\n$ sudo grub2-editenv list | grep audit\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the \"audit\" entry does not equal \"1\", is missing, or the line is commented out, this is a finding.\n\nCheck that auditing is enabled by default to persist in kernel updates:\n\n$ sudo grep audit /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"audit=1\"\n\nIf \"audit\" is not set to \"1\", is missing or commented out, this is a finding.", + "fix": "Configure RHEL 8 to audit processes that start prior to the audit daemon\nwith the following command:\n\n $ sudo grubby --update-kernel=ALL --args=\"audit=1\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"audit=1\"" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000473-GPOS-00218" + ], + "gid": "V-230468", + "rid": "SV-257796r792904_rule", + "stig_id": "RHEL-08-030601", + "fix_id": "F-33112r568151_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-257797", + "code": "control 'SV-257797' do\n title 'RHEL 8 must restrict access to the kernel message buffer.'\n desc 'Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection.\n\nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies.\n\nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.\n\nRestricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a non-privileged user.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify the operating system is configured to restrict access to the kernel message buffer with the following commands:\n\nCheck the status of the kernel.dmesg_restrict kernel parameter.\n\n$ sudo sysctl kernel.dmesg_restrict\n\nkernel.dmesg_restrict = 1\n\nIf \"kernel.dmesg_restrict\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.dmesg_restrict /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.dmesg_restrict = 1\n\nIf \"kernel.dmesg_restrict\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to restrict access to the kernel message buffer.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.dmesg_restrict = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000138-GPOS-00069'\n tag gid: 'V-230269'\n tag rid: 'SV-257797r858756_rule'\n tag stig_id: 'RHEL-08-010375'\n tag fix_id: 'F-32913r858755_fix'\n tag cci: ['CCI-001090']\n tag nist: ['SC-4']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n action = 'kernel.dmesg_restrict'\n\n describe kernel_parameter(action) do\n its('value') { should eq 1 }\n end\n\n search_result = command(\"grep -r ^#{action} #{input('sysctl_conf_files').join(' ')}\").stdout.strip\n\n correct_result = search_result.lines.any? { |line| line.match(/#{action}\\s*=\\s*1$/) }\n incorrect_results = search_result.lines.map(&:strip).select { |line| line.match(/#{action}\\s*=\\s*[^1]$/) }\n\n describe 'Kernel config files' do\n it \"should configure '#{action}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257797.rb" + }, + "title": "RHEL 8 must restrict access to the kernel message buffer.", + "desc": "Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection.\n\nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies.\n\nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.\n\nRestricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a non-privileged user.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection.\n\nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies.\n\nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.\n\nRestricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a non-privileged user.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify the operating system is configured to restrict access to the kernel message buffer with the following commands:\n\nCheck the status of the kernel.dmesg_restrict kernel parameter.\n\n$ sudo sysctl kernel.dmesg_restrict\n\nkernel.dmesg_restrict = 1\n\nIf \"kernel.dmesg_restrict\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.dmesg_restrict /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.dmesg_restrict = 1\n\nIf \"kernel.dmesg_restrict\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to restrict access to the kernel message buffer.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.dmesg_restrict = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000138-GPOS-00069", + "gid": "V-230269", + "rid": "SV-257797r858756_rule", + "stig_id": "RHEL-08-010375", + "fix_id": "F-32913r858755_fix", + "cci": [ + "CCI-001090" + ], + "nist": [ + "SC-4" + ], + "host": null + } + }, + { + "id": "SV-257798", + "code": "control 'SV-257798' do\n title 'RHEL 8 must prevent kernel profiling by unprivileged users.'\n desc 'Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection.\n\nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies.\n\nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.\n\nSetting the kernel.perf_event_paranoid kernel parameter to \"2\" prevents attackers from gaining additional system information as a non-privileged user.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify the operating system is configured to prevent kernel profiling by unprivileged users with the following commands:\n\nCheck the status of the kernel.perf_event_paranoid kernel parameter.\n\n$ sudo sysctl kernel.perf_event_paranoid\n\nkernel.perf_event_paranoid = 2\n\nIf \"kernel.perf_event_paranoid\" is not set to \"2\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.perf_event_paranoid /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.perf_event_paranoid = 2\n\nIf \"kernel.perf_event_paranoid\" is not set to \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to prevent kernel profiling by unprivileged users.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.perf_event_paranoid = 2\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000138-GPOS-00069'\n tag gid: 'V-230270'\n tag rid: 'SV-257798r858758_rule'\n tag stig_id: 'RHEL-08-010376'\n tag fix_id: 'F-32914r858757_fix'\n tag cci: ['CCI-001090']\n tag nist: ['SC-4']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n action = 'kernel.perf_event_paranoid'\n\n describe kernel_parameter(action) do\n its('value') { should eq 2 }\n end\n\n search_result = command(\"grep -r ^#{action} #{input('sysctl_conf_files').join(' ')}\").stdout.strip\n\n correct_result = search_result.lines.any? { |line| line.match(/#{action}\\s*=\\s*2$/) }\n incorrect_results = search_result.lines.map(&:strip).select { |line| line.match(/#{action}\\s*=\\s*[^2]$/) }\n\n describe 'Kernel config files' do\n it \"should configure '#{action}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257798.rb" + }, + "title": "RHEL 8 must prevent kernel profiling by unprivileged users.", + "desc": "Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection.\n\nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies.\n\nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.\n\nSetting the kernel.perf_event_paranoid kernel parameter to \"2\" prevents attackers from gaining additional system information as a non-privileged user.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection.\n\nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DoD or other government agencies.\n\nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.\n\nSetting the kernel.perf_event_paranoid kernel parameter to \"2\" prevents attackers from gaining additional system information as a non-privileged user.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify the operating system is configured to prevent kernel profiling by unprivileged users with the following commands:\n\nCheck the status of the kernel.perf_event_paranoid kernel parameter.\n\n$ sudo sysctl kernel.perf_event_paranoid\n\nkernel.perf_event_paranoid = 2\n\nIf \"kernel.perf_event_paranoid\" is not set to \"2\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.perf_event_paranoid /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.perf_event_paranoid = 2\n\nIf \"kernel.perf_event_paranoid\" is not set to \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to prevent kernel profiling by unprivileged users.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.perf_event_paranoid = 2\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000138-GPOS-00069", + "gid": "V-230270", + "rid": "SV-257798r858758_rule", + "stig_id": "RHEL-08-010376", + "fix_id": "F-32914r858757_fix", + "cci": [ + "CCI-001090" + ], + "nist": [ + "SC-4" + ], + "host": null + } + }, + { + "id": "SV-257799", + "code": "control 'SV-257799' do\n title 'RHEL 8 must prevent the loading of a new kernel for later execution.'\n desc 'Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nDisabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify the operating system is configured to disable kernel image loading with the following commands:\n\nCheck the status of the kernel.kexec_load_disabled kernel parameter.\n\n$ sudo sysctl kernel.kexec_load_disabled\n\nkernel.kexec_load_disabled = 1\n\nIf \"kernel.kexec_load_disabled\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.kexec_load_disabled /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.kexec_load_disabled = 1\n\nIf \"kernel.kexec_load_disabled\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to disable kernel image loading.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.kexec_load_disabled = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000366-GPOS-00153'\n tag gid: 'V-230266'\n tag rid: 'SV-257799r877463_rule'\n tag stig_id: 'RHEL-08-010372'\n tag fix_id: 'F-32910r858747_fix'\n tag cci: ['CCI-001749']\n tag nist: ['CM-5 (3)']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n action = 'kernel.kexec_load_disabled'\n\n describe kernel_parameter(action) do\n its('value') { should eq 1 }\n end\n\n search_result = command(\"grep -r ^#{action} #{input('sysctl_conf_files').join(' ')}\").stdout.strip\n\n correct_result = search_result.lines.any? { |line| line.match(/#{action}\\s*=\\s*1$/) }\n incorrect_results = search_result.lines.map(&:strip).select { |line| line.match(/#{action}\\s*=\\s*[^1]$/) }\n\n describe 'Kernel config files' do\n it \"should configure '#{action}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257799.rb" + }, + "title": "RHEL 8 must prevent the loading of a new kernel for later execution.", + "desc": "Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nDisabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nDisabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify the operating system is configured to disable kernel image loading with the following commands:\n\nCheck the status of the kernel.kexec_load_disabled kernel parameter.\n\n$ sudo sysctl kernel.kexec_load_disabled\n\nkernel.kexec_load_disabled = 1\n\nIf \"kernel.kexec_load_disabled\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.kexec_load_disabled /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.kexec_load_disabled = 1\n\nIf \"kernel.kexec_load_disabled\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to disable kernel image loading.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.kexec_load_disabled = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000366-GPOS-00153", + "gid": "V-230266", + "rid": "SV-257799r877463_rule", + "stig_id": "RHEL-08-010372", + "fix_id": "F-32910r858747_fix", + "cci": [ + "CCI-001749" + ], + "nist": [ + "CM-5 (3)" + ], + "host": null + } + }, + { + "id": "SV-257800", + "code": "control 'SV-257800' do\n title 'RHEL 8 must restrict exposed kernel pointer addresses access.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 restricts exposed kernel pointer addresses access with the following commands:\n\n$ sudo sysctl kernel.kptr_restrict\n\nkernel.kptr_restrict = 1\n\nIf the returned line does not have a value of \"1\" or \"2\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r kernel.kptr_restrict /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: kernel.kptr_restrict = 1\n\nIf \"kernel.kptr_restrict\" is not set to \"1\" or \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to restrict exposed kernel pointer addresses access by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nkernel.kptr_restrict = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230547'\n tag rid: 'SV-257800r858826_rule'\n tag stig_id: 'RHEL-08-040283'\n tag fix_id: 'F-33191r858825_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'kernel.kptr_restrict'\n action = 'kernel pointer addresses'\n value = 1\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257800.rb" + }, + "title": "RHEL 8 must restrict exposed kernel pointer addresses access.", + "desc": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 restricts exposed kernel pointer addresses access with the following commands:\n\n$ sudo sysctl kernel.kptr_restrict\n\nkernel.kptr_restrict = 1\n\nIf the returned line does not have a value of \"1\" or \"2\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r kernel.kptr_restrict /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: kernel.kptr_restrict = 1\n\nIf \"kernel.kptr_restrict\" is not set to \"1\" or \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to restrict exposed kernel pointer addresses access by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nkernel.kptr_restrict = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230547", + "rid": "SV-257800r858826_rule", + "stig_id": "RHEL-08-040283", + "fix_id": "F-33191r858825_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257801", + "code": "control 'SV-257801' do\n title 'RHEL 8 must enable kernel parameters to enforce discretionary access control on hardlinks.'\n desc 'Discretionary Access Control (DAC) is based on the notion that individual users are \"owners\" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions.\n\n When discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.\n\n By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat().\n\n The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n\n /etc/sysctl.d/*.conf\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf'\n desc 'check', 'Verify the operating system is configured to enable DAC on hardlinks with the following commands:\n\n Check the status of the fs.protected_hardlinks kernel parameter.\n\n $ sudo sysctl fs.protected_hardlinks\n\n fs.protected_hardlinks = 1\n\n If \"fs.protected_hardlinks\" is not set to \"1\" or is missing, this is a finding.\n\n Check that the configuration files are present to enable this kernel parameter.\n\n $ sudo grep -r fs.protected_hardlinks /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n /etc/sysctl.d/99-sysctl.conf:fs.protected_hardlinks = 1\n\n If \"fs.protected_hardlinks\" is not set to \"1\", is missing or commented out, this is a finding.\n\n If conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to enable DAC on hardlinks.\n\n Add or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\n fs.protected_hardlinks = 1\n\n Remove any configurations that conflict with the above from the following locations:\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf\n /etc/sysctl.d/*.conf\n\n Load settings from all system configuration files with the following command:\n\n $ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000312-GPOS-00122'\n tag satisfies: ['SRG-OS-000312-GPOS-00122', 'SRG-OS-000312-GPOS-00123', 'SRG-OS-000312-GPOS-00124', 'SRG-OS-000324-GPOS-00125']\n tag gid: 'V-230268'\n tag rid: 'SV-257801r858754_rule'\n tag stig_id: 'RHEL-08-010374'\n tag fix_id: 'F-32912r858753_fix'\n tag cci: ['CCI-002165']\n tag nist: ['AC-3 (4)']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n action = 'fs.protected_hardlinks'\n\n describe kernel_parameter(action) do\n its('value') { should eq 1 }\n end\n\n search_result = command(\"grep -r ^#{action} #{input('sysctl_conf_files').join(' ')}\").stdout.strip\n\n correct_result = search_result.lines.any? { |line| line.match(/#{action}\\s*=\\s*1$/) }\n incorrect_results = search_result.lines.map(&:strip).select { |line| line.match(/#{action}\\s*=\\s*[^1]$/) }\n\n describe 'Kernel config files' do\n it \"should configure '#{action}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257801.rb" + }, + "title": "RHEL 8 must enable kernel parameters to enforce discretionary access control on hardlinks.", + "desc": "Discretionary Access Control (DAC) is based on the notion that individual users are \"owners\" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions.\n\n When discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.\n\n By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat().\n\n The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n\n /etc/sysctl.d/*.conf\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf", + "descriptions": { + "default": "Discretionary Access Control (DAC) is based on the notion that individual users are \"owners\" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions.\n\n When discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.\n\n By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat().\n\n The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n\n /etc/sysctl.d/*.conf\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf", + "check": "Verify the operating system is configured to enable DAC on hardlinks with the following commands:\n\n Check the status of the fs.protected_hardlinks kernel parameter.\n\n $ sudo sysctl fs.protected_hardlinks\n\n fs.protected_hardlinks = 1\n\n If \"fs.protected_hardlinks\" is not set to \"1\" or is missing, this is a finding.\n\n Check that the configuration files are present to enable this kernel parameter.\n\n $ sudo grep -r fs.protected_hardlinks /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n /etc/sysctl.d/99-sysctl.conf:fs.protected_hardlinks = 1\n\n If \"fs.protected_hardlinks\" is not set to \"1\", is missing or commented out, this is a finding.\n\n If conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to enable DAC on hardlinks.\n\n Add or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\n fs.protected_hardlinks = 1\n\n Remove any configurations that conflict with the above from the following locations:\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf\n /etc/sysctl.d/*.conf\n\n Load settings from all system configuration files with the following command:\n\n $ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000312-GPOS-00122", + "satisfies": [ + "SRG-OS-000312-GPOS-00122", + "SRG-OS-000312-GPOS-00123", + "SRG-OS-000312-GPOS-00124", + "SRG-OS-000324-GPOS-00125" + ], + "gid": "V-230268", + "rid": "SV-257801r858754_rule", + "stig_id": "RHEL-08-010374", + "fix_id": "F-32912r858753_fix", + "cci": [ + "CCI-002165" + ], + "nist": [ + "AC-3 (4)" + ], + "host": null + } + }, + { + "id": "SV-257802", + "code": "control 'SV-257802' do\n title 'RHEL 8 must enable kernel parameters to enforce discretionary access\ncontrol on symlinks.'\n desc %q(Discretionary Access Control (DAC) is based on the notion that individual users are \"owners\" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions.\n\nWhen discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.\n\nBy enabling the fs.protected_symlinks kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the UID of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat().\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf)\n desc 'check', 'Verify the operating system is configured to enable DAC on symlinks with the following commands:\n\nCheck the status of the fs.protected_symlinks kernel parameter.\n\n$ sudo sysctl fs.protected_symlinks\n\nfs.protected_symlinks = 1\n\nIf \"fs.protected_symlinks\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r fs.protected_symlinks /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:fs.protected_symlinks = 1\n\nIf \"fs.protected_symlinks\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to enable DAC on symlinks.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nfs.protected_symlinks = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000312-GPOS-00122'\n tag satisfies: ['SRG-OS-000312-GPOS-00122', 'SRG-OS-000312-GPOS-00123', 'SRG-OS-000312-GPOS-00124', 'SRG-OS-000324-GPOS-00125']\n tag gid: 'V-230267'\n tag rid: 'SV-257802r858751_rule'\n tag stig_id: 'RHEL-08-010373'\n tag fix_id: 'F-32911r858750_fix'\n tag cci: ['CCI-002165']\n tag nist: ['AC-3 (4)']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n action = 'fs.protected_symlinks'\n\n describe kernel_parameter(action) do\n its('value') { should eq 1 }\n end\n\n search_result = command(\"grep -r ^#{action} #{input('sysctl_conf_files').join(' ')}\").stdout.strip\n\n correct_result = search_result.lines.any? { |line| line.match(/#{action}\\s*=\\s*1$/) }\n incorrect_results = search_result.lines.map(&:strip).select { |line| line.match(/#{action}\\s*=\\s*[^1]$/) }\n\n describe 'Kernel config files' do\n it \"should configure '#{action}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257802.rb" + }, + "title": "RHEL 8 must enable kernel parameters to enforce discretionary access\ncontrol on symlinks.", + "desc": "Discretionary Access Control (DAC) is based on the notion that individual users are \"owners\" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions.\n\nWhen discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.\n\nBy enabling the fs.protected_symlinks kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the UID of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat().\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Discretionary Access Control (DAC) is based on the notion that individual users are \"owners\" of objects and therefore have discretion over who should be authorized to access the object and in which mode (e.g., read or write). Ownership is usually acquired as a consequence of creating the object or via specified ownership assignment. DAC allows the owner to determine who will have access to objects they control. An example of DAC includes user-controlled file permissions.\n\nWhen discretionary access control policies are implemented, subjects are not constrained with regard to what actions they can take with information for which they have already been granted access. Thus, subjects that have been granted access to information are not prevented from passing (i.e., the subjects have the discretion to pass) the information to other subjects or objects. A subject that is constrained in its operation by Mandatory Access Control policies is still able to operate under the less rigorous constraints of this requirement. Thus, while Mandatory Access Control imposes constraints preventing a subject from passing information to another subject operating at a different sensitivity level, this requirement permits the subject to pass the information to any subject at the same sensitivity level. The policy is bounded by the information system boundary. Once the information is passed outside the control of the information system, additional means may be required to ensure the constraints remain in effect. While the older, more traditional definitions of discretionary access control require identity-based access control, that limitation is not required for this use of discretionary access control.\n\nBy enabling the fs.protected_symlinks kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the UID of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat().\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify the operating system is configured to enable DAC on symlinks with the following commands:\n\nCheck the status of the fs.protected_symlinks kernel parameter.\n\n$ sudo sysctl fs.protected_symlinks\n\nfs.protected_symlinks = 1\n\nIf \"fs.protected_symlinks\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r fs.protected_symlinks /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:fs.protected_symlinks = 1\n\nIf \"fs.protected_symlinks\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to enable DAC on symlinks.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nfs.protected_symlinks = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000312-GPOS-00122", + "satisfies": [ + "SRG-OS-000312-GPOS-00122", + "SRG-OS-000312-GPOS-00123", + "SRG-OS-000312-GPOS-00124", + "SRG-OS-000324-GPOS-00125" + ], + "gid": "V-230267", + "rid": "SV-257802r858751_rule", + "stig_id": "RHEL-08-010373", + "fix_id": "F-32911r858750_fix", + "cci": [ + "CCI-002165" + ], + "nist": [ + "AC-3 (4)" + ], + "host": null + } + }, + { + "id": "SV-257803", + "code": "control 'SV-257803' do\n title 'RHEL 8 must disable the kernel.core_pattern.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 disables storing core dumps with the following commands:\n\n$ sudo sysctl kernel.core_pattern\n\nkernel.core_pattern = |/bin/false\n\nIf the returned line does not have a value of \"|/bin/false\", or a line is not returned and the need for core dumps is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.core_pattern /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.core_pattern = |/bin/false\n\nIf \"kernel.core_pattern\" is not set to \"|/bin/false\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to disable storing core dumps.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.core_pattern = |/bin/false\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230311'\n tag rid: 'SV-257803r858769_rule'\n tag stig_id: 'RHEL-08-010671'\n tag fix_id: 'F-32955r858768_fix'\n tag cci: ['CCI-000366']\n tag legacy: []\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n kernel_setting = 'kernel.core_pattern'\n kernel_expected_value = input('kernel_dump_expected_value')\n\n describe kernel_parameter(kernel_setting) do\n its('value') { should eq kernel_expected_value }\n end\n\n k_conf_files = input('kernel_config_files')\n\n # make sure the setting is set somewhere\n k_conf = command(\"grep -r #{kernel_setting} #{k_conf_files.join(' ')}\").stdout.split(\"\\n\")\n\n # make sure it is set correctly\n failing_k_conf = k_conf.reject { |k| k.match(/#{kernel_parameter}\\s*=\\s*#{kernel_expected_value}/) }\n\n describe 'Kernel config files' do\n it \"should set '#{kernel_setting}' on startup\" do\n expect(k_conf).to_not be_empty, \"Setting not found in any of the following config files:\\n\\t- #{k_conf_files.join(\"\\n\\t- \")}\"\n expect(failing_k_conf).to be_empty, \"Incorrect or conflicting settings found:\\n\\t- #{failing_k_conf.join(\"\\n\\t- \")}\" if k_conf.nil?\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257803.rb" + }, + "title": "RHEL 8 must disable the kernel.core_pattern.", + "desc": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 disables storing core dumps with the following commands:\n\n$ sudo sysctl kernel.core_pattern\n\nkernel.core_pattern = |/bin/false\n\nIf the returned line does not have a value of \"|/bin/false\", or a line is not returned and the need for core dumps is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.core_pattern /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.core_pattern = |/bin/false\n\nIf \"kernel.core_pattern\" is not set to \"|/bin/false\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to disable storing core dumps.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.core_pattern = |/bin/false\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230311", + "rid": "SV-257803r858769_rule", + "stig_id": "RHEL-08-010671", + "fix_id": "F-32955r858768_fix", + "cci": [ + "CCI-000366" + ], + "legacy": [], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257804", + "code": "control 'SV-257804' do\n title 'RHEL 8 must disable the asynchronous transfer mode (ATM) protocol.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Asynchronous Transfer Mode (ATM) is a protocol operating on network,\ndata link, and physical layers, based on virtual circuits and virtual paths.\nDisabling ATM protects the system against exploitation of any laws in its\nimplementation.'\n desc 'check', 'Verify the operating system disables the ability to load the ATM protocol kernel module.\n\n $ sudo grep -r atm /etc/modprobe.d/* | grep \"/bin/false\"\n install atm /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the ATM protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the ATM protocol.\n\nCheck to see if the ATM protocol is disabled with the following command:\n\n $ sudo grep -r atm /etc/modprobe.d/* | grep \"blacklist\"\n blacklist atm\n\nIf the command does not return any output or the output is not \"blacklist atm\", and use of the ATM protocol is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to use the ATM protocol kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install atm /bin/false\n blacklist atm\n\nReboot the system for the settings to take effect.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230494'\n tag rid: 'SV-257804r942918_rule'\n tag stig_id: 'RHEL-08-040021'\n tag fix_id: 'F-33138r942917_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe kernel_module('atm') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257804.rb" + }, + "title": "RHEL 8 must disable the asynchronous transfer mode (ATM) protocol.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Asynchronous Transfer Mode (ATM) is a protocol operating on network,\ndata link, and physical layers, based on virtual circuits and virtual paths.\nDisabling ATM protects the system against exploitation of any laws in its\nimplementation.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Asynchronous Transfer Mode (ATM) is a protocol operating on network,\ndata link, and physical layers, based on virtual circuits and virtual paths.\nDisabling ATM protects the system against exploitation of any laws in its\nimplementation.", + "check": "Verify the operating system disables the ability to load the ATM protocol kernel module.\n\n $ sudo grep -r atm /etc/modprobe.d/* | grep \"/bin/false\"\n install atm /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the ATM protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the ATM protocol.\n\nCheck to see if the ATM protocol is disabled with the following command:\n\n $ sudo grep -r atm /etc/modprobe.d/* | grep \"blacklist\"\n blacklist atm\n\nIf the command does not return any output or the output is not \"blacklist atm\", and use of the ATM protocol is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the ability to use the ATM protocol kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install atm /bin/false\n blacklist atm\n\nReboot the system for the settings to take effect." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230494", + "rid": "SV-257804r942918_rule", + "stig_id": "RHEL-08-040021", + "fix_id": "F-33138r942917_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257805", + "code": "control 'SV-257805' do\n title 'RHEL 8 must disable the controller area network (CAN) protocol.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Controller Area Network (CAN) is a serial communications protocol,\nwhich was initially developed for automotive and is now also used in marine,\nindustrial, and medical applications. Disabling CAN protects the system against\nexploitation of any flaws in its implementation.'\n desc 'check', 'Verify the operating system disables the ability to load the CAN protocol kernel module.\n\n $ sudo grep -r can /etc/modprobe.d/* | grep \"/bin/false\"\n install can /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the CAN protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the CAN protocol.\n\nCheck to see if the CAN protocol is disabled with the following command:\n\n $ sudo grep -r can /etc/modprobe.d/* | grep \"blacklist\"\n blacklist can\n\nIf the command does not return any output or the output is not \"blacklist can\", and use of the CAN protocol is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to use the CAN protocol kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install can /bin/false\n blacklist can\n\nReboot the system for the settings to take effect.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230495'\n tag rid: 'SV-257805r942921_rule'\n tag stig_id: 'RHEL-08-040022'\n tag fix_id: 'F-33139r942920_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe kernel_module('can') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257805.rb" + }, + "title": "RHEL 8 must disable the controller area network (CAN) protocol.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Controller Area Network (CAN) is a serial communications protocol,\nwhich was initially developed for automotive and is now also used in marine,\nindustrial, and medical applications. Disabling CAN protects the system against\nexploitation of any flaws in its implementation.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Controller Area Network (CAN) is a serial communications protocol,\nwhich was initially developed for automotive and is now also used in marine,\nindustrial, and medical applications. Disabling CAN protects the system against\nexploitation of any flaws in its implementation.", + "check": "Verify the operating system disables the ability to load the CAN protocol kernel module.\n\n $ sudo grep -r can /etc/modprobe.d/* | grep \"/bin/false\"\n install can /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the CAN protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the CAN protocol.\n\nCheck to see if the CAN protocol is disabled with the following command:\n\n $ sudo grep -r can /etc/modprobe.d/* | grep \"blacklist\"\n blacklist can\n\nIf the command does not return any output or the output is not \"blacklist can\", and use of the CAN protocol is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the ability to use the CAN protocol kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install can /bin/false\n blacklist can\n\nReboot the system for the settings to take effect." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230495", + "rid": "SV-257805r942921_rule", + "stig_id": "RHEL-08-040022", + "fix_id": "F-33139r942920_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257806", + "code": "control 'SV-257806' do\n title 'RHEL 8 must disable IEEE 1394 (FireWire) Support.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n The IEEE 1394 (FireWire) is a serial bus standard for high-speed real-time\ncommunication. Disabling FireWire protects the system against exploitation of\nany flaws in its implementation.'\n desc 'check', 'Verify the operating system disables the ability to load the firewire-core kernel module.\n\n $ sudo grep -r firewire-core /etc/modprobe.d/* | grep \"/bin/false\"\n install firewire-core /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the firewire-core protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the firewire-core kernel module.\n\nCheck to see if the firewire-core kernel module is disabled with the following command:\n\n $ sudo grep -r firewire-core /etc/modprobe.d/* | grep \"blacklist\"\n blacklist firewire-core\n\nIf the command does not return any output or the output is not \"blacklist firewire-core\", and use of the firewire-core kernel module is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to use the firewire-core kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install firewire-core /bin/false\n blacklist firewire-core\n\nReboot the system for the settings to take effect.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230499'\n tag rid: 'SV-257806r942933_rule'\n tag stig_id: 'RHEL-08-040026'\n tag fix_id: 'F-33143r942932_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe kernel_module('firewire_core') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257806.rb" + }, + "title": "RHEL 8 must disable IEEE 1394 (FireWire) Support.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n The IEEE 1394 (FireWire) is a serial bus standard for high-speed real-time\ncommunication. Disabling FireWire protects the system against exploitation of\nany flaws in its implementation.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n The IEEE 1394 (FireWire) is a serial bus standard for high-speed real-time\ncommunication. Disabling FireWire protects the system against exploitation of\nany flaws in its implementation.", + "check": "Verify the operating system disables the ability to load the firewire-core kernel module.\n\n $ sudo grep -r firewire-core /etc/modprobe.d/* | grep \"/bin/false\"\n install firewire-core /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the firewire-core protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the firewire-core kernel module.\n\nCheck to see if the firewire-core kernel module is disabled with the following command:\n\n $ sudo grep -r firewire-core /etc/modprobe.d/* | grep \"blacklist\"\n blacklist firewire-core\n\nIf the command does not return any output or the output is not \"blacklist firewire-core\", and use of the firewire-core kernel module is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the ability to use the firewire-core kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install firewire-core /bin/false\n blacklist firewire-core\n\nReboot the system for the settings to take effect." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230499", + "rid": "SV-257806r942933_rule", + "stig_id": "RHEL-08-040026", + "fix_id": "F-33143r942932_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257807", + "code": "control 'SV-257807' do\n title 'RHEL 8 must disable the stream control transmission protocol (SCTP).'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Stream Control Transmission Protocol (SCTP) is a transport layer\nprotocol, designed to support the idea of message-oriented communication, with\nseveral streams of messages within one connection. Disabling SCTP protects the\nsystem against exploitation of any flaws in its implementation.'\n desc 'check', 'Verify the operating system disables the ability to load the SCTP kernel module.\n\n $ sudo grep -r sctp /etc/modprobe.d/* | grep \"/bin/false\"\n install sctp /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the SCTP is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the SCTP.\n\nCheck to see if the SCTP is disabled with the following command:\n\n $ sudo grep -r sctp /etc/modprobe.d/* | grep \"blacklist\"\n blacklist sctp\n\nIf the command does not return any output or the output is not \"blacklist sctp\", and use of the SCTP is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to use the SCTP kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install sctp /bin/false\n blacklist sctp\n\nReboot the system for the settings to take effect.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230496'\n tag rid: 'SV-257807r942924_rule'\n tag stig_id: 'RHEL-08-040023'\n tag fix_id: 'F-33140r942923_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe kernel_module('sctp') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257807.rb" + }, + "title": "RHEL 8 must disable the stream control transmission protocol (SCTP).", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Stream Control Transmission Protocol (SCTP) is a transport layer\nprotocol, designed to support the idea of message-oriented communication, with\nseveral streams of messages within one connection. Disabling SCTP protects the\nsystem against exploitation of any flaws in its implementation.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Stream Control Transmission Protocol (SCTP) is a transport layer\nprotocol, designed to support the idea of message-oriented communication, with\nseveral streams of messages within one connection. Disabling SCTP protects the\nsystem against exploitation of any flaws in its implementation.", + "check": "Verify the operating system disables the ability to load the SCTP kernel module.\n\n $ sudo grep -r sctp /etc/modprobe.d/* | grep \"/bin/false\"\n install sctp /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the SCTP is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the SCTP.\n\nCheck to see if the SCTP is disabled with the following command:\n\n $ sudo grep -r sctp /etc/modprobe.d/* | grep \"blacklist\"\n blacklist sctp\n\nIf the command does not return any output or the output is not \"blacklist sctp\", and use of the SCTP is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the ability to use the SCTP kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install sctp /bin/false\n blacklist sctp\n\nReboot the system for the settings to take effect." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230496", + "rid": "SV-257807r942924_rule", + "stig_id": "RHEL-08-040023", + "fix_id": "F-33140r942923_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257808", + "code": "control 'SV-257808' do\n title 'RHEL 8 must disable the transparent inter-process communication (TIPC)\nprotocol.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Transparent Inter-Process Communication (TIPC) protocol is designed to\nprovide communications between nodes in a cluster. Disabling TIPC protects the\nsystem against exploitation of any flaws in its implementation.'\n desc 'check', 'Verify the operating system disables the ability to load the TIPC protocol kernel module.\n\n $ sudo grep -r tipc /etc/modprobe.d/* | grep \"/bin/false\"\n install tipc /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the TIPC protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the TIPC protocol.\n\nCheck to see if the TIPC protocol is disabled with the following command:\n\n $ sudo grep -r tipc /etc/modprobe.d/* | grep \"blacklist\"\n blacklist tipc\n\nIf the command does not return any output or the output is not \"blacklist tipc\", and use of the TIPC protocol is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to use the TIPC protocol kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install tipc /bin/false\n blacklist tipc\n\nReboot the system for the settings to take effect.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230497'\n tag rid: 'SV-257808r942927_rule'\n tag stig_id: 'RHEL-08-040024'\n tag fix_id: 'F-33141r942926_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe kernel_module('tipc') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257808.rb" + }, + "title": "RHEL 8 must disable the transparent inter-process communication (TIPC)\nprotocol.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Transparent Inter-Process Communication (TIPC) protocol is designed to\nprovide communications between nodes in a cluster. Disabling TIPC protects the\nsystem against exploitation of any flaws in its implementation.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Failing to disconnect unused protocols can result in a system compromise.\n\n The Transparent Inter-Process Communication (TIPC) protocol is designed to\nprovide communications between nodes in a cluster. Disabling TIPC protects the\nsystem against exploitation of any flaws in its implementation.", + "check": "Verify the operating system disables the ability to load the TIPC protocol kernel module.\n\n $ sudo grep -r tipc /etc/modprobe.d/* | grep \"/bin/false\"\n install tipc /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the TIPC protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the TIPC protocol.\n\nCheck to see if the TIPC protocol is disabled with the following command:\n\n $ sudo grep -r tipc /etc/modprobe.d/* | grep \"blacklist\"\n blacklist tipc\n\nIf the command does not return any output or the output is not \"blacklist tipc\", and use of the TIPC protocol is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the ability to use the TIPC protocol kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install tipc /bin/false\n blacklist tipc\n\nReboot the system for the settings to take effect." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230497", + "rid": "SV-257808r942927_rule", + "stig_id": "RHEL-08-040024", + "fix_id": "F-33141r942926_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257809", + "code": "control 'SV-257809' do\n title 'RHEL 8 must implement address space layout randomization (ASLR) to\nprotect its memory from unauthorized code execution.'\n desc 'Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism.\n\nExamples of attacks are buffer overflow attacks.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 implements ASLR with the following command:\n\n$ sudo sysctl kernel.randomize_va_space\n\nkernel.randomize_va_space = 2\n\nIf \"kernel.randomize_va_space\" is not set to \"2\", this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.randomize_va_space /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.randomize_va_space = 2\n\nIf \"kernel.randomize_va_space\" is not set to \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to implement virtual address space randomization.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.randomize_va_space=2\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nIssue the following command to make the changes take effect:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000433-GPOS-00193'\n tag gid: 'V-230280'\n tag rid: 'SV-257809r858767_rule'\n tag stig_id: 'RHEL-08-010430'\n tag fix_id: 'F-32924r858766_fix'\n tag cci: ['CCI-002824']\n tag nist: ['SI-16']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe kernel_parameter('kernel.randomize_va_space') do\n its('value') { should eq 2 }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257809.rb" + }, + "title": "RHEL 8 must implement address space layout randomization (ASLR) to\nprotect its memory from unauthorized code execution.", + "desc": "Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism.\n\nExamples of attacks are buffer overflow attacks.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Some adversaries launch attacks with the intent of executing code in non-executable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism.\n\nExamples of attacks are buffer overflow attacks.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 implements ASLR with the following command:\n\n$ sudo sysctl kernel.randomize_va_space\n\nkernel.randomize_va_space = 2\n\nIf \"kernel.randomize_va_space\" is not set to \"2\", this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo grep -r kernel.randomize_va_space /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf:kernel.randomize_va_space = 2\n\nIf \"kernel.randomize_va_space\" is not set to \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to implement virtual address space randomization.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.randomize_va_space=2\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nIssue the following command to make the changes take effect:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000433-GPOS-00193", + "gid": "V-230280", + "rid": "SV-257809r858767_rule", + "stig_id": "RHEL-08-010430", + "fix_id": "F-32924r858766_fix", + "cci": [ + "CCI-002824" + ], + "nist": [ + "SI-16" + ], + "host": null + } + }, + { + "id": "SV-257810", + "code": "control 'SV-257810' do\n title 'RHEL 8 must disable access to network bpf syscall from unprivileged\nprocesses.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 prevents privilege escalation thru the kernel by disabling access to the bpf syscall with the following commands:\n\n$ sudo sysctl kernel.unprivileged_bpf_disabled\n\nkernel.unprivileged_bpf_disabled = 1\n\nIf the returned line does not have a value of \"1\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r kernel.unprivileged_bpf_disabled /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: kernel.unprivileged_bpf_disabled = 1\n\nIf \"kernel.unprivileged_bpf_disabled\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to prevent privilege escalation thru the kernel by disabling access to the bpf syscall by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nkernel.unprivileged_bpf_disabled = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230545'\n tag rid: 'SV-257810r858822_rule'\n tag stig_id: 'RHEL-08-040281'\n tag fix_id: 'F-33189r858821_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'kernel.unprivileged_bpf_disabled'\n action = 'bpf syscall from unprivileged processes'\n value = 1\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257810.rb" + }, + "title": "RHEL 8 must disable access to network bpf syscall from unprivileged\nprocesses.", + "desc": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 prevents privilege escalation thru the kernel by disabling access to the bpf syscall with the following commands:\n\n$ sudo sysctl kernel.unprivileged_bpf_disabled\n\nkernel.unprivileged_bpf_disabled = 1\n\nIf the returned line does not have a value of \"1\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r kernel.unprivileged_bpf_disabled /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: kernel.unprivileged_bpf_disabled = 1\n\nIf \"kernel.unprivileged_bpf_disabled\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to prevent privilege escalation thru the kernel by disabling access to the bpf syscall by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nkernel.unprivileged_bpf_disabled = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230545", + "rid": "SV-257810r858822_rule", + "stig_id": "RHEL-08-040281", + "fix_id": "F-33189r858821_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257811", + "code": "control 'SV-257811' do\n title 'RHEL 9 must restrict usage of ptrace to descendant processes.'\n desc 'Unrestricted usage of ptrace allows compromised binaries to run ptrace on other processes of the user. Like this, the attacker can steal sensitive information from the target processes (e.g., SSH sessions, web browser, etc.) without any additional assistance from the user (i.e., without resorting to phishing).\n\n'\n desc 'check', %q(Verify RHEL 9 restricts usage of ptrace to descendant processes with the following commands:\n\n$ sysctl kernel.yama.ptrace_scope\n\nkernel.yama.ptrace_scope = 1\n\nIf the returned line does not have a value of \"1\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.yama.ptrace_scope| tail -1\nkernel.yama.ptrace_scope = 1\n\nIf the network parameter \"kernel.yama.ptrace_scope\" is not equal to \"1\", or nothing is returned, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to restrict usage of ptrace to descendant processes by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nkernel.yama.ptrace_scope = 1\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61552r925418_chk'\n tag severity: 'medium'\n tag gid: 'V-257811'\n tag rid: 'SV-257811r925420_rule'\n tag stig_id: 'RHEL-09-213080'\n tag gtitle: 'SRG-OS-000132-GPOS-00067'\n tag fix_id: 'F-61476r925419_fix'\n tag satisfies: ['SRG-OS-000132-GPOS-00067', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-001082']\n tag nist: ['CM-6 b', 'SC-2']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257811.rb" + }, + "title": "RHEL 9 must restrict usage of ptrace to descendant processes.", + "desc": "Unrestricted usage of ptrace allows compromised binaries to run ptrace on other processes of the user. Like this, the attacker can steal sensitive information from the target processes (e.g., SSH sessions, web browser, etc.) without any additional assistance from the user (i.e., without resorting to phishing).\n\n", + "descriptions": { + "default": "Unrestricted usage of ptrace allows compromised binaries to run ptrace on other processes of the user. Like this, the attacker can steal sensitive information from the target processes (e.g., SSH sessions, web browser, etc.) without any additional assistance from the user (i.e., without resorting to phishing).\n\n", + "check": "Verify RHEL 9 restricts usage of ptrace to descendant processes with the following commands:\n\n$ sysctl kernel.yama.ptrace_scope\n\nkernel.yama.ptrace_scope = 1\n\nIf the returned line does not have a value of \"1\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.yama.ptrace_scope| tail -1\nkernel.yama.ptrace_scope = 1\n\nIf the network parameter \"kernel.yama.ptrace_scope\" is not equal to \"1\", or nothing is returned, this is a finding.", + "fix": "Configure RHEL 9 to restrict usage of ptrace to descendant processes by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nkernel.yama.ptrace_scope = 1\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61552r925418_chk", + "severity": "medium", + "gid": "V-257811", + "rid": "SV-257811r925420_rule", + "stig_id": "RHEL-09-213080", + "gtitle": "SRG-OS-000132-GPOS-00067", + "fix_id": "F-61476r925419_fix", + "satisfies": [ + "SRG-OS-000132-GPOS-00067", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-001082" + ], + "nist": [ + "CM-6 b", + "SC-2" + ] + } + }, + { + "id": "SV-257812", + "code": "control 'SV-257812' do\n title 'RHEL 8 must disable core dump backtraces.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.'\n desc 'check', 'Verify the operating system disables core dump backtraces by issuing the\nfollowing command:\n\n $ sudo grep -i ProcessSizeMax /etc/systemd/coredump.conf\n\n ProcessSizeMax=0\n\n If the \"ProcessSizeMax\" item is missing, commented out, or the value is\nanything other than \"0\" and the need for core dumps is not documented with\nthe Information System Security Officer (ISSO) as an operational requirement\nfor all domains that have the \"core\" item assigned, this is a finding.'\n desc 'fix', 'Configure the operating system to disable core dump backtraces.\n\nAdd or modify the following line in /etc/systemd/coredump.conf:\n\nProcessSizeMax=0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230315'\n tag rid: 'SV-257812r627750_rule'\n tag stig_id: 'RHEL-08-010675'\n tag fix_id: 'F-32959r567692_fix'\n tag cci: ['CCI-000366']\n tag legacy: []\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe parse_config_file('/etc/systemd/coredump.conf') do\n its('Coredump.ProcessSizeMax') { should cmp '0' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257812.rb" + }, + "title": "RHEL 8 must disable core dump backtraces.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.", + "check": "Verify the operating system disables core dump backtraces by issuing the\nfollowing command:\n\n $ sudo grep -i ProcessSizeMax /etc/systemd/coredump.conf\n\n ProcessSizeMax=0\n\n If the \"ProcessSizeMax\" item is missing, commented out, or the value is\nanything other than \"0\" and the need for core dumps is not documented with\nthe Information System Security Officer (ISSO) as an operational requirement\nfor all domains that have the \"core\" item assigned, this is a finding.", + "fix": "Configure the operating system to disable core dump backtraces.\n\nAdd or modify the following line in /etc/systemd/coredump.conf:\n\nProcessSizeMax=0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230315", + "rid": "SV-257812r627750_rule", + "stig_id": "RHEL-08-010675", + "fix_id": "F-32959r567692_fix", + "cci": [ + "CCI-000366" + ], + "legacy": [], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257813", + "code": "control 'SV-257813' do\n title 'RHEL 8 must disable storing core dumps.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.'\n desc 'check', 'Verify the operating system disables storing core dumps for all users by\nissuing the following command:\n\n $ sudo grep -i storage /etc/systemd/coredump.conf\n\n Storage=none\n\n If the \"Storage\" item is missing, commented out, or the value is anything\nother than \"none\" and the need for core dumps is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement for\nall domains that have the \"core\" item assigned, this is a finding.'\n desc 'fix', 'Configure the operating system to disable storing core dumps for all users.\n\nAdd or modify the following line in /etc/systemd/coredump.conf:\n\nStorage=none'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230314'\n tag rid: 'SV-257813r627750_rule'\n tag stig_id: 'RHEL-08-010674'\n tag fix_id: 'F-32958r567689_fix'\n tag cci: ['CCI-000366']\n tag legacy: []\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe parse_config_file('/etc/systemd/coredump.conf') do\n its('Coredump.Storage') { should cmp 'none' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257813.rb" + }, + "title": "RHEL 8 must disable storing core dumps.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.", + "check": "Verify the operating system disables storing core dumps for all users by\nissuing the following command:\n\n $ sudo grep -i storage /etc/systemd/coredump.conf\n\n Storage=none\n\n If the \"Storage\" item is missing, commented out, or the value is anything\nother than \"none\" and the need for core dumps is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement for\nall domains that have the \"core\" item assigned, this is a finding.", + "fix": "Configure the operating system to disable storing core dumps for all users.\n\nAdd or modify the following line in /etc/systemd/coredump.conf:\n\nStorage=none" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230314", + "rid": "SV-257813r627750_rule", + "stig_id": "RHEL-08-010674", + "fix_id": "F-32958r567689_fix", + "cci": [ + "CCI-000366" + ], + "legacy": [], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257814", + "code": "control 'SV-257814' do\n title 'RHEL 8 must disable core dumps for all users.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.'\n desc 'check', %q(Verify the operating system disables core dumps for all users by issuing\nthe following command:\n\n $ sudo grep -r -s '^[^#].*core' /etc/security/limits.conf\n/etc/security/limits.d/*.conf\n\n * hard core 0\n\n This can be set as a global domain (with the * wildcard) but may be set\ndifferently for multiple domains.\n\n If the \"core\" item is missing, commented out, or the value is anything\nother than \"0\" and the need for core dumps is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement for\nall domains that have the \"core\" item assigned, this is a finding.)\n desc 'fix', 'Configure the operating system to disable core dumps for all users.\n\n Add the following line to the top of the /etc/security/limits.conf or in a\n\".conf\" file defined in /etc/security/limits.d/:\n\n * hard core 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230313'\n tag rid: 'SV-257814r627750_rule'\n tag stig_id: 'RHEL-08-010673'\n tag fix_id: 'F-32957r619861_fix'\n tag cci: ['CCI-000366']\n tag legacy: []\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n setting = 'core'\n expected_value = input('core_dump_expected_value')\n\n limits_files = command('ls /etc/security/limits.d/*.conf').stdout.strip.split\n limits_files.append('/etc/security/limits.conf')\n\n # make sure that at least one limits.conf file has the correct setting\n globally_set = limits_files.any? { |lf| !limits_conf(lf).read_params['*'].nil? && limits_conf(lf).read_params['*'].include?(['hard', setting.to_s, expected_value.to_s]) }\n\n # make sure that no limits.conf file has a value that contradicts the global set\n failing_files = limits_files.select { |lf|\n limits_conf(lf).read_params.values.flatten(1).any? { |l|\n l[1].eql?(setting) && !l[2].to_i.eql?(expected_value)\n }\n }\n describe 'Limits files' do\n it 'should disallow core dumps by default' do\n expect(globally_set).to eq(true), \"No correct global ('*') setting found\"\n end\n it 'should not have any conflicting settings' do\n expect(failing_files).to be_empty, \"Files with incorrect '#{setting}' settings:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257814.rb" + }, + "title": "RHEL 8 must disable core dumps for all users.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.", + "check": "Verify the operating system disables core dumps for all users by issuing\nthe following command:\n\n $ sudo grep -r -s '^[^#].*core' /etc/security/limits.conf\n/etc/security/limits.d/*.conf\n\n * hard core 0\n\n This can be set as a global domain (with the * wildcard) but may be set\ndifferently for multiple domains.\n\n If the \"core\" item is missing, commented out, or the value is anything\nother than \"0\" and the need for core dumps is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement for\nall domains that have the \"core\" item assigned, this is a finding.", + "fix": "Configure the operating system to disable core dumps for all users.\n\n Add the following line to the top of the /etc/security/limits.conf or in a\n\".conf\" file defined in /etc/security/limits.d/:\n\n * hard core 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230313", + "rid": "SV-257814r627750_rule", + "stig_id": "RHEL-08-010673", + "fix_id": "F-32957r619861_fix", + "cci": [ + "CCI-000366" + ], + "legacy": [], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257815", + "code": "control 'SV-257815' do\n title 'RHEL 8 must disable acquiring, saving, and processing core dumps.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.\n\n When the kernel invokes systemd-coredumpt to handle a core dump, it runs in\nprivileged mode, and will connect to the socket created by the\nsystemd-coredump.socket unit. This, in turn, will spawn an unprivileged\nsystemd-coredump@.service instance to process the core dump.'\n desc 'check', 'Verify RHEL 8 is not configured to acquire, save, or process core dumps with the following command:\n\n$ sudo systemctl status systemd-coredump.socket\n\nsystemd-coredump.socket\nLoaded: masked (Reason: Unit systemd-coredump.socket is masked.)\nActive: inactive (dead)\n\nIf the \"systemd-coredump.socket\" is loaded and not masked and the need for core dumps is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the system to disable the systemd-coredump.socket with the following commands:\n\n$ sudo systemctl disable --now systemd-coredump.socket\n\n$ sudo systemctl mask systemd-coredump.socket\n\nCreated symlink /etc/systemd/system/systemd-coredump.socket -> /dev/null\n\nReload the daemon for this change to take effect.\n\n$ sudo systemctl daemon-reload'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230312'\n tag rid: 'SV-257815r833308_rule'\n tag stig_id: 'RHEL-08-010672'\n tag fix_id: 'F-32956r833307_fix'\n tag cci: ['CCI-000366']\n tag legacy: []\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n s = systemd_service('systemd-coredump.socket')\n\n describe.one do\n describe s do\n its('params.LoadState') { should eq 'masked' }\n end\n describe s do\n its('params.LoadState') { should eq 'not-found' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257815.rb" + }, + "title": "RHEL 8 must disable acquiring, saving, and processing core dumps.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.\n\n When the kernel invokes systemd-coredumpt to handle a core dump, it runs in\nprivileged mode, and will connect to the socket created by the\nsystemd-coredump.socket unit. This, in turn, will spawn an unprivileged\nsystemd-coredump@.service instance to process the core dump.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n A core dump includes a memory image taken at the time the operating system\nterminates an application. The memory image could contain sensitive data and is\ngenerally useful only for developers trying to debug problems.\n\n When the kernel invokes systemd-coredumpt to handle a core dump, it runs in\nprivileged mode, and will connect to the socket created by the\nsystemd-coredump.socket unit. This, in turn, will spawn an unprivileged\nsystemd-coredump@.service instance to process the core dump.", + "check": "Verify RHEL 8 is not configured to acquire, save, or process core dumps with the following command:\n\n$ sudo systemctl status systemd-coredump.socket\n\nsystemd-coredump.socket\nLoaded: masked (Reason: Unit systemd-coredump.socket is masked.)\nActive: inactive (dead)\n\nIf the \"systemd-coredump.socket\" is loaded and not masked and the need for core dumps is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.", + "fix": "Configure the system to disable the systemd-coredump.socket with the following commands:\n\n$ sudo systemctl disable --now systemd-coredump.socket\n\n$ sudo systemctl mask systemd-coredump.socket\n\nCreated symlink /etc/systemd/system/systemd-coredump.socket -> /dev/null\n\nReload the daemon for this change to take effect.\n\n$ sudo systemctl daemon-reload" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230312", + "rid": "SV-257815r833308_rule", + "stig_id": "RHEL-08-010672", + "fix_id": "F-32956r833307_fix", + "cci": [ + "CCI-000366" + ], + "legacy": [], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257816", + "code": "control 'SV-257816' do\n title 'RHEL 8 must disable the use of user namespaces.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 disables the use of user namespaces with the following commands:\n\nNote: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable.\n\n$ sudo sysctl user.max_user_namespaces\n\nuser.max_user_namespaces = 0\n\nIf the returned line does not have a value of \"0\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r user.max_user_namespaces /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: user.max_user_namespaces = 0\n\nIf \"user.max_user_namespaces\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to disable the use of user namespaces by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nNote: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable.\n\nuser.max_user_namespaces = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230548'\n tag rid: 'SV-257816r858828_rule'\n tag stig_id: 'RHEL-08-040284'\n tag fix_id: 'F-33192r858827_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'user.max_user_namespaces'\n action = 'user namespaces'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257816.rb" + }, + "title": "RHEL 8 must disable the use of user namespaces.", + "desc": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 disables the use of user namespaces with the following commands:\n\nNote: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable.\n\n$ sudo sysctl user.max_user_namespaces\n\nuser.max_user_namespaces = 0\n\nIf the returned line does not have a value of \"0\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r user.max_user_namespaces /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: user.max_user_namespaces = 0\n\nIf \"user.max_user_namespaces\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to disable the use of user namespaces by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nNote: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable.\n\nuser.max_user_namespaces = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230548", + "rid": "SV-257816r858828_rule", + "stig_id": "RHEL-08-040284", + "fix_id": "F-33192r858827_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257817", + "code": "control 'SV-257817' do\n title 'RHEL 8 must implement non-executable data to protect its memory from\nunauthorized code execution.'\n desc 'Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Examples of attacks are buffer overflow attacks.'\n desc 'check', 'Verify the NX (no-execution) bit flag is set on the system.\n\n Check that the no-execution bit flag is set with the following commands:\n\n $ sudo dmesg | grep NX\n\n [ 0.000000] NX (Execute Disable) protection: active\n\n If \"dmesg\" does not show \"NX (Execute Disable) protection\" active,\ncheck the cpuinfo settings with the following command:\n\n $ sudo less /proc/cpuinfo | grep -i flags\n flags : fpu vme de pse tsc ms nx rdtscp lm constant_tsc\n\n If \"flags\" does not contain the \"nx\" flag, this is a finding.'\n desc 'fix', 'The NX bit execute protection must be enabled in the system\nBIOS.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000433-GPOS-00192'\n tag gid: 'V-230276'\n tag rid: 'SV-257817r854031_rule'\n tag stig_id: 'RHEL-08-010420'\n tag fix_id: 'F-32920r567575_fix'\n tag cci: ['CCI-002824']\n tag nist: ['SI-16']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n options = {\n assignment_regex: /^\\s*([^:]*?)\\s*:\\s*(.*?)\\s*$/\n }\n\n dmesg_nx_conf = command('dmesg | grep NX').stdout.match(/:\\s+(\\S+)$/).captures.first\n cpuinfo_flags = parse_config_file('/proc/cpuinfo', options).flags.split\n\n describe.one do\n describe 'The no-execution bit flag' do\n it 'should be set in kernel messages' do\n expect(dmesg_nx_conf).to eq('active'), \"dmesg does not show NX protection set to 'active'\"\n end\n end\n describe 'The no-execution bit flag' do\n it 'should be set in CPU info' do\n expect(cpuinfo_flags).to include('nx'), \"'nx' flag not set in /proc/cpuinfo flags\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257817.rb" + }, + "title": "RHEL 8 must implement non-executable data to protect its memory from\nunauthorized code execution.", + "desc": "Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Examples of attacks are buffer overflow attacks.", + "descriptions": { + "default": "Some adversaries launch attacks with the intent of executing code in\nnon-executable regions of memory or in memory locations that are prohibited.\nSecurity safeguards employed to protect memory include, for example, data\nexecution prevention and address space layout randomization. Data execution\nprevention safeguards can be either hardware-enforced or software-enforced with\nhardware providing the greater strength of mechanism.\n\n Examples of attacks are buffer overflow attacks.", + "check": "Verify the NX (no-execution) bit flag is set on the system.\n\n Check that the no-execution bit flag is set with the following commands:\n\n $ sudo dmesg | grep NX\n\n [ 0.000000] NX (Execute Disable) protection: active\n\n If \"dmesg\" does not show \"NX (Execute Disable) protection\" active,\ncheck the cpuinfo settings with the following command:\n\n $ sudo less /proc/cpuinfo | grep -i flags\n flags : fpu vme de pse tsc ms nx rdtscp lm constant_tsc\n\n If \"flags\" does not contain the \"nx\" flag, this is a finding.", + "fix": "The NX bit execute protection must be enabled in the system\nBIOS." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000433-GPOS-00192", + "gid": "V-230276", + "rid": "SV-257817r854031_rule", + "stig_id": "RHEL-08-010420", + "fix_id": "F-32920r567575_fix", + "cci": [ + "CCI-002824" + ], + "nist": [ + "SI-16" + ], + "host": null + } + }, + { + "id": "SV-257818", + "code": "control 'SV-257818' do\n title 'The kdump service on RHEL 9 must be disabled.'\n desc 'Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition. Unless the system is used for kernel development or testing, there is little need to run the kdump service.'\n desc 'check', 'Verify that the kdump service is disabled in system boot configuration with the following command:\n\n$ systemctl is-enabled kdump \n\ndisabled \n\nVerify that the kdump service is not active (i.e., not running) through current runtime configuration with the following command:\n\n$ systemctl is-active kdump \n\ninactive \n\nVerify that the kdump service is masked with the following command:\n\n$ sudo systemctl show kdump | grep \"LoadState\\\\|UnitFileState\" \n\nLoadState=masked \n\nUnitFileState=masked \n\nIf the \"kdump\" service is loaded or active, and is not masked, this is a finding.'\n desc 'fix', 'Disable and mask the kdump service on RHEL 9.\n\nTo disable the kdump service run the following command:\n\n$ sudo systemctl disable --now kdump\n\nTo mask the kdump service run the following command:\n\n$ sudo systemctl mask --now kdump'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61559r925439_chk'\n tag severity: 'medium'\n tag gid: 'V-257818'\n tag rid: 'SV-257818r925441_rule'\n tag stig_id: 'RHEL-09-213115'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61483r925440_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257818.rb" + }, + "title": "The kdump service on RHEL 9 must be disabled.", + "desc": "Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition. Unless the system is used for kernel development or testing, there is little need to run the kdump service.", + "descriptions": { + "default": "Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition. Unless the system is used for kernel development or testing, there is little need to run the kdump service.", + "check": "Verify that the kdump service is disabled in system boot configuration with the following command:\n\n$ systemctl is-enabled kdump \n\ndisabled \n\nVerify that the kdump service is not active (i.e., not running) through current runtime configuration with the following command:\n\n$ systemctl is-active kdump \n\ninactive \n\nVerify that the kdump service is masked with the following command:\n\n$ sudo systemctl show kdump | grep \"LoadState\\|UnitFileState\" \n\nLoadState=masked \n\nUnitFileState=masked \n\nIf the \"kdump\" service is loaded or active, and is not masked, this is a finding.", + "fix": "Disable and mask the kdump service on RHEL 9.\n\nTo disable the kdump service run the following command:\n\n$ sudo systemctl disable --now kdump\n\nTo mask the kdump service run the following command:\n\n$ sudo systemctl mask --now kdump" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61559r925439_chk", + "severity": "medium", + "gid": "V-257818", + "rid": "SV-257818r925441_rule", + "stig_id": "RHEL-09-213115", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61483r925440_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257819", + "code": "control 'SV-257819' do\n title 'RHEL 8 must ensure cryptographic verification of vendor software packages.'\n desc 'Cryptographic verification of vendor software packages ensures that all software packages are obtained from a valid source and protects against spoofing that could lead to installation of malware on the system. Red Hat cryptographically signs all software packages, which includes updates, with a GPG key to verify that they are valid.'\n desc 'check', 'Confirm Red Hat package-signing keys are installed on the system and verify their fingerprints match vendor values.\n\nNote: For RHEL 8 software packages, Red Hat uses GPG keys labeled \"release key 2\" and \"auxiliary key 2\". The keys are defined in key file \"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\" by default.\n\nList Red Hat GPG keys installed on the system:\n\n $ sudo rpm -q --queryformat \"%{SUMMARY}\\\\n\" gpg-pubkey | grep -i \"red hat\"\n\n gpg(Red Hat, Inc. (release key 2) )\n gpg(Red Hat, Inc. (auxiliary key) )\n\nIf Red Hat GPG keys \"release key 2\" and \"auxiliary key 2\" are not installed, this is a finding.\n\nNote: The \"auxiliary key 2\" appears as \"auxiliary key\" on a RHEL 8 system.\n\nList key fingerprints of installed Red Hat GPG keys:\n\n $ sudo gpg -q --keyid-format short --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\n\nIf key file \"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\" is missing, this is a finding.\n\nExample output:\n\n pub rsa4096/FD431D51 2009-10-22 [SC]\n Key fingerprint = 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51\n uid Red Hat, Inc. (release key 2) \n pub rsa4096/D4082792 2018-06-27 [SC]\n Key fingerprint = 6A6A A7C9 7C88 90AE C6AE BFE2 F76F 66C3 D408 2792\n uid Red Hat, Inc. (auxiliary key) \n sub rsa4096/1B5584D3 2018-06-27 [E]\n\nCompare key fingerprints of installed Red Hat GPG keys with fingerprints listed for RHEL 8 on Red Hat \"Product Signing Keys\" webpage at https://access.redhat.com/security/team/key.\n\nIf key fingerprints do not match, this is a finding.'\n desc 'fix', 'Install Red Hat package-signing keys on the system and verify their fingerprints match vendor values.\n\nInsert RHEL 8 installation disc or attach RHEL 8 installation image to the system. Mount the disc or image to make the contents accessible inside the system.\n\nAssuming the mounted location is \"/media/cdrom\", use the following command to copy Red Hat GPG key file onto the system:\n\n $ sudo cp /media/cdrom/RPM-GPG-KEY-redhat-release /etc/pki/rpm-gpg/\n\nImport Red Hat GPG keys from key file into system keyring:\n\n $ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\n\nUsing the steps listed in the Check Text, confirm the newly imported keys show as installed on the system and verify their fingerprints match vendor values.'\n impact 0.5\n tag check_id: 'C-60651r902750_chk'\n tag severity: 'medium'\n tag gid: 'V-256973'\n tag rid: 'SV-257819r902752_rule'\n tag stig_id: 'RHEL-08-010019'\n tag gtitle: 'SRG-OS-000366-GPOS-00153'\n tag fix_id: 'F-60593r902751_fix'\n tag 'documentable'\n tag cci: ['CCI-001749']\n tag nist: ['CM-5 (3)']\n tag 'host'\n tag 'container'\n\n rpm_gpg_file = input('rpm_gpg_file')\n rpm_gpg_keys = input('rpm_gpg_keys')\n\n describe file(rpm_gpg_file) do\n it { should exist }\n end\n rpm_gpg_keys.each do |k, v|\n describe command('rpm -q --queryformat \"%{SUMMARY}\\\\n\" gpg-pubkey | grep -i \"red hat\"') do\n its('stdout') { should include k.to_s }\n end\n next unless file(rpm_gpg_file).exist?\n\n describe command(\"gpg -q --keyid-format short --with-fingerprint #{rpm_gpg_file}\") do\n its('stdout') { should include v }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257819.rb" + }, + "title": "RHEL 8 must ensure cryptographic verification of vendor software packages.", + "desc": "Cryptographic verification of vendor software packages ensures that all software packages are obtained from a valid source and protects against spoofing that could lead to installation of malware on the system. Red Hat cryptographically signs all software packages, which includes updates, with a GPG key to verify that they are valid.", + "descriptions": { + "default": "Cryptographic verification of vendor software packages ensures that all software packages are obtained from a valid source and protects against spoofing that could lead to installation of malware on the system. Red Hat cryptographically signs all software packages, which includes updates, with a GPG key to verify that they are valid.", + "check": "Confirm Red Hat package-signing keys are installed on the system and verify their fingerprints match vendor values.\n\nNote: For RHEL 8 software packages, Red Hat uses GPG keys labeled \"release key 2\" and \"auxiliary key 2\". The keys are defined in key file \"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\" by default.\n\nList Red Hat GPG keys installed on the system:\n\n $ sudo rpm -q --queryformat \"%{SUMMARY}\\n\" gpg-pubkey | grep -i \"red hat\"\n\n gpg(Red Hat, Inc. (release key 2) )\n gpg(Red Hat, Inc. (auxiliary key) )\n\nIf Red Hat GPG keys \"release key 2\" and \"auxiliary key 2\" are not installed, this is a finding.\n\nNote: The \"auxiliary key 2\" appears as \"auxiliary key\" on a RHEL 8 system.\n\nList key fingerprints of installed Red Hat GPG keys:\n\n $ sudo gpg -q --keyid-format short --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\n\nIf key file \"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\" is missing, this is a finding.\n\nExample output:\n\n pub rsa4096/FD431D51 2009-10-22 [SC]\n Key fingerprint = 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51\n uid Red Hat, Inc. (release key 2) \n pub rsa4096/D4082792 2018-06-27 [SC]\n Key fingerprint = 6A6A A7C9 7C88 90AE C6AE BFE2 F76F 66C3 D408 2792\n uid Red Hat, Inc. (auxiliary key) \n sub rsa4096/1B5584D3 2018-06-27 [E]\n\nCompare key fingerprints of installed Red Hat GPG keys with fingerprints listed for RHEL 8 on Red Hat \"Product Signing Keys\" webpage at https://access.redhat.com/security/team/key.\n\nIf key fingerprints do not match, this is a finding.", + "fix": "Install Red Hat package-signing keys on the system and verify their fingerprints match vendor values.\n\nInsert RHEL 8 installation disc or attach RHEL 8 installation image to the system. Mount the disc or image to make the contents accessible inside the system.\n\nAssuming the mounted location is \"/media/cdrom\", use the following command to copy Red Hat GPG key file onto the system:\n\n $ sudo cp /media/cdrom/RPM-GPG-KEY-redhat-release /etc/pki/rpm-gpg/\n\nImport Red Hat GPG keys from key file into system keyring:\n\n $ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release\n\nUsing the steps listed in the Check Text, confirm the newly imported keys show as installed on the system and verify their fingerprints match vendor values." + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-60651r902750_chk", + "severity": "medium", + "gid": "V-256973", + "rid": "SV-257819r902752_rule", + "stig_id": "RHEL-08-010019", + "gtitle": "SRG-OS-000366-GPOS-00153", + "fix_id": "F-60593r902751_fix", + "documentable": null, + "cci": [ + "CCI-001749" + ], + "nist": [ + "CM-5 (3)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257820", + "code": "control 'SV-257820' do\n title 'RHEL 9 must check the GPG signature of software packages originating from external software repositories before installation.'\n desc 'Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nAll software packages must be signed with a cryptographic key recognized and approved by the organization.\n\nVerifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.'\n desc 'check', 'Verify that dnf always checks the GPG signature of software packages originating from external software repositories before installation:\n\n$ grep gpgcheck /etc/dnf/dnf.conf\n\ngpgcheck=1\n\nIf \"gpgcheck\" is not set to \"1\", or if the option is missing or commented out, ask the system administrator how the GPG signatures of software packages are being verified.\n\nIf there is no process to verify GPG signatures that is approved by the organization, this is a finding.'\n desc 'fix', 'Configure dnf to always check the GPG signature of software packages originating from external software repositories before installation.\n\nAdd or update the following line in the [main] section of the /etc/dnf/dnf.conf file:\n\ngpgcheck=1'\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61561r925445_chk'\n tag severity: 'high'\n tag gid: 'V-257820'\n tag rid: 'SV-257820r925447_rule'\n tag stig_id: 'RHEL-09-214015'\n tag gtitle: 'SRG-OS-000366-GPOS-00153'\n tag fix_id: 'F-61485r925446_fix'\n tag 'documentable'\n tag cci: ['CCI-001749']\n tag nist: ['CM-5 (3)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257820.rb" + }, + "title": "RHEL 9 must check the GPG signature of software packages originating from external software repositories before installation.", + "desc": "Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nAll software packages must be signed with a cryptographic key recognized and approved by the organization.\n\nVerifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.", + "descriptions": { + "default": "Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nAll software packages must be signed with a cryptographic key recognized and approved by the organization.\n\nVerifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.", + "check": "Verify that dnf always checks the GPG signature of software packages originating from external software repositories before installation:\n\n$ grep gpgcheck /etc/dnf/dnf.conf\n\ngpgcheck=1\n\nIf \"gpgcheck\" is not set to \"1\", or if the option is missing or commented out, ask the system administrator how the GPG signatures of software packages are being verified.\n\nIf there is no process to verify GPG signatures that is approved by the organization, this is a finding.", + "fix": "Configure dnf to always check the GPG signature of software packages originating from external software repositories before installation.\n\nAdd or update the following line in the [main] section of the /etc/dnf/dnf.conf file:\n\ngpgcheck=1" + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61561r925445_chk", + "severity": "high", + "gid": "V-257820", + "rid": "SV-257820r925447_rule", + "stig_id": "RHEL-09-214015", + "gtitle": "SRG-OS-000366-GPOS-00153", + "fix_id": "F-61485r925446_fix", + "documentable": null, + "cci": [ + "CCI-001749" + ], + "nist": [ + "CM-5 (3)" + ] + } + }, + { + "id": "SV-257821", + "code": "control 'SV-257821' do\n title 'RHEL 8 must prevent the installation of software, patches, service\npacks, device drivers, or operating system components of local packages without\nverification they have been digitally signed using a certificate that is issued\nby a Certificate Authority (CA) that is recognized and approved by the\norganization.'\n desc 'Changes to any software components can have significant effects on the\noverall security of the operating system. This requirement ensures the software\nhas not been tampered with and that it has been provided by a trusted vendor.\n\n Accordingly, patches, service packs, device drivers, or operating system\ncomponents must be signed with a certificate recognized and approved by the\norganization.\n\n Verifying the authenticity of the software prior to installation validates\nthe integrity of the patch or upgrade received from a vendor. This verifies the\nsoftware has not been tampered with and that it has been provided by a trusted\nvendor. Self-signed certificates are disallowed by this requirement. The\noperating system should not have to verify the software again. This requirement\ndoes not mandate DoD certificates for this purpose; however, the certificate\nused to verify the software must be from an approved CA.'\n desc 'check', 'Verify the operating system prevents the installation of patches, service\npacks, device drivers, or operating system components from a repository without\nverification that they have been digitally signed using a certificate that is\nrecognized and approved by the organization.\n\n Check if YUM is configured to perform a signature check on local packages\nwith the following command:\n\n $ sudo grep -i localpkg_gpgcheck /etc/dnf/dnf.conf\n\n localpkg_gpgcheck =True\n\n If \"localpkg_gpgcheck\" is not set to either \"1\", \"True\", or \"yes\",\ncommented out, or is missing from \"/etc/dnf/dnf.conf\", this is a finding.'\n desc 'fix', 'Configure the operating system to remove all software components after\nupdated versions have been installed.\n\n Set the \"localpkg_gpgcheck\" option to \"True\" in the\n\"/etc/dnf/dnf.conf\" file:\n\n localpkg_gpgcheck=True'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000366-GPOS-00153'\n tag gid: 'V-230265'\n tag rid: 'SV-257821r877463_rule'\n tag stig_id: 'RHEL-08-010371'\n tag fix_id: 'F-32909r567542_fix'\n tag cci: ['CCI-001749']\n tag nist: ['CM-5 (3)']\n tag 'host'\n tag 'container'\n\n describe parse_config_file('/etc/dnf/dnf.conf') do\n its('main.localpkg_gpgcheck') { should match(/True|1|yes/i) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257821.rb" + }, + "title": "RHEL 8 must prevent the installation of software, patches, service\npacks, device drivers, or operating system components of local packages without\nverification they have been digitally signed using a certificate that is issued\nby a Certificate Authority (CA) that is recognized and approved by the\norganization.", + "desc": "Changes to any software components can have significant effects on the\noverall security of the operating system. This requirement ensures the software\nhas not been tampered with and that it has been provided by a trusted vendor.\n\n Accordingly, patches, service packs, device drivers, or operating system\ncomponents must be signed with a certificate recognized and approved by the\norganization.\n\n Verifying the authenticity of the software prior to installation validates\nthe integrity of the patch or upgrade received from a vendor. This verifies the\nsoftware has not been tampered with and that it has been provided by a trusted\nvendor. Self-signed certificates are disallowed by this requirement. The\noperating system should not have to verify the software again. This requirement\ndoes not mandate DoD certificates for this purpose; however, the certificate\nused to verify the software must be from an approved CA.", + "descriptions": { + "default": "Changes to any software components can have significant effects on the\noverall security of the operating system. This requirement ensures the software\nhas not been tampered with and that it has been provided by a trusted vendor.\n\n Accordingly, patches, service packs, device drivers, or operating system\ncomponents must be signed with a certificate recognized and approved by the\norganization.\n\n Verifying the authenticity of the software prior to installation validates\nthe integrity of the patch or upgrade received from a vendor. This verifies the\nsoftware has not been tampered with and that it has been provided by a trusted\nvendor. Self-signed certificates are disallowed by this requirement. The\noperating system should not have to verify the software again. This requirement\ndoes not mandate DoD certificates for this purpose; however, the certificate\nused to verify the software must be from an approved CA.", + "check": "Verify the operating system prevents the installation of patches, service\npacks, device drivers, or operating system components from a repository without\nverification that they have been digitally signed using a certificate that is\nrecognized and approved by the organization.\n\n Check if YUM is configured to perform a signature check on local packages\nwith the following command:\n\n $ sudo grep -i localpkg_gpgcheck /etc/dnf/dnf.conf\n\n localpkg_gpgcheck =True\n\n If \"localpkg_gpgcheck\" is not set to either \"1\", \"True\", or \"yes\",\ncommented out, or is missing from \"/etc/dnf/dnf.conf\", this is a finding.", + "fix": "Configure the operating system to remove all software components after\nupdated versions have been installed.\n\n Set the \"localpkg_gpgcheck\" option to \"True\" in the\n\"/etc/dnf/dnf.conf\" file:\n\n localpkg_gpgcheck=True" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000366-GPOS-00153", + "gid": "V-230265", + "rid": "SV-257821r877463_rule", + "stig_id": "RHEL-08-010371", + "fix_id": "F-32909r567542_fix", + "cci": [ + "CCI-001749" + ], + "nist": [ + "CM-5 (3)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257822", + "code": "control 'SV-257822' do\n title 'RHEL 9 must have GPG signature verification enabled for all software repositories.'\n desc 'Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nAll software packages must be signed with a cryptographic key recognized and approved by the organization.\n\nVerifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.'\n desc 'check', 'Verify that all software repositories defined in \"/etc/yum.repos.d/\" have been configured with \"gpgcheck\" enabled:\n\n$ grep gpgcheck /etc/yum.repos.d/*.repo | more\n\ngpgcheck = 1\n\nIf \"gpgcheck\" is not set to \"1\" for all returned lines, this is a finding.'\n desc 'fix', %q(Configure all software repositories defined in \"/etc/yum.repos.d/\" to have \"gpgcheck\" enabled:\n\n$ sudo sed -i 's/gpgcheck\\s*=.*/gpgcheck=1/g' /etc/yum.repos.d/*)\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61563r925451_chk'\n tag severity: 'high'\n tag gid: 'V-257822'\n tag rid: 'SV-257822r925453_rule'\n tag stig_id: 'RHEL-09-214025'\n tag gtitle: 'SRG-OS-000366-GPOS-00153'\n tag fix_id: 'F-61487r925452_fix'\n tag 'documentable'\n tag cci: ['CCI-001749']\n tag nist: ['CM-5 (3)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257822.rb" + }, + "title": "RHEL 9 must have GPG signature verification enabled for all software repositories.", + "desc": "Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nAll software packages must be signed with a cryptographic key recognized and approved by the organization.\n\nVerifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.", + "descriptions": { + "default": "Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nAll software packages must be signed with a cryptographic key recognized and approved by the organization.\n\nVerifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.", + "check": "Verify that all software repositories defined in \"/etc/yum.repos.d/\" have been configured with \"gpgcheck\" enabled:\n\n$ grep gpgcheck /etc/yum.repos.d/*.repo | more\n\ngpgcheck = 1\n\nIf \"gpgcheck\" is not set to \"1\" for all returned lines, this is a finding.", + "fix": "Configure all software repositories defined in \"/etc/yum.repos.d/\" to have \"gpgcheck\" enabled:\n\n$ sudo sed -i 's/gpgcheck\\s*=.*/gpgcheck=1/g' /etc/yum.repos.d/*" + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61563r925451_chk", + "severity": "high", + "gid": "V-257822", + "rid": "SV-257822r925453_rule", + "stig_id": "RHEL-09-214025", + "gtitle": "SRG-OS-000366-GPOS-00153", + "fix_id": "F-61487r925452_fix", + "documentable": null, + "cci": [ + "CCI-001749" + ], + "nist": [ + "CM-5 (3)" + ] + } + }, + { + "id": "SV-257823", + "code": "control 'SV-257823' do\n title 'RHEL 9 must be configured so that the cryptographic hashes of system files match vendor values.'\n desc 'The hashes of important files like system executables should match the information given by the RPM database. Executables with erroneous hashes could be a sign of nefarious activity on the system.'\n desc 'check', %q(The following command will list which files on the system have file hashes different from what is expected by the RPM database:\n\n $ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != \"c\"' \n\nIf there is output, this is a finding.)\n desc 'fix', %q(Given output from the check command, identify the package that provides the output and reinstall it. The following trimmed example output shows a package that has failed verification, been identified, and been reinstalled:\n\n$ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != \"c\"'\nS.5....T. /usr/bin/znew\n$ sudo dnf provides /usr/bin/znew\n[...]\ngzip-1.10-8.el9.x86_64 : The GNU data compression program\n[...]\n$ sudo dnf reinstall gzip\n[...]\n$ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != \"c\"'\n[no output])\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61564r925454_chk'\n tag severity: 'medium'\n tag gid: 'V-257823'\n tag rid: 'SV-257823r925456_rule'\n tag stig_id: 'RHEL-09-214030'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61488r925455_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257823.rb" + }, + "title": "RHEL 9 must be configured so that the cryptographic hashes of system files match vendor values.", + "desc": "The hashes of important files like system executables should match the information given by the RPM database. Executables with erroneous hashes could be a sign of nefarious activity on the system.", + "descriptions": { + "default": "The hashes of important files like system executables should match the information given by the RPM database. Executables with erroneous hashes could be a sign of nefarious activity on the system.", + "check": "The following command will list which files on the system have file hashes different from what is expected by the RPM database:\n\n $ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != \"c\"' \n\nIf there is output, this is a finding.", + "fix": "Given output from the check command, identify the package that provides the output and reinstall it. The following trimmed example output shows a package that has failed verification, been identified, and been reinstalled:\n\n$ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != \"c\"'\nS.5....T. /usr/bin/znew\n$ sudo dnf provides /usr/bin/znew\n[...]\ngzip-1.10-8.el9.x86_64 : The GNU data compression program\n[...]\n$ sudo dnf reinstall gzip\n[...]\n$ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != \"c\"'\n[no output]" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61564r925454_chk", + "severity": "medium", + "gid": "V-257823", + "rid": "SV-257823r925456_rule", + "stig_id": "RHEL-09-214030", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61488r925455_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257824", + "code": "control 'SV-257824' do\n title 'YUM must remove all software components after updated versions have\nbeen installed on RHEL 8.'\n desc 'Previous versions of software components that are not removed from the\ninformation system after updates have been installed may be exploited by\nadversaries. Some information technology products may remove older versions of\nsoftware automatically from the information system.'\n desc 'check', 'Verify the operating system removes all software components after updated\nversions have been installed.\n\n Check if YUM is configured to remove unneeded packages with the following\ncommand:\n\n $ sudo grep -i clean_requirements_on_remove /etc/dnf/dnf.conf\n\n clean_requirements_on_remove=True\n\n If \"clean_requirements_on_remove\" is not set to either \"1\", \"True\",\nor \"yes\", commented out, or is missing from \"/etc/dnf/dnf.conf\", this is a\nfinding.'\n desc 'fix', 'Configure the operating system to remove all software components after\nupdated versions have been installed.\n\n Set the \"clean_requirements_on_remove\" option to \"True\" in the\n\"/etc/dnf/dnf.conf\" file:\n\n clean_requirements_on_remove=True'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000437-GPOS-00194'\n tag gid: 'V-230281'\n tag rid: 'SV-257824r854034_rule'\n tag stig_id: 'RHEL-08-010440'\n tag fix_id: 'F-32925r567590_fix'\n tag cci: ['CCI-002617']\n tag nist: ['SI-2 (6)']\n tag 'host'\n tag 'container'\n\n describe parse_config_file('/etc/dnf/dnf.conf') do\n its('main.clean_requirements_on_remove') { should match(/1|True|yes/i) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257824.rb" + }, + "title": "YUM must remove all software components after updated versions have\nbeen installed on RHEL 8.", + "desc": "Previous versions of software components that are not removed from the\ninformation system after updates have been installed may be exploited by\nadversaries. Some information technology products may remove older versions of\nsoftware automatically from the information system.", + "descriptions": { + "default": "Previous versions of software components that are not removed from the\ninformation system after updates have been installed may be exploited by\nadversaries. Some information technology products may remove older versions of\nsoftware automatically from the information system.", + "check": "Verify the operating system removes all software components after updated\nversions have been installed.\n\n Check if YUM is configured to remove unneeded packages with the following\ncommand:\n\n $ sudo grep -i clean_requirements_on_remove /etc/dnf/dnf.conf\n\n clean_requirements_on_remove=True\n\n If \"clean_requirements_on_remove\" is not set to either \"1\", \"True\",\nor \"yes\", commented out, or is missing from \"/etc/dnf/dnf.conf\", this is a\nfinding.", + "fix": "Configure the operating system to remove all software components after\nupdated versions have been installed.\n\n Set the \"clean_requirements_on_remove\" option to \"True\" in the\n\"/etc/dnf/dnf.conf\" file:\n\n clean_requirements_on_remove=True" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000437-GPOS-00194", + "gid": "V-230281", + "rid": "SV-257824r854034_rule", + "stig_id": "RHEL-08-010440", + "fix_id": "F-32925r567590_fix", + "cci": [ + "CCI-002617" + ], + "nist": [ + "SI-2 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257825", + "code": "control 'SV-257825' do\n title 'RHEL 9 subscription-manager package must be installed.'\n desc 'The Red Hat Subscription Manager application manages software subscriptions and software repositories for installed software products on the local system. It communicates with backend servers, such as the Red Hat Customer Portal or an on-premise instance of Subscription Asset Manager, to register the local system and grant access to software resources determined by the subscription entitlement.'\n desc 'check', 'Verify that RHEL 9 subscription-manager package is installed with the following command:\n\n$ sudo dnf list --installed subscription-manager\n\nExample output:\n\nsubscription-manager.x86_64 1.29.26-3.el9_0\n\nIf the \"subscription-manager\" package is not installed, this is a finding.'\n desc 'fix', 'The subscription-manager package can be installed with the following command:\n \n$ sudo dnf install subscription-manager'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61566r925460_chk'\n tag severity: 'medium'\n tag gid: 'V-257825'\n tag rid: 'SV-257825r925462_rule'\n tag stig_id: 'RHEL-09-215010'\n tag gtitle: 'SRG-OS-000366-GPOS-00153'\n tag fix_id: 'F-61490r925461_fix'\n tag 'documentable'\n tag cci: ['CCI-001749']\n tag nist: ['CM-5 (3)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257825.rb" + }, + "title": "RHEL 9 subscription-manager package must be installed.", + "desc": "The Red Hat Subscription Manager application manages software subscriptions and software repositories for installed software products on the local system. It communicates with backend servers, such as the Red Hat Customer Portal or an on-premise instance of Subscription Asset Manager, to register the local system and grant access to software resources determined by the subscription entitlement.", + "descriptions": { + "default": "The Red Hat Subscription Manager application manages software subscriptions and software repositories for installed software products on the local system. It communicates with backend servers, such as the Red Hat Customer Portal or an on-premise instance of Subscription Asset Manager, to register the local system and grant access to software resources determined by the subscription entitlement.", + "check": "Verify that RHEL 9 subscription-manager package is installed with the following command:\n\n$ sudo dnf list --installed subscription-manager\n\nExample output:\n\nsubscription-manager.x86_64 1.29.26-3.el9_0\n\nIf the \"subscription-manager\" package is not installed, this is a finding.", + "fix": "The subscription-manager package can be installed with the following command:\n \n$ sudo dnf install subscription-manager" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61566r925460_chk", + "severity": "medium", + "gid": "V-257825", + "rid": "SV-257825r925462_rule", + "stig_id": "RHEL-09-215010", + "gtitle": "SRG-OS-000366-GPOS-00153", + "fix_id": "F-61490r925461_fix", + "documentable": null, + "cci": [ + "CCI-001749" + ], + "nist": [ + "CM-5 (3)" + ] + } + }, + { + "id": "SV-257826", + "code": "control 'SV-257826' do\n title 'A File Transfer Protocol (FTP) server package must not be installed\nunless mission essential on RHEL 8.'\n desc 'The FTP service provides an unencrypted remote access that does not\nprovide for the confidentiality and integrity of user passwords or the remote\nsession. If a privileged user were to log on using this service, the privileged\nuser password could be compromised. SSH or other encrypted file transfer\nmethods must be used in place of this service.'\n desc 'check', 'Verify an FTP server has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed *ftpd*\n\n vsftpd.x86_64\n3.0.3-28.el8 appstream\n\n If an FTP server is installed and is not documented with the Information\nSystem Security Officer (ISSO) as an operational requirement, this is a finding.'\n desc 'fix', 'Document the FTP server package with the ISSO as an operational requirement\nor remove it from the system with the following command:\n\n $ sudo yum remove vsftpd'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230558'\n tag rid: 'SV-257826r627750_rule'\n tag stig_id: 'RHEL-08-040360'\n tag fix_id: 'F-33202r568421_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if input('ftp_required')\n describe package('vsftpd') do\n it { should be_installed }\n end\n else\n describe package('vsftpd') do\n it { should_not be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257826.rb" + }, + "title": "A File Transfer Protocol (FTP) server package must not be installed\nunless mission essential on RHEL 8.", + "desc": "The FTP service provides an unencrypted remote access that does not\nprovide for the confidentiality and integrity of user passwords or the remote\nsession. If a privileged user were to log on using this service, the privileged\nuser password could be compromised. SSH or other encrypted file transfer\nmethods must be used in place of this service.", + "descriptions": { + "default": "The FTP service provides an unencrypted remote access that does not\nprovide for the confidentiality and integrity of user passwords or the remote\nsession. If a privileged user were to log on using this service, the privileged\nuser password could be compromised. SSH or other encrypted file transfer\nmethods must be used in place of this service.", + "check": "Verify an FTP server has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed *ftpd*\n\n vsftpd.x86_64\n3.0.3-28.el8 appstream\n\n If an FTP server is installed and is not documented with the Information\nSystem Security Officer (ISSO) as an operational requirement, this is a finding.", + "fix": "Document the FTP server package with the ISSO as an operational requirement\nor remove it from the system with the following command:\n\n $ sudo yum remove vsftpd" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230558", + "rid": "SV-257826r627750_rule", + "stig_id": "RHEL-08-040360", + "fix_id": "F-33202r568421_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257827", + "code": "control 'SV-257827' do\n title 'RHEL 8 must not have the sendmail package installed.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.'\n desc 'check', 'Check to see if the sendmail package is installed with the following\ncommand:\n\n $ sudo yum list installed sendmail\n\n If the sendmail package is installed, this is a finding.'\n desc 'fix', 'Configure the operating system to disable non-essential capabilities by\nremoving the sendmail package from the system with the following command:\n\n $ sudo yum remove sendmail'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230489'\n tag rid: 'SV-257827r627750_rule'\n tag stig_id: 'RHEL-08-040002'\n tag fix_id: 'F-33133r568214_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n tag 'container'\n\n describe package('sendmail') do\n it { should_not be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257827.rb" + }, + "title": "RHEL 8 must not have the sendmail package installed.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.", + "check": "Check to see if the sendmail package is installed with the following\ncommand:\n\n $ sudo yum list installed sendmail\n\n If the sendmail package is installed, this is a finding.", + "fix": "Configure the operating system to disable non-essential capabilities by\nremoving the sendmail package from the system with the following command:\n\n $ sudo yum remove sendmail" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230489", + "rid": "SV-257827r627750_rule", + "stig_id": "RHEL-08-040002", + "fix_id": "F-33133r568214_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257828", + "code": "control 'SV-257828' do\n title 'RHEL 9 must not have the nfs-utils package installed.'\n desc '\"nfs-utils\" provides a daemon for the kernel NFS server and related tools. This package also contains the \"showmount\" program. \"showmount\" queries the mount daemon on a remote host for information about the Network File System (NFS) server on the remote host. For example, \"showmount\" can display the clients that are mounted on that host.'\n desc 'check', 'Verify that the nfs-utils package is not installed with the following command:\n\n$ sudo dnf list --installed nfs-utils\n\nError: No matching Packages to list\n\nIf the \"nfs-utils\" package is installed, this is a finding.'\n desc 'fix', 'Remove the nfs-utils package with the following command:\n\n$ sudo dnf remove nfs-utils'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61569r925469_chk'\n tag severity: 'medium'\n tag gid: 'V-257828'\n tag rid: 'SV-257828r925471_rule'\n tag stig_id: 'RHEL-09-215025'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag fix_id: 'F-61493r925470_fix'\n tag 'documentable'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257828.rb" + }, + "title": "RHEL 9 must not have the nfs-utils package installed.", + "desc": "\"nfs-utils\" provides a daemon for the kernel NFS server and related tools. This package also contains the \"showmount\" program. \"showmount\" queries the mount daemon on a remote host for information about the Network File System (NFS) server on the remote host. For example, \"showmount\" can display the clients that are mounted on that host.", + "descriptions": { + "default": "\"nfs-utils\" provides a daemon for the kernel NFS server and related tools. This package also contains the \"showmount\" program. \"showmount\" queries the mount daemon on a remote host for information about the Network File System (NFS) server on the remote host. For example, \"showmount\" can display the clients that are mounted on that host.", + "check": "Verify that the nfs-utils package is not installed with the following command:\n\n$ sudo dnf list --installed nfs-utils\n\nError: No matching Packages to list\n\nIf the \"nfs-utils\" package is installed, this is a finding.", + "fix": "Remove the nfs-utils package with the following command:\n\n$ sudo dnf remove nfs-utils" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61569r925469_chk", + "severity": "medium", + "gid": "V-257828", + "rid": "SV-257828r925471_rule", + "stig_id": "RHEL-09-215025", + "gtitle": "SRG-OS-000095-GPOS-00049", + "fix_id": "F-61493r925470_fix", + "documentable": null, + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ] + } + }, + { + "id": "SV-257829", + "code": "control 'SV-257829' do\n title 'RHEL 9 must not have the ypserv package installed.'\n desc 'The NIS service provides an unencrypted authentication service, which does not provide for the confidentiality and integrity of user passwords or the remote session.\n\nRemoving the \"ypserv\" package decreases the risk of the accidental (or intentional) activation of NIS or NIS+ services.'\n desc 'check', 'Verify that the ypserv package is not installed with the following command:\n\n$ sudo dnf list --installed ypserv\n\nError: No matching Packages to list\n\nIf the \"ypserv\" package is installed, this is a finding.'\n desc 'fix', 'Remove the ypserv package with the following command:\n\n$ sudo dnf remove ypserv'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61570r925472_chk'\n tag severity: 'medium'\n tag gid: 'V-257829'\n tag rid: 'SV-257829r925474_rule'\n tag stig_id: 'RHEL-09-215030'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag fix_id: 'F-61494r925473_fix'\n tag 'documentable'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257829.rb" + }, + "title": "RHEL 9 must not have the ypserv package installed.", + "desc": "The NIS service provides an unencrypted authentication service, which does not provide for the confidentiality and integrity of user passwords or the remote session.\n\nRemoving the \"ypserv\" package decreases the risk of the accidental (or intentional) activation of NIS or NIS+ services.", + "descriptions": { + "default": "The NIS service provides an unencrypted authentication service, which does not provide for the confidentiality and integrity of user passwords or the remote session.\n\nRemoving the \"ypserv\" package decreases the risk of the accidental (or intentional) activation of NIS or NIS+ services.", + "check": "Verify that the ypserv package is not installed with the following command:\n\n$ sudo dnf list --installed ypserv\n\nError: No matching Packages to list\n\nIf the \"ypserv\" package is installed, this is a finding.", + "fix": "Remove the ypserv package with the following command:\n\n$ sudo dnf remove ypserv" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61570r925472_chk", + "severity": "medium", + "gid": "V-257829", + "rid": "SV-257829r925474_rule", + "stig_id": "RHEL-09-215030", + "gtitle": "SRG-OS-000095-GPOS-00049", + "fix_id": "F-61494r925473_fix", + "documentable": null, + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ] + } + }, + { + "id": "SV-257830", + "code": "control 'SV-257830' do\n title 'RHEL 8 must not have the rsh-server package installed.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The rsh-server service provides an unencrypted remote access service that\ndoes not provide for the confidentiality and integrity of user passwords or the\nremote session and has very weak authentication.\n\n If a privileged user were to log on using this service, the privileged user\npassword could be compromised.'\n desc 'check', 'Check to see if the rsh-server package is installed with the following\ncommand:\n\n $ sudo yum list installed rsh-server\n\n If the rsh-server package is installed, this is a finding.'\n desc 'fix', 'Configure the operating system to disable non-essential capabilities by\nremoving the rsh-server package from the system with the following command:\n\n $ sudo yum remove rsh-server'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag satisfies: ['SRG-OS-000095-GPOS-00049', 'SRG-OS-000074-GPOS-00042']\n tag gid: 'V-230492'\n tag rid: 'SV-257830r627750_rule'\n tag stig_id: 'RHEL-08-040010'\n tag fix_id: 'F-33136r568223_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n tag 'container'\n\n describe package('rsh-server') do\n it { should_not be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257830.rb" + }, + "title": "RHEL 8 must not have the rsh-server package installed.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The rsh-server service provides an unencrypted remote access service that\ndoes not provide for the confidentiality and integrity of user passwords or the\nremote session and has very weak authentication.\n\n If a privileged user were to log on using this service, the privileged user\npassword could be compromised.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The rsh-server service provides an unencrypted remote access service that\ndoes not provide for the confidentiality and integrity of user passwords or the\nremote session and has very weak authentication.\n\n If a privileged user were to log on using this service, the privileged user\npassword could be compromised.", + "check": "Check to see if the rsh-server package is installed with the following\ncommand:\n\n $ sudo yum list installed rsh-server\n\n If the rsh-server package is installed, this is a finding.", + "fix": "Configure the operating system to disable non-essential capabilities by\nremoving the rsh-server package from the system with the following command:\n\n $ sudo yum remove rsh-server" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000095-GPOS-00049", + "satisfies": [ + "SRG-OS-000095-GPOS-00049", + "SRG-OS-000074-GPOS-00042" + ], + "gid": "V-230492", + "rid": "SV-257830r627750_rule", + "stig_id": "RHEL-08-040010", + "fix_id": "F-33136r568223_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257831", + "code": "control 'SV-257831' do\n title 'RHEL 8 must not have the telnet-server package installed.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.\n\n The telnet service provides an unencrypted remote access service that does\nnot provide for the confidentiality and integrity of user passwords or the\nremote session.\n\n If a privileged user were to log on using this service, the privileged user\npassword could be compromised.'\n desc 'check', 'Check to see if the telnet-server package is installed with the following\ncommand:\n\n $ sudo yum list installed telnet-server\n\n If the telnet-server package is installed, this is a finding.'\n desc 'fix', 'Configure the operating system to disable non-essential capabilities by\nremoving the telnet-server package from the system with the following command:\n\n $ sudo yum remove telnet-server'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230487'\n tag rid: 'SV-257831r627750_rule'\n tag stig_id: 'RHEL-08-040000'\n tag fix_id: 'F-33131r568208_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n tag 'container'\n\n describe package('telnet-server') do\n it { should_not be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257831.rb" + }, + "title": "RHEL 8 must not have the telnet-server package installed.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.\n\n The telnet service provides an unencrypted remote access service that does\nnot provide for the confidentiality and integrity of user passwords or the\nremote session.\n\n If a privileged user were to log on using this service, the privileged user\npassword could be compromised.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n Examples of non-essential capabilities include, but are not limited to,\ngames, software packages, tools, and demonstration software not related to\nrequirements or providing a wide array of functionality not required for every\nmission, but which cannot be disabled.\n\n Verify the operating system is configured to disable non-essential\ncapabilities. The most secure way of ensuring a non-essential capability is\ndisabled is to not have the capability installed.\n\n The telnet service provides an unencrypted remote access service that does\nnot provide for the confidentiality and integrity of user passwords or the\nremote session.\n\n If a privileged user were to log on using this service, the privileged user\npassword could be compromised.", + "check": "Check to see if the telnet-server package is installed with the following\ncommand:\n\n $ sudo yum list installed telnet-server\n\n If the telnet-server package is installed, this is a finding.", + "fix": "Configure the operating system to disable non-essential capabilities by\nremoving the telnet-server package from the system with the following command:\n\n $ sudo yum remove telnet-server" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230487", + "rid": "SV-257831r627750_rule", + "stig_id": "RHEL-08-040000", + "fix_id": "F-33131r568208_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257832", + "code": "control 'SV-257832' do\n title 'The gssproxy package must not be installed unless mission essential on\nRHEL 8.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The gssproxy package is a proxy for GSS API credential handling and could\nexpose secrets on some networks. It is not needed for normal function of the OS.'\n desc 'check', 'Verify the gssproxy package has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed gssproxy\n\n gssproxy.x86_64\n0.8.0-14.el8 @anaconda\n\n If the gssproxy package is installed and is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement, this\nis a finding.'\n desc 'fix', 'Document the gssproxy package with the ISSO as an operational requirement\nor remove it from the system with the following command:\n\n $ sudo yum remove gssproxy'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230559'\n tag rid: 'SV-257832r646887_rule'\n tag stig_id: 'RHEL-08-040370'\n tag fix_id: 'F-33203r568424_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n tag 'container'\n\n if input('gssproxy_required')\n describe package('gssproxy') do\n it { should be_installed }\n end\n else\n describe package('gssproxy') do\n it { should_not be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257832.rb" + }, + "title": "The gssproxy package must not be installed unless mission essential on\nRHEL 8.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The gssproxy package is a proxy for GSS API credential handling and could\nexpose secrets on some networks. It is not needed for normal function of the OS.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The gssproxy package is a proxy for GSS API credential handling and could\nexpose secrets on some networks. It is not needed for normal function of the OS.", + "check": "Verify the gssproxy package has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed gssproxy\n\n gssproxy.x86_64\n0.8.0-14.el8 @anaconda\n\n If the gssproxy package is installed and is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement, this\nis a finding.", + "fix": "Document the gssproxy package with the ISSO as an operational requirement\nor remove it from the system with the following command:\n\n $ sudo yum remove gssproxy" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230559", + "rid": "SV-257832r646887_rule", + "stig_id": "RHEL-08-040370", + "fix_id": "F-33203r568424_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257833", + "code": "control 'SV-257833' do\n title 'The iprutils package must not be installed unless mission essential on\nRHEL 8.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The iprutils package provides a suite of utilities to manage and configure\nSCSI devices supported by the ipr SCSI storage device driver.'\n desc 'check', 'Verify the iprutils package has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed iprutils\n\n iprutils.x86_64\n2.4.18.1-1.el8 @anaconda\n\n If the iprutils package is installed and is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement, this\nis a finding.'\n desc 'fix', 'Document the iprutils package with the ISSO as an operational requirement\nor remove it from the system with the following command:\n\n $ sudo yum remove iprutils'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230560'\n tag rid: 'SV-257833r627750_rule'\n tag stig_id: 'RHEL-08-040380'\n tag fix_id: 'F-33204r568427_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if input('iprutils_required')\n describe package('iprutils') do\n it { should be_installed }\n end\n else\n describe package('iprutils') do\n it { should_not be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257833.rb" + }, + "title": "The iprutils package must not be installed unless mission essential on\nRHEL 8.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The iprutils package provides a suite of utilities to manage and configure\nSCSI devices supported by the ipr SCSI storage device driver.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The iprutils package provides a suite of utilities to manage and configure\nSCSI devices supported by the ipr SCSI storage device driver.", + "check": "Verify the iprutils package has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed iprutils\n\n iprutils.x86_64\n2.4.18.1-1.el8 @anaconda\n\n If the iprutils package is installed and is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement, this\nis a finding.", + "fix": "Document the iprutils package with the ISSO as an operational requirement\nor remove it from the system with the following command:\n\n $ sudo yum remove iprutils" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230560", + "rid": "SV-257833r627750_rule", + "stig_id": "RHEL-08-040380", + "fix_id": "F-33204r568427_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257834", + "code": "control 'SV-257834' do\n title 'The tuned package must not be installed unless mission essential on\nRHEL 8.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The tuned package contains a daemon that tunes the system settings\ndynamically. It does so by monitoring the usage of several system components\nperiodically. Based on that information, components will then be put into lower\nor higher power savings modes to adapt to the current usage. The tuned package\nis not needed for normal OS operations.'\n desc 'check', 'Verify the tuned package has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed tuned\n\n tuned.noarch\n2.12.0-3.el8 @anaconda\n\n If the tuned package is installed and is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement, this\nis a finding.'\n desc 'fix', 'Document the tuned package with the ISSO as an operational requirement or\nremove it from the system with the following command:\n\n $ sudo yum remove tuned'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230561'\n tag rid: 'SV-257834r627750_rule'\n tag stig_id: 'RHEL-08-040390'\n tag fix_id: 'F-33205r568430_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if input('tuned_required')\n describe package('tuned') do\n it { should be_installed }\n end\n else\n describe package('tuned') do\n it { should_not be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257834.rb" + }, + "title": "The tuned package must not be installed unless mission essential on\nRHEL 8.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The tuned package contains a daemon that tunes the system settings\ndynamically. It does so by monitoring the usage of several system components\nperiodically. Based on that information, components will then be put into lower\nor higher power savings modes to adapt to the current usage. The tuned package\nis not needed for normal OS operations.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services, provided by default, may not be\nnecessary to support essential organizational operations (e.g., key missions,\nfunctions).\n\n The tuned package contains a daemon that tunes the system settings\ndynamically. It does so by monitoring the usage of several system components\nperiodically. Based on that information, components will then be put into lower\nor higher power savings modes to adapt to the current usage. The tuned package\nis not needed for normal OS operations.", + "check": "Verify the tuned package has not been installed on the system with the\nfollowing commands:\n\n $ sudo yum list installed tuned\n\n tuned.noarch\n2.12.0-3.el8 @anaconda\n\n If the tuned package is installed and is not documented with the\nInformation System Security Officer (ISSO) as an operational requirement, this\nis a finding.", + "fix": "Document the tuned package with the ISSO as an operational requirement or\nremove it from the system with the following command:\n\n $ sudo yum remove tuned" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230561", + "rid": "SV-257834r627750_rule", + "stig_id": "RHEL-08-040390", + "fix_id": "F-33205r568430_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257835", + "code": "control 'SV-257835' do\n title 'RHEL 9 must not have a Trivial File Transfer Protocol (TFTP) server package installed.'\n desc 'Removing the \"tftp-server\" package decreases the risk of the accidental (or intentional) activation of tftp services.\n\nIf TFTP is required for operational support (such as transmission of router configurations), its use must be documented with the information systems security manager (ISSM), restricted to only authorized personnel, and have access control rules established.'\n desc 'check', 'Verify that RHEL 9 does not have a tftp server package installed with the following command:\n\n$ sudo dnf list --installed | grep tftp \n\nIf the \"tftp\" package is installed, this is a finding.'\n desc 'fix', 'The tftp package can be removed with the following command:\n\n$ sudo dnf remove tftp'\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61576r925490_chk'\n tag severity: 'high'\n tag gid: 'V-257835'\n tag rid: 'SV-257835r925492_rule'\n tag stig_id: 'RHEL-09-215060'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61500r925491_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257835.rb" + }, + "title": "RHEL 9 must not have a Trivial File Transfer Protocol (TFTP) server package installed.", + "desc": "Removing the \"tftp-server\" package decreases the risk of the accidental (or intentional) activation of tftp services.\n\nIf TFTP is required for operational support (such as transmission of router configurations), its use must be documented with the information systems security manager (ISSM), restricted to only authorized personnel, and have access control rules established.", + "descriptions": { + "default": "Removing the \"tftp-server\" package decreases the risk of the accidental (or intentional) activation of tftp services.\n\nIf TFTP is required for operational support (such as transmission of router configurations), its use must be documented with the information systems security manager (ISSM), restricted to only authorized personnel, and have access control rules established.", + "check": "Verify that RHEL 9 does not have a tftp server package installed with the following command:\n\n$ sudo dnf list --installed | grep tftp \n\nIf the \"tftp\" package is installed, this is a finding.", + "fix": "The tftp package can be removed with the following command:\n\n$ sudo dnf remove tftp" + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61576r925490_chk", + "severity": "high", + "gid": "V-257835", + "rid": "SV-257835r925492_rule", + "stig_id": "RHEL-09-215060", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61500r925491_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257836", + "code": "control 'SV-257836' do\n title 'RHEL 9 must not have the quagga package installed.'\n desc 'Quagga is a network routing software suite providing implementations of Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP) for Unix and Linux platforms.\n\nIf there is no need to make the router software available, removing it provides a safeguard against its activation.'\n desc 'check', 'Verify that the quagga package is not installed with the following command:\n\n$ sudo dnf list --installed quagga\n\nError: No matching Packages to list\n\nIf the \"quagga\" package is installed, and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.'\n desc 'fix', 'Remove the quagga package with the following command:\n\n$ sudo dnf remove quagga'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61577r925493_chk'\n tag severity: 'medium'\n tag gid: 'V-257836'\n tag rid: 'SV-257836r925495_rule'\n tag stig_id: 'RHEL-09-215065'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61501r925494_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257836.rb" + }, + "title": "RHEL 9 must not have the quagga package installed.", + "desc": "Quagga is a network routing software suite providing implementations of Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP) for Unix and Linux platforms.\n\nIf there is no need to make the router software available, removing it provides a safeguard against its activation.", + "descriptions": { + "default": "Quagga is a network routing software suite providing implementations of Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP) for Unix and Linux platforms.\n\nIf there is no need to make the router software available, removing it provides a safeguard against its activation.", + "check": "Verify that the quagga package is not installed with the following command:\n\n$ sudo dnf list --installed quagga\n\nError: No matching Packages to list\n\nIf the \"quagga\" package is installed, and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.", + "fix": "Remove the quagga package with the following command:\n\n$ sudo dnf remove quagga" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61577r925493_chk", + "severity": "medium", + "gid": "V-257836", + "rid": "SV-257836r925495_rule", + "stig_id": "RHEL-09-215065", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61501r925494_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257837", + "code": "control 'SV-257837' do\n title 'The graphical display manager must not be installed on RHEL 8 unless\napproved.'\n desc 'Internet services that are not required for system or application\nprocesses must not be active to decrease the attack surface of the system.\nGraphical display managers have a long history of security vulnerabilities and\nmust not be used, unless approved and documented.'\n desc 'check', 'Verify that a graphical user interface is not installed:\n\n$ rpm -qa | grep xorg | grep server\n\nAsk the System Administrator if use of a graphical user interface is an operational requirement.\n\nIf the use of a graphical user interface on the system is not documented with the ISSO, this is a finding.'\n desc 'fix', 'Document the requirement for a graphical user interface with the ISSO or reinstall the operating system without the graphical user interface. If reinstallation is not feasible, then continue with the following procedure:\n\nOpen an SSH session and enter the following commands:\n\n$ sudo yum remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland\n\nA reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230553'\n tag rid: 'SV-257837r809324_rule'\n tag stig_id: 'RHEL-08-040320'\n tag fix_id: 'F-33197r809323_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n input('remove_xorg_x11_server_packages').each do |p|\n describe package(p) do\n it { should_not be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257837.rb" + }, + "title": "The graphical display manager must not be installed on RHEL 8 unless\napproved.", + "desc": "Internet services that are not required for system or application\nprocesses must not be active to decrease the attack surface of the system.\nGraphical display managers have a long history of security vulnerabilities and\nmust not be used, unless approved and documented.", + "descriptions": { + "default": "Internet services that are not required for system or application\nprocesses must not be active to decrease the attack surface of the system.\nGraphical display managers have a long history of security vulnerabilities and\nmust not be used, unless approved and documented.", + "check": "Verify that a graphical user interface is not installed:\n\n$ rpm -qa | grep xorg | grep server\n\nAsk the System Administrator if use of a graphical user interface is an operational requirement.\n\nIf the use of a graphical user interface on the system is not documented with the ISSO, this is a finding.", + "fix": "Document the requirement for a graphical user interface with the ISSO or reinstall the operating system without the graphical user interface. If reinstallation is not feasible, then continue with the following procedure:\n\nOpen an SSH session and enter the following commands:\n\n$ sudo yum remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland\n\nA reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230553", + "rid": "SV-257837r809324_rule", + "stig_id": "RHEL-08-040320", + "fix_id": "F-33197r809323_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257838", + "code": "control 'SV-257838' do\n title 'RHEL 8 must have the packages required for multifactor authentication\n installed.'\n desc 'Using an authentication device, such as a DoD Common Access Card (CAC)\n or token that is separate from the information system, ensures that even if the\n information system is compromised, credentials stored on the authentication\n device will not be affected.\n\n Multifactor solutions that require devices separate from information\n systems gaining access include, for example, hardware tokens providing\n time-based or challenge-response authenticators and smart cards such as the\n U.S. Government Personal Identity Verification (PIV) card and the DoD CAC.\n\n A privileged account is defined as an information system account with\n authorizations of a privileged user.\n\n Remote access is access to DoD nonpublic information systems by an\n authorized user (or an information system) communicating through an external,\n non-organization-controlled network. Remote access methods include, for\n example, dial-up, broadband, and wireless.\n\n This requirement only applies to components where this is specific to the\n function of the device or has the concept of an organizational user (e.g., VPN,\n proxy capability). This does not apply to authentication for the purpose of\n configuring the device itself (management).'\n desc 'check', 'Verify the operating system has the packages required for multifactor\n authentication installed with the following commands:\n\n $ sudo yum list installed openssl-pkcs11\n\n openssl-pkcs11.x86_64 0.4.8-2.el8 @anaconda\n\n If the \"openssl-pkcs11\" package is not installed, ask the administrator\n to indicate what type of multifactor authentication is being utilized and what\n packages are installed to support it. If there is no evidence of multifactor\n authentication being used, this is a finding.'\n desc 'fix', 'Configure the operating system to implement multifactor authentication by\n installing the required package with the following command:\n\n $ sudo yum install openssl-pkcs11'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000375-GPOS-00160'\n tag gid: 'V-230273'\n tag rid: 'SV-257838r854028_rule'\n tag stig_id: 'RHEL-08-010390'\n tag fix_id: 'F-32917r743942_fix'\n tag cci: ['CCI-001948']\n tag nist: ['IA-2 (11)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('smart_card_enabled')\n describe package('openssl-pkcs11') do\n it { should be_installed }\n end\n else\n impact 0.0\n describe 'The system is not smartcard enabled thus this control is Not Applicable' do\n skip 'The system is not using Smartcards / PIVs to fulfil the MFA requirement, this control is Not Applicable.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257838.rb" + }, + "title": "RHEL 8 must have the packages required for multifactor authentication\n installed.", + "desc": "Using an authentication device, such as a DoD Common Access Card (CAC)\n or token that is separate from the information system, ensures that even if the\n information system is compromised, credentials stored on the authentication\n device will not be affected.\n\n Multifactor solutions that require devices separate from information\n systems gaining access include, for example, hardware tokens providing\n time-based or challenge-response authenticators and smart cards such as the\n U.S. Government Personal Identity Verification (PIV) card and the DoD CAC.\n\n A privileged account is defined as an information system account with\n authorizations of a privileged user.\n\n Remote access is access to DoD nonpublic information systems by an\n authorized user (or an information system) communicating through an external,\n non-organization-controlled network. Remote access methods include, for\n example, dial-up, broadband, and wireless.\n\n This requirement only applies to components where this is specific to the\n function of the device or has the concept of an organizational user (e.g., VPN,\n proxy capability). This does not apply to authentication for the purpose of\n configuring the device itself (management).", + "descriptions": { + "default": "Using an authentication device, such as a DoD Common Access Card (CAC)\n or token that is separate from the information system, ensures that even if the\n information system is compromised, credentials stored on the authentication\n device will not be affected.\n\n Multifactor solutions that require devices separate from information\n systems gaining access include, for example, hardware tokens providing\n time-based or challenge-response authenticators and smart cards such as the\n U.S. Government Personal Identity Verification (PIV) card and the DoD CAC.\n\n A privileged account is defined as an information system account with\n authorizations of a privileged user.\n\n Remote access is access to DoD nonpublic information systems by an\n authorized user (or an information system) communicating through an external,\n non-organization-controlled network. Remote access methods include, for\n example, dial-up, broadband, and wireless.\n\n This requirement only applies to components where this is specific to the\n function of the device or has the concept of an organizational user (e.g., VPN,\n proxy capability). This does not apply to authentication for the purpose of\n configuring the device itself (management).", + "check": "Verify the operating system has the packages required for multifactor\n authentication installed with the following commands:\n\n $ sudo yum list installed openssl-pkcs11\n\n openssl-pkcs11.x86_64 0.4.8-2.el8 @anaconda\n\n If the \"openssl-pkcs11\" package is not installed, ask the administrator\n to indicate what type of multifactor authentication is being utilized and what\n packages are installed to support it. If there is no evidence of multifactor\n authentication being used, this is a finding.", + "fix": "Configure the operating system to implement multifactor authentication by\n installing the required package with the following command:\n\n $ sudo yum install openssl-pkcs11" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000375-GPOS-00160", + "gid": "V-230273", + "rid": "SV-257838r854028_rule", + "stig_id": "RHEL-08-010390", + "fix_id": "F-32917r743942_fix", + "cci": [ + "CCI-001948" + ], + "nist": [ + "IA-2 (11)" + ], + "host": null + } + }, + { + "id": "SV-257839", + "code": "control 'SV-257839' do\n title 'RHEL 9 must have the gnutls-utils package installed.'\n desc 'GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them. It provides a simple C language application programming interface (API) to access the secure communications protocols as well as APIs to parse and write X.509, PKCS #12, OpenPGP and other required structures. This package contains command line TLS client and server and certificate manipulation tools.'\n desc 'check', 'Verify that RHEL 9 has the gnutls-utils package installed with the following command:\n\n$ dnf list --installed gnutls-utils\n\nExample output:\n\ngnutls-utils.x86_64 3.7.3-9.el9\n\nIf the \"gnutls-utils\" package is not installed, this is a finding.'\n desc 'fix', 'The gnutls-utils package can be installed with the following command:\n \n$ sudo dnf install gnutls-utils'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61580r925502_chk'\n tag severity: 'medium'\n tag gid: 'V-257839'\n tag rid: 'SV-257839r925504_rule'\n tag stig_id: 'RHEL-09-215080'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61504r925503_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257839.rb" + }, + "title": "RHEL 9 must have the gnutls-utils package installed.", + "desc": "GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them. It provides a simple C language application programming interface (API) to access the secure communications protocols as well as APIs to parse and write X.509, PKCS #12, OpenPGP and other required structures. This package contains command line TLS client and server and certificate manipulation tools.", + "descriptions": { + "default": "GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them. It provides a simple C language application programming interface (API) to access the secure communications protocols as well as APIs to parse and write X.509, PKCS #12, OpenPGP and other required structures. This package contains command line TLS client and server and certificate manipulation tools.", + "check": "Verify that RHEL 9 has the gnutls-utils package installed with the following command:\n\n$ dnf list --installed gnutls-utils\n\nExample output:\n\ngnutls-utils.x86_64 3.7.3-9.el9\n\nIf the \"gnutls-utils\" package is not installed, this is a finding.", + "fix": "The gnutls-utils package can be installed with the following command:\n \n$ sudo dnf install gnutls-utils" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61580r925502_chk", + "severity": "medium", + "gid": "V-257839", + "rid": "SV-257839r925504_rule", + "stig_id": "RHEL-09-215080", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61504r925503_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257840", + "code": "control 'SV-257840' do\n title 'RHEL 9 must have the nss-tools package installed.'\n desc 'Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Install the \"nss-tools\" package to install command-line tools to manipulate the NSS certificate and key database.'\n desc 'check', 'Verify that RHEL 9 has the nss-tools package installed with the following command:\n\n$ dnf list --installed nss-tools\n\nExample output:\n\nnss-tools.x86_64 3.71.0-7.el9\n\nIf the \"nss-tools\" package is not installed, this is a finding.'\n desc 'fix', 'The nss-tools package can be installed with the following command:\n \n$ sudo dnf install nss-tools'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61581r925505_chk'\n tag severity: 'medium'\n tag gid: 'V-257840'\n tag rid: 'SV-257840r925507_rule'\n tag stig_id: 'RHEL-09-215085'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61505r925506_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257840.rb" + }, + "title": "RHEL 9 must have the nss-tools package installed.", + "desc": "Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Install the \"nss-tools\" package to install command-line tools to manipulate the NSS certificate and key database.", + "descriptions": { + "default": "Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Install the \"nss-tools\" package to install command-line tools to manipulate the NSS certificate and key database.", + "check": "Verify that RHEL 9 has the nss-tools package installed with the following command:\n\n$ dnf list --installed nss-tools\n\nExample output:\n\nnss-tools.x86_64 3.71.0-7.el9\n\nIf the \"nss-tools\" package is not installed, this is a finding.", + "fix": "The nss-tools package can be installed with the following command:\n \n$ sudo dnf install nss-tools" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61581r925505_chk", + "severity": "medium", + "gid": "V-257840", + "rid": "SV-257840r925507_rule", + "stig_id": "RHEL-09-215085", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61505r925506_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257841", + "code": "control 'SV-257841' do\n title 'RHEL 8 must have the packages required to use the hardware random\nnumber generator entropy gatherer service.'\n desc 'The most important characteristic of a random number generator is its\nrandomness, namely its ability to deliver random numbers that are impossible to\npredict. Entropy in computer security is associated with the unpredictability\nof a source of randomness. The random source with high entropy tends to\nachieve a uniform distribution of random values. Random number generators are\none of the most important building blocks of cryptosystems.\n\n The rngd service feeds random data from hardware device to kernel random\ndevice. Quality (non-predictable) random number generation is important for\nseveral security functions (i.e., ciphers).'\n desc 'check', 'Check that RHEL 8 has the packages required to enabled the hardware random\nnumber generator entropy gatherer service with the following command:\n\n $ sudo yum list installed rng-tools\n\n rng-tools.x86_64 6.8-3.el8\n@anaconda\n\n If the \"rng-tools\" package is not installed, this is a finding.'\n desc 'fix', 'Install the packages required to enabled the hardware random number\ngenerator entropy gatherer service with the following command:\n\n $ sudo yum install rng-tools'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244527'\n tag rid: 'SV-257841r743830_rule'\n tag stig_id: 'RHEL-08-010472'\n tag fix_id: 'F-47759r743829_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe package('rng-tools') do\n it { should be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257841.rb" + }, + "title": "RHEL 8 must have the packages required to use the hardware random\nnumber generator entropy gatherer service.", + "desc": "The most important characteristic of a random number generator is its\nrandomness, namely its ability to deliver random numbers that are impossible to\npredict. Entropy in computer security is associated with the unpredictability\nof a source of randomness. The random source with high entropy tends to\nachieve a uniform distribution of random values. Random number generators are\none of the most important building blocks of cryptosystems.\n\n The rngd service feeds random data from hardware device to kernel random\ndevice. Quality (non-predictable) random number generation is important for\nseveral security functions (i.e., ciphers).", + "descriptions": { + "default": "The most important characteristic of a random number generator is its\nrandomness, namely its ability to deliver random numbers that are impossible to\npredict. Entropy in computer security is associated with the unpredictability\nof a source of randomness. The random source with high entropy tends to\nachieve a uniform distribution of random values. Random number generators are\none of the most important building blocks of cryptosystems.\n\n The rngd service feeds random data from hardware device to kernel random\ndevice. Quality (non-predictable) random number generation is important for\nseveral security functions (i.e., ciphers).", + "check": "Check that RHEL 8 has the packages required to enabled the hardware random\nnumber generator entropy gatherer service with the following command:\n\n $ sudo yum list installed rng-tools\n\n rng-tools.x86_64 6.8-3.el8\n@anaconda\n\n If the \"rng-tools\" package is not installed, this is a finding.", + "fix": "Install the packages required to enabled the hardware random number\ngenerator entropy gatherer service with the following command:\n\n $ sudo yum install rng-tools" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244527", + "rid": "SV-257841r743830_rule", + "stig_id": "RHEL-08-010472", + "fix_id": "F-47759r743829_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257842", + "code": "control 'SV-257842' do\n title 'RHEL 8 must be configured to allow sending email notifications of unauthorized configuration changes to designated personnel.'\n desc \"Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.\n\nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's IMO/ISSO and SAs must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.\"\n desc 'check', 'Verify that the operating system is configured to allow sending email notifications.\n\nNote: The \"mailx\" package provides the \"mail\" command that is used to send email messages.\n\nVerify that the \"mailx\" package is installed on the system:\n\n $ sudo yum list installed mailx\n\n mailx.x86_64 12.5-29.el8 @rhel-8-for-x86_64-baseos-rpm\n\nIf \"mailx\" package is not installed, this is a finding.'\n desc 'fix', 'Install the \"mailx\" package on the system:\n\n $ sudo yum install mailx'\n impact 0.5\n tag check_id: 'C-60652r902753_chk'\n tag severity: 'medium'\n tag gid: 'V-256974'\n tag rid: 'SV-257842r902755_rule'\n tag stig_id: 'RHEL-08-010358'\n tag gtitle: 'SRG-OS-000363-GPOS-00150'\n tag fix_id: 'F-60594r902754_fix'\n tag 'documentable'\n tag cci: ['CCI-001744']\n tag nist: ['CM-3 (5)']\n tag 'host'\n tag 'container'\n\n mail_package = input('mail_package')\n\n describe package(mail_package) do\n it { should be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257842.rb" + }, + "title": "RHEL 8 must be configured to allow sending email notifications of unauthorized configuration changes to designated personnel.", + "desc": "Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.\n\nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's IMO/ISSO and SAs must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.", + "descriptions": { + "default": "Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.\n\nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's IMO/ISSO and SAs must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.", + "check": "Verify that the operating system is configured to allow sending email notifications.\n\nNote: The \"mailx\" package provides the \"mail\" command that is used to send email messages.\n\nVerify that the \"mailx\" package is installed on the system:\n\n $ sudo yum list installed mailx\n\n mailx.x86_64 12.5-29.el8 @rhel-8-for-x86_64-baseos-rpm\n\nIf \"mailx\" package is not installed, this is a finding.", + "fix": "Install the \"mailx\" package on the system:\n\n $ sudo yum install mailx" + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-60652r902753_chk", + "severity": "medium", + "gid": "V-256974", + "rid": "SV-257842r902755_rule", + "stig_id": "RHEL-08-010358", + "gtitle": "SRG-OS-000363-GPOS-00150", + "fix_id": "F-60594r902754_fix", + "documentable": null, + "cci": [ + "CCI-001744" + ], + "nist": [ + "CM-3 (5)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257843", + "code": "control 'SV-257843' do\n title 'A separate RHEL 8 filesystem must be used for user home directories\n(such as /home or an equivalent).'\n desc 'The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.'\n desc 'check', %q(Verify that a separate file system has been created for non-privileged local interactive user home directories.\n\n Check the home directory assignment for all non-privileged users, users with a User Identifier (UID) greater than 1000, on the system with the following command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1,$3,$6}' /etc/passwd\n\n doej 1001 /home/doej\n publicj 1002 /home/publicj\n smithj 1003 /home/smithj\n\nThe output of the command will give the directory/partition that contains the home directories for the non-privileged users on the system (in this example, \"/home\") and users’ shell. All accounts with a valid shell (such as /bin/bash) are considered interactive users.\n\nCheck that a file system/partition has been created for the nonprivileged interactive users with the following command:\n\nNote: The partition of \"/home\" is used in the example.\n\n $ sudo grep /home /etc/fstab\n\n /dev/mapper/... /home xfs defaults,noexec,nosuid,nodev 0 0\n\nIf a separate entry for the file system/partition containing the nonprivileged interactive user home directories does not exist, this is a finding.)\n desc 'fix', 'Migrate the \"/home\" directory onto a separate file system.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230328'\n tag rid: 'SV-257843r902723_rule'\n tag stig_id: 'RHEL-08-010800'\n tag fix_id: 'F-32972r902722_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable inside a container, the containers host manages the containers filesystems') {\n !virtualization.system.eql?('docker')\n }\n\n ignore_shells = input('non_interactive_shells').join('|')\n homes = users.where { uid >= 1000 && !shell.match(ignore_shells) }.homes\n root_device = etc_fstab.where { mount_point == '/' }.device_name\n\n if input('seperate_filesystem_exempt')\n impact 0.0\n describe 'This system is not required to have sperate filesystems for each mount point' do\n skip 'The system is managing filesystems and space via other mechanisms; this requirement is Not Applicable'\n end\n else\n homes.each do |home|\n pn_parent = Pathname.new(home).parent.to_s\n home_device = etc_fstab.where { mount_point == pn_parent }.device_name\n\n describe \"The '#{pn_parent}' mount point\" do\n subject { home_device }\n\n it 'is not on the same partition as the root partition' do\n is_expected.not_to equal(root_device)\n end\n\n it 'has its own partition' do\n is_expected.not_to be_empty\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257843.rb" + }, + "title": "A separate RHEL 8 filesystem must be used for user home directories\n(such as /home or an equivalent).", + "desc": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "descriptions": { + "default": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "check": "Verify that a separate file system has been created for non-privileged local interactive user home directories.\n\n Check the home directory assignment for all non-privileged users, users with a User Identifier (UID) greater than 1000, on the system with the following command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1,$3,$6}' /etc/passwd\n\n doej 1001 /home/doej\n publicj 1002 /home/publicj\n smithj 1003 /home/smithj\n\nThe output of the command will give the directory/partition that contains the home directories for the non-privileged users on the system (in this example, \"/home\") and users’ shell. All accounts with a valid shell (such as /bin/bash) are considered interactive users.\n\nCheck that a file system/partition has been created for the nonprivileged interactive users with the following command:\n\nNote: The partition of \"/home\" is used in the example.\n\n $ sudo grep /home /etc/fstab\n\n /dev/mapper/... /home xfs defaults,noexec,nosuid,nodev 0 0\n\nIf a separate entry for the file system/partition containing the nonprivileged interactive user home directories does not exist, this is a finding.", + "fix": "Migrate the \"/home\" directory onto a separate file system." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230328", + "rid": "SV-257843r902723_rule", + "stig_id": "RHEL-08-010800", + "fix_id": "F-32972r902722_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257844", + "code": "control 'SV-257844' do\n title 'A separate RHEL 8 filesystem must be used for the /tmp directory.'\n desc 'The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.'\n desc 'check', 'Verify that a separate file system/partition has been created for\nnon-privileged local interactive user home directories.\n\n $ sudo grep /tmp /etc/fstab\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If a separate entry for the file system/partition \"/tmp\" does not exist,\nthis is a finding.'\n desc 'fix', 'Migrate the \"/tmp\" directory onto a separate file\nsystem/partition.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230295'\n tag rid: 'SV-257844r627750_rule'\n tag stig_id: 'RHEL-08-010543'\n tag fix_id: 'F-32939r567632_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe mount('/tmp') do\n it { should be_mounted }\n end\n\n describe etc_fstab.where { mount_point == '/tmp' } do\n it { should exist }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257844.rb" + }, + "title": "A separate RHEL 8 filesystem must be used for the /tmp directory.", + "desc": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "descriptions": { + "default": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "check": "Verify that a separate file system/partition has been created for\nnon-privileged local interactive user home directories.\n\n $ sudo grep /tmp /etc/fstab\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If a separate entry for the file system/partition \"/tmp\" does not exist,\nthis is a finding.", + "fix": "Migrate the \"/tmp\" directory onto a separate file\nsystem/partition." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230295", + "rid": "SV-257844r627750_rule", + "stig_id": "RHEL-08-010543", + "fix_id": "F-32939r567632_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257845", + "code": "control 'SV-257845' do\n title 'RHEL 8 must use a separate file system for /var.'\n desc 'The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.'\n desc 'check', 'Verify that a separate file system has been created for \"/var\".\n\nCheck that a file system has been created for \"/var\" with the following command:\n\n $ sudo grep /var /etc/fstab\n\n /dev/mapper/... /var xfs defaults,nodev 0 0\n\nIf a separate entry for \"/var\" is not in use, this is a finding.'\n desc 'fix', 'Migrate the \"/var\" path onto a separate file system.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230292'\n tag rid: 'SV-257845r902718_rule'\n tag stig_id: 'RHEL-08-010540'\n tag fix_id: 'F-32936r567623_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe mount('/var') do\n it { should be_mounted }\n end\n\n describe etc_fstab.where { mount_point == '/var' } do\n it { should exist }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257845.rb" + }, + "title": "RHEL 8 must use a separate file system for /var.", + "desc": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "descriptions": { + "default": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "check": "Verify that a separate file system has been created for \"/var\".\n\nCheck that a file system has been created for \"/var\" with the following command:\n\n $ sudo grep /var /etc/fstab\n\n /dev/mapper/... /var xfs defaults,nodev 0 0\n\nIf a separate entry for \"/var\" is not in use, this is a finding.", + "fix": "Migrate the \"/var\" path onto a separate file system." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230292", + "rid": "SV-257845r902718_rule", + "stig_id": "RHEL-08-010540", + "fix_id": "F-32936r567623_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257846", + "code": "control 'SV-257846' do\n title 'RHEL 8 must use a separate file system for /var/log.'\n desc 'The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.'\n desc 'check', 'Verify that a separate file system has been created for \"/var/log\".\n\nCheck that a file system has been created for \"/var/log\" with the following command:\n\n $ sudo grep /var/log /etc/fstab\n\n /dev/mapper/... /var/log xfs defaults,nodev,noexec,nosuid 0 0\n\nIf a separate entry for \"/var/log\" is not in use, this is a finding.'\n desc 'fix', 'Migrate the \"/var/log\" path onto a separate file system.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230293'\n tag rid: 'SV-257846r902720_rule'\n tag stig_id: 'RHEL-08-010541'\n tag fix_id: 'F-32937r567626_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe mount('/var/log') do\n it { should be_mounted }\n end\n\n describe etc_fstab.where { mount_point == '/var/log' } do\n it { should exist }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257846.rb" + }, + "title": "RHEL 8 must use a separate file system for /var/log.", + "desc": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "descriptions": { + "default": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "check": "Verify that a separate file system has been created for \"/var/log\".\n\nCheck that a file system has been created for \"/var/log\" with the following command:\n\n $ sudo grep /var/log /etc/fstab\n\n /dev/mapper/... /var/log xfs defaults,nodev,noexec,nosuid 0 0\n\nIf a separate entry for \"/var/log\" is not in use, this is a finding.", + "fix": "Migrate the \"/var/log\" path onto a separate file system." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230293", + "rid": "SV-257846r902720_rule", + "stig_id": "RHEL-08-010541", + "fix_id": "F-32937r567626_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257847", + "code": "control 'SV-257847' do\n title 'RHEL 8 must use a separate file system for the system audit data path.'\n desc 'The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.'\n desc 'check', 'Verify that a separate file system/partition has been created for the\nsystem audit data path with the following command:\n\n Note: /var/log/audit is used as the example as it is a common location.\n\n $ sudo grep /var/log/audit /etc/fstab\n\n UUID=3645951a /var/log/audit xfs defaults 1 2\n\n If an entry for \"/var/log/audit\" does not exist, ask the System\nAdministrator if the system audit logs are being written to a different file\nsystem/partition on the system, then grep for that file system/partition.\n\n If a separate file system/partition does not exist for the system audit\ndata path, this is a finding.'\n desc 'fix', 'Migrate the system audit data path onto a separate file system.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230294'\n tag rid: 'SV-257847r627750_rule'\n tag stig_id: 'RHEL-08-010542'\n tag fix_id: 'F-32938r567629_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_data_path = command(\"dirname #{auditd_conf.log_file}\").stdout.strip\n\n describe mount(audit_data_path) do\n it { should be_mounted }\n end\n\n describe etc_fstab.where { mount_point == audit_data_path } do\n it { should exist }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257847.rb" + }, + "title": "RHEL 8 must use a separate file system for the system audit data path.", + "desc": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "descriptions": { + "default": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "check": "Verify that a separate file system/partition has been created for the\nsystem audit data path with the following command:\n\n Note: /var/log/audit is used as the example as it is a common location.\n\n $ sudo grep /var/log/audit /etc/fstab\n\n UUID=3645951a /var/log/audit xfs defaults 1 2\n\n If an entry for \"/var/log/audit\" does not exist, ask the System\nAdministrator if the system audit logs are being written to a different file\nsystem/partition on the system, then grep for that file system/partition.\n\n If a separate file system/partition does not exist for the system audit\ndata path, this is a finding.", + "fix": "Migrate the system audit data path onto a separate file system." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230294", + "rid": "SV-257847r627750_rule", + "stig_id": "RHEL-08-010542", + "fix_id": "F-32938r567629_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257848", + "code": "control 'SV-257848' do\n title 'RHEL 8 must use a separate file system for /var/tmp.'\n desc 'The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.'\n desc 'check', 'Verify that a separate file system has been created for \"/var/tmp\".\n\nCheck that a file system has been created for \"/var/tmp\" with the following command:\n\n $ sudo grep /var/tmp /etc/fstab\n\n /dev/mapper/... /var/tmp xfs defaults,nodev,noexec,nosuid 0 0\n\nIf a separate entry for \"/var/tmp\" is not in use, this is a finding.'\n desc 'fix', 'Migrate the \"/var/tmp\" path onto a separate file system.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244529'\n tag rid: 'SV-257848r902737_rule'\n tag stig_id: 'RHEL-08-010544'\n tag fix_id: 'F-47761r743835_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe etc_fstab.where { mount_point == '/var/tmp' } do\n it { should exist }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257848.rb" + }, + "title": "RHEL 8 must use a separate file system for /var/tmp.", + "desc": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "descriptions": { + "default": "The use of separate file systems for different paths can protect the\nsystem from failures resulting from a file system becoming full or failing.", + "check": "Verify that a separate file system has been created for \"/var/tmp\".\n\nCheck that a file system has been created for \"/var/tmp\" with the following command:\n\n $ sudo grep /var/tmp /etc/fstab\n\n /dev/mapper/... /var/tmp xfs defaults,nodev,noexec,nosuid 0 0\n\nIf a separate entry for \"/var/tmp\" is not in use, this is a finding.", + "fix": "Migrate the \"/var/tmp\" path onto a separate file system." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244529", + "rid": "SV-257848r902737_rule", + "stig_id": "RHEL-08-010544", + "fix_id": "F-47761r743835_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257849", + "code": "control 'SV-257849' do\n title 'The RHEL 8 file system automounter must be disabled unless required.'\n desc 'Automatically mounting file systems permits easy introduction of\nunknown devices, thereby facilitating malicious activity.'\n desc 'check', 'Verify the operating system disables the ability to automount devices.\n\n Check to see if automounter service is active with the following command:\n\n Note: If the autofs service is not installed, this requirement is not\napplicable.\n\n $ sudo systemctl status autofs\n\n autofs.service - Automounts filesystems on demand\n Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled)\n Active: inactive (dead)\n\n If the \"autofs\" status is set to \"active\" and is not documented with\nthe Information System Security Officer (ISSO) as an operational requirement,\nthis is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to automount devices.\n\n Turn off the automount service with the following commands:\n\n $ sudo systemctl stop autofs\n $ sudo systemctl disable autofs\n\n If \"autofs\" is required for Network File System (NFS), it must be\ndocumented with the ISSO.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000114-GPOS-00059'\n tag gid: 'V-230502'\n tag rid: 'SV-257849r627750_rule'\n tag stig_id: 'RHEL-08-040070'\n tag fix_id: 'F-33146r568253_fix'\n tag cci: ['CCI-000778']\n tag nist: ['IA-3']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('autofs_required') == true\n describe systemd_service('autofs.service') do\n it { should be_running }\n it { should be_enabled }\n it { should be_installed }\n end\n elsif package('autofs').installed?\n describe systemd_service('autofs.service') do\n it { should_not be_running }\n it { should_not be_enabled }\n it { should_not be_installed }\n end\n else\n impact 0.0\n describe 'The autofs service is not installed' do\n skip 'The autofs service is not installed, this control is Not Applicable.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257849.rb" + }, + "title": "The RHEL 8 file system automounter must be disabled unless required.", + "desc": "Automatically mounting file systems permits easy introduction of\nunknown devices, thereby facilitating malicious activity.", + "descriptions": { + "default": "Automatically mounting file systems permits easy introduction of\nunknown devices, thereby facilitating malicious activity.", + "check": "Verify the operating system disables the ability to automount devices.\n\n Check to see if automounter service is active with the following command:\n\n Note: If the autofs service is not installed, this requirement is not\napplicable.\n\n $ sudo systemctl status autofs\n\n autofs.service - Automounts filesystems on demand\n Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled)\n Active: inactive (dead)\n\n If the \"autofs\" status is set to \"active\" and is not documented with\nthe Information System Security Officer (ISSO) as an operational requirement,\nthis is a finding.", + "fix": "Configure the operating system to disable the ability to automount devices.\n\n Turn off the automount service with the following commands:\n\n $ sudo systemctl stop autofs\n $ sudo systemctl disable autofs\n\n If \"autofs\" is required for Network File System (NFS), it must be\ndocumented with the ISSO." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000114-GPOS-00059", + "gid": "V-230502", + "rid": "SV-257849r627750_rule", + "stig_id": "RHEL-08-040070", + "fix_id": "F-33146r568253_fix", + "cci": [ + "CCI-000778" + ], + "nist": [ + "IA-3" + ], + "host": null + } + }, + { + "id": "SV-257850", + "code": "control 'SV-257850' do\n title 'RHEL 9 must prevent device files from being interpreted on file systems that contain user home directories.'\n desc 'The \"nodev\" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.\n\nThe only legitimate location for device files is the \"/dev\" directory located on the root partition, with the exception of chroot jails if implemented.'\n desc 'check', 'Verify \"/home\" is mounted with the \"nodev\" option with the following command:\n\nNote: If a separate file system has not been created for the user home directories (user home directories are mounted under \"/\"), this is automatically a finding, as the \"nodev\" option cannot be used on the \"/\" system.\n\n$ mount | grep /home\n\ntmpfs on /home type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\nIf the \"/home\" file system is mounted without the \"nodev\" option, this is a finding.'\n desc 'fix', 'Modify \"/etc/fstab\" to use the \"nodev\" option on the \"/home\" directory.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61591r925535_chk'\n tag severity: 'medium'\n tag gid: 'V-257850'\n tag rid: 'SV-257850r925537_rule'\n tag stig_id: 'RHEL-09-231045'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag fix_id: 'F-61515r925536_fix'\n tag 'documentable'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257850.rb" + }, + "title": "RHEL 9 must prevent device files from being interpreted on file systems that contain user home directories.", + "desc": "The \"nodev\" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.\n\nThe only legitimate location for device files is the \"/dev\" directory located on the root partition, with the exception of chroot jails if implemented.", + "descriptions": { + "default": "The \"nodev\" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.\n\nThe only legitimate location for device files is the \"/dev\" directory located on the root partition, with the exception of chroot jails if implemented.", + "check": "Verify \"/home\" is mounted with the \"nodev\" option with the following command:\n\nNote: If a separate file system has not been created for the user home directories (user home directories are mounted under \"/\"), this is automatically a finding, as the \"nodev\" option cannot be used on the \"/\" system.\n\n$ mount | grep /home\n\ntmpfs on /home type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\nIf the \"/home\" file system is mounted without the \"nodev\" option, this is a finding.", + "fix": "Modify \"/etc/fstab\" to use the \"nodev\" option on the \"/home\" directory." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61591r925535_chk", + "severity": "medium", + "gid": "V-257850", + "rid": "SV-257850r925537_rule", + "stig_id": "RHEL-09-231045", + "gtitle": "SRG-OS-000368-GPOS-00154", + "fix_id": "F-61515r925536_fix", + "documentable": null, + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ] + } + }, + { + "id": "SV-257851", + "code": "control 'SV-257851' do\n title 'RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on file systems that contain user home directories.'\n desc 'The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.'\n desc 'check', %q(Verify file systems that contain user home directories are mounted with the\n\"nosuid\" option.\n\n Note: If a separate file system has not been created for the user home\ndirectories (user home directories are mounted under \"/\"), this is\nautomatically a finding as the \"nosuid\" option cannot be used on the \"/\"\nsystem.\n\n Find the file system(s) that contain the user home directories with the\nfollowing command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1,$3,$6}' /etc/passwd\n\n smithj:1001: /home/smithj\n robinst:1002: /home/robinst\n\n Check the file systems that are mounted at boot time with the following\ncommand:\n\n $ sudo more /etc/fstab\n\n UUID=a411dc99-f2a1-4c87-9e05-184977be8539 /home xfs\nrw,relatime,discard,data=ordered,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to the user home directory\nfile system and it does not have the \"nosuid\" option set, this is a finding.)\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nfile systems that contain user home directories for interactive users.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230299'\n tag rid: 'SV-257851r627750_rule'\n tag stig_id: 'RHEL-08-010570'\n tag fix_id: 'F-32943r567644_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n interactive_users = passwd.where {\n uid.to_i >= 1000 && shell !~ /nologin/\n }\n\n interactive_user_homedirs = interactive_users.homes.map { |home_path|\n home_path.match(%r{^(.*)/.*$}).captures.first\n }.uniq\n\n option = 'nosuid'\n\n mounted_on_root = interactive_user_homedirs.select { |dir| dir == '/' }\n not_configured = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.configured? }\n option_not_set = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.mount_options.flatten.include?(option) }\n\n describe 'All interactive user home directories' do\n it \"should not be mounted under root ('/')\" do\n expect(mounted_on_root).to be_empty, \"Home directories mounted on root ('/'):\\n\\t- #{mounted_on_root.join(\"\\n\\t- \")}\"\n end\n it 'should be configured in /etc/fstab' do\n expect(not_configured).to be_empty, \"Unconfigured home directories:\\n\\t- #{not_configured.join(\"\\n\\t- \")}\"\n end\n if (option_not_set - not_configured).nil?\n it \"should have the '#{option}' mount option set\" do\n expect(option_not_set - not_configured).to be_empty, \"Mounted home directories without '#{option}' set:\\n\\t- #{not_configured.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257851.rb" + }, + "title": "RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on file systems that contain user home directories.", + "desc": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "check": "Verify file systems that contain user home directories are mounted with the\n\"nosuid\" option.\n\n Note: If a separate file system has not been created for the user home\ndirectories (user home directories are mounted under \"/\"), this is\nautomatically a finding as the \"nosuid\" option cannot be used on the \"/\"\nsystem.\n\n Find the file system(s) that contain the user home directories with the\nfollowing command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1,$3,$6}' /etc/passwd\n\n smithj:1001: /home/smithj\n robinst:1002: /home/robinst\n\n Check the file systems that are mounted at boot time with the following\ncommand:\n\n $ sudo more /etc/fstab\n\n UUID=a411dc99-f2a1-4c87-9e05-184977be8539 /home xfs\nrw,relatime,discard,data=ordered,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to the user home directory\nfile system and it does not have the \"nosuid\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nfile systems that contain user home directories for interactive users." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230299", + "rid": "SV-257851r627750_rule", + "stig_id": "RHEL-08-010570", + "fix_id": "F-32943r567644_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257852", + "code": "control 'SV-257852' do\n title 'RHEL 8 must prevent code from being executed on file systems that\ncontain user home directories.'\n desc 'The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary files, as they may be incompatible. Executing files from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.'\n desc 'check', %q(Verify file systems that contain user home directories are mounted with the\n\"noexec\" option.\n\n Note: If a separate file system has not been created for the user home\ndirectories (user home directories are mounted under \"/\"), this is\nautomatically a finding as the \"noexec\" option cannot be used on the \"/\"\nsystem.\n\n Find the file system(s) that contain the user home directories with the\nfollowing command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1,$3,$6}' /etc/passwd\n\n smithj:1001: /home/smithj\n robinst:1002: /home/robinst\n\n Check the file systems that are mounted at boot time with the following\ncommand:\n\n $ sudo more /etc/fstab\n\n UUID=a411dc99-f2a1-4c87-9e05-184977be8539 /home ext4\nrw,relatime,discard,data=ordered,nosuid,nodev,noexec 0 2\n\n If a file system found in \"/etc/fstab\" refers to the user home directory\nfile system and it does not have the \"noexec\" option set, this is a finding.)\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"noexec\" option on\nfile systems that contain user home directories for interactive users.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230302'\n tag rid: 'SV-257852r627750_rule'\n tag stig_id: 'RHEL-08-010590'\n tag fix_id: 'F-32946r567653_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n interactive_users = passwd.where {\n uid.to_i >= 1000 && shell !~ /nologin/\n }\n\n interactive_user_homedirs = interactive_users.homes.map { |home_path|\n home_path.match(%r{^(.*)/.*$}).captures.first\n }.uniq\n\n option = 'noexec'\n\n mounted_on_root = interactive_user_homedirs.select { |dir| dir == '/' }\n not_configured = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.configured? }\n option_not_set = interactive_user_homedirs.reject { |dir| etc_fstab.where { mount_point == dir }.mount_options.flatten.include?(option) }\n\n describe 'All interactive user home directories' do\n it \"should not be mounted under root ('/')\" do\n expect(mounted_on_root).to be_empty, \"Home directories mounted on root ('/'):\\n\\t- #{mounted_on_root.join(\"\\n\\t- \")}\"\n end\n it 'should be configured in /etc/fstab' do\n expect(not_configured).to be_empty, \"Unconfigured home directories:\\n\\t- #{not_configured.join(\"\\n\\t- \")}\"\n end\n if (option_not_set - not_configured).nil?\n it \"should have the '#{option}' mount option set\" do\n expect(option_not_set - not_configured).to be_empty, \"Mounted home directories without '#{option}' set:\\n\\t- #{not_configured.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257852.rb" + }, + "title": "RHEL 8 must prevent code from being executed on file systems that\ncontain user home directories.", + "desc": "The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary files, as they may be incompatible. Executing files from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.", + "descriptions": { + "default": "The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary files, as they may be incompatible. Executing files from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.", + "check": "Verify file systems that contain user home directories are mounted with the\n\"noexec\" option.\n\n Note: If a separate file system has not been created for the user home\ndirectories (user home directories are mounted under \"/\"), this is\nautomatically a finding as the \"noexec\" option cannot be used on the \"/\"\nsystem.\n\n Find the file system(s) that contain the user home directories with the\nfollowing command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1,$3,$6}' /etc/passwd\n\n smithj:1001: /home/smithj\n robinst:1002: /home/robinst\n\n Check the file systems that are mounted at boot time with the following\ncommand:\n\n $ sudo more /etc/fstab\n\n UUID=a411dc99-f2a1-4c87-9e05-184977be8539 /home ext4\nrw,relatime,discard,data=ordered,nosuid,nodev,noexec 0 2\n\n If a file system found in \"/etc/fstab\" refers to the user home directory\nfile system and it does not have the \"noexec\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"noexec\" option on\nfile systems that contain user home directories for interactive users." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230302", + "rid": "SV-257852r627750_rule", + "stig_id": "RHEL-08-010590", + "fix_id": "F-32946r567653_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257853", + "code": "control 'SV-257853' do\n title 'RHEL 9 must be configured so that the Network File System (NFS) is configured to use RPCSEC_GSS.'\n desc 'When an NFS server is configured to use RPCSEC_SYS, a selected userid and groupid are used to handle requests from the remote user. The userid and groupid could mistakenly or maliciously be set incorrectly. The RPCSEC_GSS method of authentication uses certificates on the server and client systems to more securely authenticate the remote mount request.'\n desc 'check', 'Verify RHEL 9 has the \"sec\" option configured for all NFS mounts with the following command:\n\nNote: If no NFS mounts are configured, this requirement is Not Applicable.\n\n$ cat /etc/fstab | grep nfs\n\n192.168.22.2:/mnt/export /data nfs4 rw,nosuid,nodev,noexec,sync,soft,sec=krb5p:krb5i:krb5\n\nIf the system is mounting file systems via NFS and has the sec option without the \"krb5:krb5i:krb5p\" settings, the \"sec\" option has the \"sys\" setting, or the \"sec\" option is missing, this is a finding.'\n desc 'fix', 'Update the \"/etc/fstab\" file so the option \"sec\" is defined for each NFS mounted file system and the \"sec\" option does not have the \"sys\" setting. \n\nEnsure the \"sec\" option is defined as \"krb5p:krb5i:krb5\".'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61594r925544_chk'\n tag severity: 'medium'\n tag gid: 'V-257853'\n tag rid: 'SV-257853r925546_rule'\n tag stig_id: 'RHEL-09-231060'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61518r925545_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257853.rb" + }, + "title": "RHEL 9 must be configured so that the Network File System (NFS) is configured to use RPCSEC_GSS.", + "desc": "When an NFS server is configured to use RPCSEC_SYS, a selected userid and groupid are used to handle requests from the remote user. The userid and groupid could mistakenly or maliciously be set incorrectly. The RPCSEC_GSS method of authentication uses certificates on the server and client systems to more securely authenticate the remote mount request.", + "descriptions": { + "default": "When an NFS server is configured to use RPCSEC_SYS, a selected userid and groupid are used to handle requests from the remote user. The userid and groupid could mistakenly or maliciously be set incorrectly. The RPCSEC_GSS method of authentication uses certificates on the server and client systems to more securely authenticate the remote mount request.", + "check": "Verify RHEL 9 has the \"sec\" option configured for all NFS mounts with the following command:\n\nNote: If no NFS mounts are configured, this requirement is Not Applicable.\n\n$ cat /etc/fstab | grep nfs\n\n192.168.22.2:/mnt/export /data nfs4 rw,nosuid,nodev,noexec,sync,soft,sec=krb5p:krb5i:krb5\n\nIf the system is mounting file systems via NFS and has the sec option without the \"krb5:krb5i:krb5p\" settings, the \"sec\" option has the \"sys\" setting, or the \"sec\" option is missing, this is a finding.", + "fix": "Update the \"/etc/fstab\" file so the option \"sec\" is defined for each NFS mounted file system and the \"sec\" option does not have the \"sys\" setting. \n\nEnsure the \"sec\" option is defined as \"krb5p:krb5i:krb5\"." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61594r925544_chk", + "severity": "medium", + "gid": "V-257853", + "rid": "SV-257853r925546_rule", + "stig_id": "RHEL-09-231060", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61518r925545_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257854", + "code": "control 'SV-257854' do\n title 'RHEL 8 must prevent special devices on file systems that are imported\nvia Network File System (NFS).'\n desc 'The \"nodev\" mount option causes the system to not interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access.'\n desc 'check', 'Verify file systems that are being NFS-imported are mounted with the\n\"nodev\" option with the following command:\n\n $ sudo grep nfs /etc/fstab | grep nodev\n\n UUID=e06097bb-cfcd-437b-9e4d-a691f5662a7d /store nfs rw,nosuid,nodev,noexec\n0 0\n\n If a file system found in \"/etc/fstab\" refers to NFS and it does not have\nthe \"nodev\" option set, this is a finding.'\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nodev\" option on\nfile systems that are being imported via NFS.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230307'\n tag rid: 'SV-257854r627750_rule'\n tag stig_id: 'RHEL-08-010640'\n tag fix_id: 'F-32951r567668_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n option = 'nodev'\n nfs_file_systems = etc_fstab.nfs_file_systems.params\n failing_mounts = nfs_file_systems.reject { |mnt| mnt['mount_options'].include?(option) }\n\n if nfs_file_systems.empty?\n describe 'No NFS' do\n it 'is mounted' do\n expect(nfs_file_systems).to be_empty\n end\n end\n else\n describe 'Any mounted Network File System (NFS)' do\n it \"should have '#{option}' set\" do\n expect(failing_mounts).to be_empty, \"NFS without '#{option}' set:\\n\\t- #{failing_mounts.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257854.rb" + }, + "title": "RHEL 8 must prevent special devices on file systems that are imported\nvia Network File System (NFS).", + "desc": "The \"nodev\" mount option causes the system to not interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access.", + "descriptions": { + "default": "The \"nodev\" mount option causes the system to not interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access.", + "check": "Verify file systems that are being NFS-imported are mounted with the\n\"nodev\" option with the following command:\n\n $ sudo grep nfs /etc/fstab | grep nodev\n\n UUID=e06097bb-cfcd-437b-9e4d-a691f5662a7d /store nfs rw,nosuid,nodev,noexec\n0 0\n\n If a file system found in \"/etc/fstab\" refers to NFS and it does not have\nthe \"nodev\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nodev\" option on\nfile systems that are being imported via NFS." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230307", + "rid": "SV-257854r627750_rule", + "stig_id": "RHEL-08-010640", + "fix_id": "F-32951r567668_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257855", + "code": "control 'SV-257855' do\n title 'RHEL 8 must prevent code from being executed on file systems that are\nimported via Network File System (NFS).'\n desc 'The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary as they may be incompatible. Executing files from untrusted\nfile systems increases the opportunity for unprivileged users to attain\nunauthorized administrative access.'\n desc 'check', 'Verify that file systems being imported via NFS are mounted with the\n\"noexec\" option with the following command:\n\n $ sudo grep nfs /etc/fstab | grep noexec\n\n UUID=e06097bb-cfcd-437b-9e4d-a691f5662a7d /store nfs rw,nosuid,nodev,noexec\n0 0\n\n If a file system found in \"/etc/fstab\" refers to NFS and it does not have\nthe \"noexec\" option set, this is a finding.'\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"noexec\" option on\nfile systems that are being imported via NFS.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230306'\n tag rid: 'SV-257855r627750_rule'\n tag stig_id: 'RHEL-08-010630'\n tag fix_id: 'F-32950r567665_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n option = 'noexec'\n nfs_file_systems = etc_fstab.nfs_file_systems.params\n failing_mounts = nfs_file_systems.reject { |mnt| mnt['mount_options'].include?(option) }\n\n if nfs_file_systems.empty?\n describe 'No NFS' do\n it 'is mounted' do\n expect(nfs_file_systems).to be_empty\n end\n end\n else\n describe 'Any mounted Network File System (NFS)' do\n it \"should have '#{option}' set\" do\n expect(failing_mounts).to be_empty, \"NFS without '#{option}' set:\\n\\t- #{failing_mounts.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257855.rb" + }, + "title": "RHEL 8 must prevent code from being executed on file systems that are\nimported via Network File System (NFS).", + "desc": "The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary as they may be incompatible. Executing files from untrusted\nfile systems increases the opportunity for unprivileged users to attain\nunauthorized administrative access.", + "descriptions": { + "default": "The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary as they may be incompatible. Executing files from untrusted\nfile systems increases the opportunity for unprivileged users to attain\nunauthorized administrative access.", + "check": "Verify that file systems being imported via NFS are mounted with the\n\"noexec\" option with the following command:\n\n $ sudo grep nfs /etc/fstab | grep noexec\n\n UUID=e06097bb-cfcd-437b-9e4d-a691f5662a7d /store nfs rw,nosuid,nodev,noexec\n0 0\n\n If a file system found in \"/etc/fstab\" refers to NFS and it does not have\nthe \"noexec\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"noexec\" option on\nfile systems that are being imported via NFS." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230306", + "rid": "SV-257855r627750_rule", + "stig_id": "RHEL-08-010630", + "fix_id": "F-32950r567665_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257856", + "code": "control 'SV-257856' do\n title 'RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on file systems that are imported via Network File System (NFS).'\n desc 'The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify that file systems being imported via NFS are mounted with the\n\"nosuid\" option with the following command:\n\n $ sudo grep nfs /etc/fstab | grep nosuid\n\n UUID=e06097bb-cfcd-437b-9e4d-a691f5662a7d /store nfs rw,nosuid,nodev,noexec\n0 0\n\n If a file system found in \"/etc/fstab\" refers to NFS and it does not have\nthe \"nosuid\" option set, this is a finding.'\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nfile systems that are being imported via NFS.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230308'\n tag rid: 'SV-257856r627750_rule'\n tag stig_id: 'RHEL-08-010650'\n tag fix_id: 'F-32952r567671_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n option = 'nosuid'\n nfs_file_systems = etc_fstab.nfs_file_systems.params\n failing_mounts = nfs_file_systems.reject { |mnt| mnt['mount_options'].include?(option) }\n\n if nfs_file_systems.empty?\n describe 'No NFS' do\n it 'is mounted' do\n expect(nfs_file_systems).to be_empty\n end\n end\n else\n describe 'Any mounted Network File System (NFS)' do\n it \"should have '#{option}' set\" do\n expect(failing_mounts).to be_empty, \"NFS without '#{option}' set:\\n\\t- #{failing_mounts.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257856.rb" + }, + "title": "RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on file systems that are imported via Network File System (NFS).", + "desc": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "check": "Verify that file systems being imported via NFS are mounted with the\n\"nosuid\" option with the following command:\n\n $ sudo grep nfs /etc/fstab | grep nosuid\n\n UUID=e06097bb-cfcd-437b-9e4d-a691f5662a7d /store nfs rw,nosuid,nodev,noexec\n0 0\n\n If a file system found in \"/etc/fstab\" refers to NFS and it does not have\nthe \"nosuid\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nfile systems that are being imported via NFS." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230308", + "rid": "SV-257856r627750_rule", + "stig_id": "RHEL-08-010650", + "fix_id": "F-32952r567671_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257857", + "code": "control 'SV-257857' do\n title 'RHEL 8 must prevent code from being executed on file systems that are\nused with removable media.'\n desc 'The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary files, as they may be incompatible. Executing files from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.'\n desc 'check', 'Verify file systems that are used for removable media are mounted with the\n\"noexec\" option with the following command:\n\n $ sudo more /etc/fstab\n\n UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat\nnoauto,owner,ro,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to removable media and it\ndoes not have the \"noexec\" option set, this is a finding.'\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"noexec\" option on\nfile systems that are associated with removable media.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230304'\n tag rid: 'SV-257857r627750_rule'\n tag stig_id: 'RHEL-08-010610'\n tag fix_id: 'F-32948r567659_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n option = 'noexec'\n file_systems = etc_fstab.params\n non_removable_media = input('non_removable_media_fs')\n mounted_removeable_media = file_systems.reject { |mnt| non_removable_media.include?(mnt['mount_point']) }\n failing_mounts = mounted_removeable_media.reject { |mnt| mnt['mount_options'].include?(option) }\n\n # be very explicit about why this one was a finding since we do not know which mounts are removeable media without the user telling us\n rem_media_msg = \"NOTE: Some mounted devices are not indicated to be non-removable media (you may need to update the 'non_removable_media_fs' input to check if these are truly subject to this requirement)\\n\"\n\n # there should either be no mounted removable media (which should be a requirement anyway), OR\n # all removeable media should be mounted with noexec\n if mounted_removeable_media.empty?\n describe 'No removeable media' do\n it 'are mounted' do\n expect(mounted_removeable_media).to be_empty\n end\n end\n else\n describe 'Any mounted removeable media' do\n it \"should have '#{option}' set\" do\n expect(failing_mounts).to be_empty, \"#{rem_media_msg}\\nRemoveable media without '#{option}' set:\\n\\t- #{failing_mounts.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257857.rb" + }, + "title": "RHEL 8 must prevent code from being executed on file systems that are\nused with removable media.", + "desc": "The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary files, as they may be incompatible. Executing files from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.", + "descriptions": { + "default": "The \"noexec\" mount option causes the system not to execute binary\nfiles. This option must be used for mounting any file system not containing\napproved binary files, as they may be incompatible. Executing files from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.", + "check": "Verify file systems that are used for removable media are mounted with the\n\"noexec\" option with the following command:\n\n $ sudo more /etc/fstab\n\n UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat\nnoauto,owner,ro,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to removable media and it\ndoes not have the \"noexec\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"noexec\" option on\nfile systems that are associated with removable media." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230304", + "rid": "SV-257857r627750_rule", + "stig_id": "RHEL-08-010610", + "fix_id": "F-32948r567659_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257858", + "code": "control 'SV-257858' do\n title 'RHEL 8 must prevent special devices on file systems that are used with\nremovable media.'\n desc 'The \"nodev\" mount option causes the system not to interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access.'\n desc 'check', 'Verify file systems that are used for removable media are mounted with the\n\"nodev\" option with the following command:\n\n $ sudo more /etc/fstab\n\n UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat\nnoauto,owner,ro,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to removable media and it\ndoes not have the \"nodev\" option set, this is a finding.'\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nodev\" option on\nfile systems that are associated with removable media.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230303'\n tag rid: 'SV-257858r627750_rule'\n tag stig_id: 'RHEL-08-010600'\n tag fix_id: 'F-32947r567656_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n option = 'nodev'\n file_systems = etc_fstab.params\n non_removable_media = input('non_removable_media_fs')\n mounted_removeable_media = file_systems.reject { |mnt| non_removable_media.include?(mnt['mount_point']) }\n failing_mounts = mounted_removeable_media.reject { |mnt| mnt['mount_options'].include?(option) }\n\n # be very explicit about why this one was a finding since we do not know which mounts are removeable media without the user telling us\n rem_media_msg = \"NOTE: Some mounted devices are not indicated to be non-removable media (you may need to update the 'non_removable_media_fs' input to check if these are truly subject to this requirement)\\n\"\n\n # there should either be no mounted removable media (which should be a requirement anyway), OR\n # all removeable media should be mounted with nodev\n if mounted_removeable_media.empty?\n describe 'No removeable media' do\n it 'are mounted' do\n expect(mounted_removeable_media).to be_empty\n end\n end\n else\n describe 'Any mounted removeable media' do\n it \"should have '#{option}' set\" do\n expect(failing_mounts).to be_empty, \"#{rem_media_msg}\\nRemoveable media without '#{option}' set:\\n\\t- #{failing_mounts.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257858.rb" + }, + "title": "RHEL 8 must prevent special devices on file systems that are used with\nremovable media.", + "desc": "The \"nodev\" mount option causes the system not to interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access.", + "descriptions": { + "default": "The \"nodev\" mount option causes the system not to interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access.", + "check": "Verify file systems that are used for removable media are mounted with the\n\"nodev\" option with the following command:\n\n $ sudo more /etc/fstab\n\n UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat\nnoauto,owner,ro,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to removable media and it\ndoes not have the \"nodev\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nodev\" option on\nfile systems that are associated with removable media." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230303", + "rid": "SV-257858r627750_rule", + "stig_id": "RHEL-08-010600", + "fix_id": "F-32947r567656_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257859", + "code": "control 'SV-257859' do\n title 'RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on file systems that are used with removable media.'\n desc 'The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify file systems that are used for removable media are mounted with the\n\"nosuid\" option with the following command:\n\n $ sudo more /etc/fstab\n\n UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat\nnoauto,owner,ro,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to removable media and it\ndoes not have the \"nosuid\" option set, this is a finding.'\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nfile systems that are associated with removable media.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230305'\n tag rid: 'SV-257859r627750_rule'\n tag stig_id: 'RHEL-08-010620'\n tag fix_id: 'F-32949r567662_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n option = 'nosuid'\n file_systems = etc_fstab.params\n non_removable_media = input('non_removable_media_fs')\n mounted_removeable_media = file_systems.reject { |mnt| non_removable_media.include?(mnt['mount_point']) }\n failing_mounts = mounted_removeable_media.reject { |mnt| mnt['mount_options'].include?(option) }\n\n # be very explicit about why this one was a finding since we do not know which mounts are removeable media without the user telling us\n rem_media_msg = \"NOTE: Some mounted devices are not indicated to be non-removable media (you may need to update the 'non_removable_media_fs' input to check if these are truly subject to this requirement)\\n\"\n\n # there should either be no mounted removable media (which should be a requirement anyway), OR\n # all removeable media should be mounted with nosuid\n if mounted_removeable_media.empty?\n describe 'No removeable media' do\n it 'are mounted' do\n expect(mounted_removeable_media).to be_empty\n end\n end\n else\n describe 'Any mounted removeable media' do\n it \"should have '#{option}' set\" do\n expect(failing_mounts).to be_empty, \"#{rem_media_msg}\\nRemoveable media without '#{option}' set:\\n\\t- #{failing_mounts.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257859.rb" + }, + "title": "RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on file systems that are used with removable media.", + "desc": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "check": "Verify file systems that are used for removable media are mounted with the\n\"nosuid\" option with the following command:\n\n $ sudo more /etc/fstab\n\n UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat\nnoauto,owner,ro,nosuid,nodev,noexec 0 0\n\n If a file system found in \"/etc/fstab\" refers to removable media and it\ndoes not have the \"nosuid\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nfile systems that are associated with removable media." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230305", + "rid": "SV-257859r627750_rule", + "stig_id": "RHEL-08-010620", + "fix_id": "F-32949r567662_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257860", + "code": "control 'SV-257860' do\n title 'RHEL 9 must mount /boot with the nodev option.'\n desc 'The only legitimate location for device files is the \"/dev\" directory located on the root partition. The only exception to this is chroot jails.'\n desc 'check', %q(Verify that the \"/boot\" mount point has the \"nodev\" option is with the following command:\n\nNote: This control is not applicable to RHEL 9 system booted UEFI.\n \n$ sudo mount | grep '\\s/boot\\s'\n\n/dev/sda1 on /boot type xfs (rw,nodev,relatime,seclabel,attr2)\n\nIf the \"/boot\" file system does not have the \"nodev\" option set, this is a finding.)\n desc 'fix', 'Modify \"/etc/fstab\" to use the \"nodev\" option on the \"/boot\" directory.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61601r925565_chk'\n tag severity: 'medium'\n tag gid: 'V-257860'\n tag rid: 'SV-257860r925567_rule'\n tag stig_id: 'RHEL-09-231095'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag fix_id: 'F-61525r925566_fix'\n tag 'documentable'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257860.rb" + }, + "title": "RHEL 9 must mount /boot with the nodev option.", + "desc": "The only legitimate location for device files is the \"/dev\" directory located on the root partition. The only exception to this is chroot jails.", + "descriptions": { + "default": "The only legitimate location for device files is the \"/dev\" directory located on the root partition. The only exception to this is chroot jails.", + "check": "Verify that the \"/boot\" mount point has the \"nodev\" option is with the following command:\n\nNote: This control is not applicable to RHEL 9 system booted UEFI.\n \n$ sudo mount | grep '\\s/boot\\s'\n\n/dev/sda1 on /boot type xfs (rw,nodev,relatime,seclabel,attr2)\n\nIf the \"/boot\" file system does not have the \"nodev\" option set, this is a finding.", + "fix": "Modify \"/etc/fstab\" to use the \"nodev\" option on the \"/boot\" directory." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61601r925565_chk", + "severity": "medium", + "gid": "V-257860", + "rid": "SV-257860r925567_rule", + "stig_id": "RHEL-09-231095", + "gtitle": "SRG-OS-000368-GPOS-00154", + "fix_id": "F-61525r925566_fix", + "documentable": null, + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ] + } + }, + { + "id": "SV-257861", + "code": "control 'SV-257861' do\n title 'RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on the /boot directory.'\n desc 'The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.'\n desc 'check', %q(For systems that use UEFI, this is Not Applicable.\n\n Verify the /boot directory is mounted with the \"nosuid\" option with the\nfollowing command:\n\n $ sudo mount | grep '\\s/boot\\s'\n\n /dev/sda1 on /boot type xfs\n(rw,nosuid,relatime,seclabe,attr2,inode64,noquota)\n\n If the /boot file system does not have the \"nosuid\" option set, this is a\nfinding.)\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nthe /boot directory.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230300'\n tag rid: 'SV-257861r743959_rule'\n tag stig_id: 'RHEL-08-010571'\n tag fix_id: 'F-32944r567647_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if file('/sys/firmware/efi').exist?\n impact 0.0\n describe 'System running UEFI' do\n skip 'The System is running UEFI, this control is Not Applicable.'\n end\n else\n describe mount('/boot') do\n it { should be_mounted }\n its('options') { should include 'nosuid' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257861.rb" + }, + "title": "RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on the /boot directory.", + "desc": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "check": "For systems that use UEFI, this is Not Applicable.\n\n Verify the /boot directory is mounted with the \"nosuid\" option with the\nfollowing command:\n\n $ sudo mount | grep '\\s/boot\\s'\n\n /dev/sda1 on /boot type xfs\n(rw,nosuid,relatime,seclabe,attr2,inode64,noquota)\n\n If the /boot file system does not have the \"nosuid\" option set, this is a\nfinding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nthe /boot directory." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230300", + "rid": "SV-257861r743959_rule", + "stig_id": "RHEL-08-010571", + "fix_id": "F-32944r567647_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257862", + "code": "control 'SV-257862' do\n title 'RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on the /boot/efi directory.'\n desc 'The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.'\n desc 'check', %q(For systems that use BIOS, this is Not Applicable.\n\nVerify the /boot/efi directory is mounted with the \"nosuid\" option with the following command:\n\n$ sudo mount | grep '\\s/boot/efi\\s'\n\n/dev/sda1 on /boot/efi type vfat (rw,nosuid,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)\n\nIf the /boot/efi file system does not have the \"nosuid\" option set, this is a finding.)\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nthe /boot/efi directory.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244530'\n tag rid: 'SV-257862r809336_rule'\n tag stig_id: 'RHEL-08-010572'\n tag fix_id: 'F-47762r743838_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if file('/sys/firmware/efi').exist?\n describe mount('/boot/efi') do\n it { should be_mounted }\n its('options') { should include 'nosuid' }\n end\n else\n impact 0.0\n describe 'System running BIOS' do\n skip 'The System is running a BIOS, this control is Not Applicable.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257862.rb" + }, + "title": "RHEL 8 must prevent files with the setuid and setgid bit set from\nbeing executed on the /boot/efi directory.", + "desc": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The \"nosuid\" mount option causes the system not to execute\n\"setuid\" and \"setgid\" files with owner privileges. This option must be used\nfor mounting any file system not containing approved \"setuid\" and \"setguid\"\nfiles. Executing files from untrusted file systems increases the opportunity\nfor unprivileged users to attain unauthorized administrative access.", + "check": "For systems that use BIOS, this is Not Applicable.\n\nVerify the /boot/efi directory is mounted with the \"nosuid\" option with the following command:\n\n$ sudo mount | grep '\\s/boot/efi\\s'\n\n/dev/sda1 on /boot/efi type vfat (rw,nosuid,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)\n\nIf the /boot/efi file system does not have the \"nosuid\" option set, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nosuid\" option on\nthe /boot/efi directory." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244530", + "rid": "SV-257862r809336_rule", + "stig_id": "RHEL-08-010572", + "fix_id": "F-47762r743838_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257863", + "code": "control 'SV-257863' do\n title 'RHEL 8 must mount /dev/shm with the nodev option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/dev/shm\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /dev/shm\n\n tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\"option is configured for /dev/shm:\n\n $ sudo cat /etc/fstab | grep /dev/shm\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if /dev/shm\nis mounted without the \"nodev\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /dev/shm is mounted with the \"nodev\" option\nby adding /modifying the /etc/fstab with the following line:\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230508'\n tag rid: 'SV-257863r854049_rule'\n tag stig_id: 'RHEL-08-040120'\n tag fix_id: 'F-33152r568271_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/dev/shm'\n option = 'nodev'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257863.rb" + }, + "title": "RHEL 8 must mount /dev/shm with the nodev option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/dev/shm\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /dev/shm\n\n tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\"option is configured for /dev/shm:\n\n $ sudo cat /etc/fstab | grep /dev/shm\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if /dev/shm\nis mounted without the \"nodev\" option, this is a finding.", + "fix": "Configure the system so that /dev/shm is mounted with the \"nodev\" option\nby adding /modifying the /etc/fstab with the following line:\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230508", + "rid": "SV-257863r854049_rule", + "stig_id": "RHEL-08-040120", + "fix_id": "F-33152r568271_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257864", + "code": "control 'SV-257864' do\n title 'RHEL 8 must mount /dev/shm with the noexec option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/dev/shm\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /dev/shm\n\n tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" options is configured for /dev/shm:\n\n $ sudo cat /etc/fstab | grep /dev/shm\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if\n/dev/shm is mounted without the \"noexec\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /dev/shm is mounted with the \"noexec\" option\nby adding /modifying the /etc/fstab with the following line:\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230510'\n tag rid: 'SV-257864r854051_rule'\n tag stig_id: 'RHEL-08-040122'\n tag fix_id: 'F-33154r568277_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/dev/shm'\n option = 'noexec'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257864.rb" + }, + "title": "RHEL 8 must mount /dev/shm with the noexec option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/dev/shm\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /dev/shm\n\n tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" options is configured for /dev/shm:\n\n $ sudo cat /etc/fstab | grep /dev/shm\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if\n/dev/shm is mounted without the \"noexec\" option, this is a finding.", + "fix": "Configure the system so that /dev/shm is mounted with the \"noexec\" option\nby adding /modifying the /etc/fstab with the following line:\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230510", + "rid": "SV-257864r854051_rule", + "stig_id": "RHEL-08-040122", + "fix_id": "F-33154r568277_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257865", + "code": "control 'SV-257865' do\n title 'RHEL 8 must mount /dev/shm with the nosuid option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/dev/shm\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /dev/shm\n\n tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /dev/shm:\n\n $ sudo cat /etc/fstab | grep /dev/shm\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if\n/dev/shm is mounted without the \"nosuid\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /dev/shm is mounted with the \"nosuid\"\noption by adding /modifying the /etc/fstab with the following line:\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230509'\n tag rid: 'SV-257865r854050_rule'\n tag stig_id: 'RHEL-08-040121'\n tag fix_id: 'F-33153r568274_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/dev/shm'\n option = 'nosuid'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257865.rb" + }, + "title": "RHEL 8 must mount /dev/shm with the nosuid option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/dev/shm\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /dev/shm\n\n tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /dev/shm:\n\n $ sudo cat /etc/fstab | grep /dev/shm\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if\n/dev/shm is mounted without the \"nosuid\" option, this is a finding.", + "fix": "Configure the system so that /dev/shm is mounted with the \"nosuid\"\noption by adding /modifying the /etc/fstab with the following line:\n\n tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230509", + "rid": "SV-257865r854050_rule", + "stig_id": "RHEL-08-040121", + "fix_id": "F-33153r568274_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257866", + "code": "control 'SV-257866' do\n title 'RHEL 8 must mount /tmp with the nodev option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/tmp\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /tmp\n\n /dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\" option is configured for /tmp:\n\n $ sudo cat /etc/fstab | grep /tmp\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if /tmp is\nmounted without the \"nodev\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /tmp is mounted with the \"nodev\" option by\nadding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230511'\n tag rid: 'SV-257866r854052_rule'\n tag stig_id: 'RHEL-08-040123'\n tag fix_id: 'F-33155r568280_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/tmp'\n option = 'nodev'\n mount_option_enabled = input('mount_tmp_options')[option]\n\n if mount_option_enabled\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\n else\n describe mount(path) do\n its('options') { should_not include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should_not include option }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257866.rb" + }, + "title": "RHEL 8 must mount /tmp with the nodev option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/tmp\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /tmp\n\n /dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\" option is configured for /tmp:\n\n $ sudo cat /etc/fstab | grep /tmp\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if /tmp is\nmounted without the \"nodev\" option, this is a finding.", + "fix": "Configure the system so that /tmp is mounted with the \"nodev\" option by\nadding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230511", + "rid": "SV-257866r854052_rule", + "stig_id": "RHEL-08-040123", + "fix_id": "F-33155r568280_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257867", + "code": "control 'SV-257867' do\n title 'RHEL 8 must mount /tmp with the noexec option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/tmp\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /tmp\n\n /dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" option is configured for /tmp:\n\n $ sudo cat /etc/fstab | grep /tmp\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if /tmp is\nmounted without the \"noexec\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /tmp is mounted with the \"noexec\" option by\nadding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230513'\n tag rid: 'SV-257867r854054_rule'\n tag stig_id: 'RHEL-08-040125'\n tag fix_id: 'F-33157r568286_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/tmp'\n option = 'noexec'\n mount_option_enabled = input('mount_tmp_options')[option]\n\n if mount_option_enabled\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\n else\n describe mount(path) do\n its('options') { should_not include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should_not include option }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257867.rb" + }, + "title": "RHEL 8 must mount /tmp with the noexec option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/tmp\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /tmp\n\n /dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" option is configured for /tmp:\n\n $ sudo cat /etc/fstab | grep /tmp\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if /tmp is\nmounted without the \"noexec\" option, this is a finding.", + "fix": "Configure the system so that /tmp is mounted with the \"noexec\" option by\nadding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230513", + "rid": "SV-257867r854054_rule", + "stig_id": "RHEL-08-040125", + "fix_id": "F-33157r568286_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257868", + "code": "control 'SV-257868' do\n title 'RHEL 8 must mount /tmp with the nosuid option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/tmp\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /tmp\n\n /dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /tmp:\n\n $ sudo cat /etc/fstab | grep /tmp\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if /tmp is\nmounted without the \"nosuid\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /tmp is mounted with the \"nosuid\" option by\nadding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230512'\n tag rid: 'SV-257868r854053_rule'\n tag stig_id: 'RHEL-08-040124'\n tag fix_id: 'F-33156r568283_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/tmp'\n option = 'nosuid'\n mount_option_enabled = input('mount_tmp_options')[option]\n\n if mount_option_enabled\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\n else\n describe mount(path) do\n its('options') { should_not include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should_not include option }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257868.rb" + }, + "title": "RHEL 8 must mount /tmp with the nosuid option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/tmp\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /tmp\n\n /dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /tmp:\n\n $ sudo cat /etc/fstab | grep /tmp\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if /tmp is\nmounted without the \"nosuid\" option, this is a finding.", + "fix": "Configure the system so that /tmp is mounted with the \"nosuid\" option by\nadding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-tmp /tmp xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230512", + "rid": "SV-257868r854053_rule", + "stig_id": "RHEL-08-040124", + "fix_id": "F-33156r568283_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257869", + "code": "control 'SV-257869' do\n title 'RHEL 9 must mount /var with the nodev option.'\n desc 'The \"nodev\" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.\n\nThe only legitimate location for device files is the \"/dev\" directory located on the root partition, with the exception of chroot jails if implemented.'\n desc 'check', 'Verify \"/var\" is mounted with the \"nodev\" option:\n\n$ mount | grep /var\n\n/dev/mapper/rhel-var on /var type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nIf the \"/var\" file system is mounted without the \"nodev\" option, this is a finding.'\n desc 'fix', 'Modify \"/etc/fstab\" to use the \"nodev\" option on the \"/var\" directory.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61610r925592_chk'\n tag severity: 'medium'\n tag gid: 'V-257869'\n tag rid: 'SV-257869r925594_rule'\n tag stig_id: 'RHEL-09-231140'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag fix_id: 'F-61534r925593_fix'\n tag 'documentable'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257869.rb" + }, + "title": "RHEL 9 must mount /var with the nodev option.", + "desc": "The \"nodev\" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.\n\nThe only legitimate location for device files is the \"/dev\" directory located on the root partition, with the exception of chroot jails if implemented.", + "descriptions": { + "default": "The \"nodev\" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.\n\nThe only legitimate location for device files is the \"/dev\" directory located on the root partition, with the exception of chroot jails if implemented.", + "check": "Verify \"/var\" is mounted with the \"nodev\" option:\n\n$ mount | grep /var\n\n/dev/mapper/rhel-var on /var type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nIf the \"/var\" file system is mounted without the \"nodev\" option, this is a finding.", + "fix": "Modify \"/etc/fstab\" to use the \"nodev\" option on the \"/var\" directory." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61610r925592_chk", + "severity": "medium", + "gid": "V-257869", + "rid": "SV-257869r925594_rule", + "stig_id": "RHEL-09-231140", + "gtitle": "SRG-OS-000368-GPOS-00154", + "fix_id": "F-61534r925593_fix", + "documentable": null, + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ] + } + }, + { + "id": "SV-257870", + "code": "control 'SV-257870' do\n title 'RHEL 8 must mount /var/log with the nodev option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/log\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /var/log\n\n /dev/mapper/rhel-var-log on /var/log type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\" option is configured for /var/log:\n\n $ sudo cat /etc/fstab | grep /var/log\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if /var/log\nis mounted without the \"nodev\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/log is mounted with the \"nodev\" option\nby adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230514'\n tag rid: 'SV-257870r854055_rule'\n tag stig_id: 'RHEL-08-040126'\n tag fix_id: 'F-33158r568289_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/log'\n option = 'nodev'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257870.rb" + }, + "title": "RHEL 8 must mount /var/log with the nodev option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/log\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /var/log\n\n /dev/mapper/rhel-var-log on /var/log type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\" option is configured for /var/log:\n\n $ sudo cat /etc/fstab | grep /var/log\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if /var/log\nis mounted without the \"nodev\" option, this is a finding.", + "fix": "Configure the system so that /var/log is mounted with the \"nodev\" option\nby adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230514", + "rid": "SV-257870r854055_rule", + "stig_id": "RHEL-08-040126", + "fix_id": "F-33158r568289_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257871", + "code": "control 'SV-257871' do\n title 'RHEL 8 must mount /var/log with the noexec option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/log\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /var/log\n\n /dev/mapper/rhel-var-log on /var/log type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" option is configured for /var/log:\n\n $ sudo cat /etc/fstab | grep /var/log\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if\n/var/log is mounted without the \"noexec\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/log is mounted with the \"noexec\" option\nby adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230516'\n tag rid: 'SV-257871r854057_rule'\n tag stig_id: 'RHEL-08-040128'\n tag fix_id: 'F-33160r568295_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/log'\n option = 'noexec'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257871.rb" + }, + "title": "RHEL 8 must mount /var/log with the noexec option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/log\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /var/log\n\n /dev/mapper/rhel-var-log on /var/log type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" option is configured for /var/log:\n\n $ sudo cat /etc/fstab | grep /var/log\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if\n/var/log is mounted without the \"noexec\" option, this is a finding.", + "fix": "Configure the system so that /var/log is mounted with the \"noexec\" option\nby adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230516", + "rid": "SV-257871r854057_rule", + "stig_id": "RHEL-08-040128", + "fix_id": "F-33160r568295_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257872", + "code": "control 'SV-257872' do\n title 'RHEL 8 must mount /var/log with the nosuid option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/log\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /var/log\n\n /dev/mapper/rhel-var-log on /var/log type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /var/log:\n\n $ sudo cat /etc/fstab | grep /var/log\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if\n/var/log is mounted without the \"nosuid\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/log is mounted with the \"nosuid\" option\nby adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230515'\n tag rid: 'SV-257872r854056_rule'\n tag stig_id: 'RHEL-08-040127'\n tag fix_id: 'F-33159r568292_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/log'\n option = 'nosuid'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257872.rb" + }, + "title": "RHEL 8 must mount /var/log with the nosuid option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/log\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /var/log\n\n /dev/mapper/rhel-var-log on /var/log type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /var/log:\n\n $ sudo cat /etc/fstab | grep /var/log\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if\n/var/log is mounted without the \"nosuid\" option, this is a finding.", + "fix": "Configure the system so that /var/log is mounted with the \"nosuid\" option\nby adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log /var/log xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230515", + "rid": "SV-257872r854056_rule", + "stig_id": "RHEL-08-040127", + "fix_id": "F-33159r568292_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257873", + "code": "control 'SV-257873' do\n title 'RHEL 8 must mount /var/log/audit with the nodev option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/log/audit\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit on /var/log/audit type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\" option is configured for /var/log/audit:\n\n $ sudo cat /etc/fstab | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if\n/var/log/audit is mounted without the \"nodev\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/log/audit is mounted with the \"nodev\"\noption by adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230517'\n tag rid: 'SV-257873r854058_rule'\n tag stig_id: 'RHEL-08-040129'\n tag fix_id: 'F-33161r568298_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/log/audit'\n option = 'nodev'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257873.rb" + }, + "title": "RHEL 8 must mount /var/log/audit with the nodev option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/log/audit\" is mounted with the \"nodev\" option:\n\n $ sudo mount | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit on /var/log/audit type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nodev\" option is configured for /var/log/audit:\n\n $ sudo cat /etc/fstab | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nodev\" option is missing, or if\n/var/log/audit is mounted without the \"nodev\" option, this is a finding.", + "fix": "Configure the system so that /var/log/audit is mounted with the \"nodev\"\noption by adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230517", + "rid": "SV-257873r854058_rule", + "stig_id": "RHEL-08-040129", + "fix_id": "F-33161r568298_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257874", + "code": "control 'SV-257874' do\n title 'RHEL 8 must mount /var/log/audit with the noexec option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/log/audit\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit on /var/log/audit type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" option is configured for /var/log/audit:\n\n $ sudo cat /etc/fstab | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if\n/var/log/audit is mounted without the \"noexec\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/log/audit is mounted with the \"noexec\"\noption by adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230519'\n tag rid: 'SV-257874r854060_rule'\n tag stig_id: 'RHEL-08-040131'\n tag fix_id: 'F-33163r568304_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/log/audit'\n option = 'noexec'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257874.rb" + }, + "title": "RHEL 8 must mount /var/log/audit with the noexec option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/log/audit\" is mounted with the \"noexec\" option:\n\n $ sudo mount | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit on /var/log/audit type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"noexec\" option is configured for /var/log/audit:\n\n $ sudo cat /etc/fstab | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"noexec\" option is missing, or if\n/var/log/audit is mounted without the \"noexec\" option, this is a finding.", + "fix": "Configure the system so that /var/log/audit is mounted with the \"noexec\"\noption by adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230519", + "rid": "SV-257874r854060_rule", + "stig_id": "RHEL-08-040131", + "fix_id": "F-33163r568304_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257875", + "code": "control 'SV-257875' do\n title 'RHEL 8 must mount /var/log/audit with the nosuid option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/log/audit\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit on /var/log/audit type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /var/log/audit:\n\n $ sudo cat /etc/fstab | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if\n/var/log/audit is mounted without the \"nosuid\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/log/audit is mounted with the \"nosuid\"\noption by adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230518'\n tag rid: 'SV-257875r854059_rule'\n tag stig_id: 'RHEL-08-040130'\n tag fix_id: 'F-33162r568301_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/log/audit'\n option = 'nosuid'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257875.rb" + }, + "title": "RHEL 8 must mount /var/log/audit with the nosuid option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/log/audit\" is mounted with the \"nosuid\" option:\n\n $ sudo mount | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit on /var/log/audit type xfs\n(rw,nodev,nosuid,noexec,seclabel)\n\n Verify that the \"nosuid\" option is configured for /var/log/audit:\n\n $ sudo cat /etc/fstab | grep /var/log/audit\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0\n\n If results are returned and the \"nosuid\" option is missing, or if\n/var/log/audit is mounted without the \"nosuid\" option, this is a finding.", + "fix": "Configure the system so that /var/log/audit is mounted with the \"nosuid\"\noption by adding /modifying the /etc/fstab with the following line:\n\n /dev/mapper/rhel-var-log-audit /var/log/audit xfs\ndefaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230518", + "rid": "SV-257875r854059_rule", + "stig_id": "RHEL-08-040130", + "fix_id": "F-33162r568301_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257876", + "code": "control 'SV-257876' do\n title 'RHEL 8 must mount /var/tmp with the nodev option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/tmp\" is mounted with the \"nodev\" option:\n\n$ sudo mount | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nVerify that the \"nodev\" option is configured for /var/tmp:\n\n$ sudo cat /etc/fstab | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0\n\nIf results are returned and the \"nodev\" option is missing, or if /var/tmp is mounted without the \"nodev\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/tmp is mounted with the \"nodev\" option by adding /modifying the /etc/fstab with the following line:\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230520'\n tag rid: 'SV-257876r854061_rule'\n tag stig_id: 'RHEL-08-040132'\n tag fix_id: 'F-33164r792926_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/tmp'\n option = 'nodev'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257876.rb" + }, + "title": "RHEL 8 must mount /var/tmp with the nodev option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/tmp\" is mounted with the \"nodev\" option:\n\n$ sudo mount | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nVerify that the \"nodev\" option is configured for /var/tmp:\n\n$ sudo cat /etc/fstab | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0\n\nIf results are returned and the \"nodev\" option is missing, or if /var/tmp is mounted without the \"nodev\" option, this is a finding.", + "fix": "Configure the system so that /var/tmp is mounted with the \"nodev\" option by adding /modifying the /etc/fstab with the following line:\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230520", + "rid": "SV-257876r854061_rule", + "stig_id": "RHEL-08-040132", + "fix_id": "F-33164r792926_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257877", + "code": "control 'SV-257877' do\n title 'RHEL 8 must mount /var/tmp with the noexec option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/tmp\" is mounted with the \"noexec\" option:\n\n$ sudo mount | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nVerify that the \"noexec\" option is configured for /var/tmp:\n\n$ sudo cat /etc/fstab | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0\n\nIf results are returned and the \"noexec\" option is missing, or if /var/tmp is mounted without the \"noexec\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/tmp is mounted with the \"noexec\" option by adding /modifying the /etc/fstab with the following line:\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230522'\n tag rid: 'SV-230522r854063_rule'\n tag stig_id: 'RHEL-08-040134'\n tag fix_id: 'F-33166r792932_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/tmp'\n option = 'noexec'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257877.rb" + }, + "title": "RHEL 8 must mount /var/tmp with the noexec option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/tmp\" is mounted with the \"noexec\" option:\n\n$ sudo mount | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nVerify that the \"noexec\" option is configured for /var/tmp:\n\n$ sudo cat /etc/fstab | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0\n\nIf results are returned and the \"noexec\" option is missing, or if /var/tmp is mounted without the \"noexec\" option, this is a finding.", + "fix": "Configure the system so that /var/tmp is mounted with the \"noexec\" option by adding /modifying the /etc/fstab with the following line:\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230522", + "rid": "SV-230522r854063_rule", + "stig_id": "RHEL-08-040134", + "fix_id": "F-33166r792932_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257878", + "code": "control 'SV-257878' do\n title 'RHEL 8 must mount /var/tmp with the nosuid option.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.'\n desc 'check', 'Verify \"/var/tmp\" is mounted with the \"nosuid\" option:\n\n$ sudo mount | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nVerify that the \"nosuid\" option is configured for /var/tmp:\n\n$ sudo cat /etc/fstab | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0\n\nIf results are returned and the \"nosuid\" option is missing, or if /var/tmp is mounted without the \"nosuid\" option, this is a finding.'\n desc 'fix', 'Configure the system so that /var/tmp is mounted with the \"nosuid\" option by adding /modifying the /etc/fstab with the following line:\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag gid: 'V-230521'\n tag rid: 'SV-257878r854062_rule'\n tag stig_id: 'RHEL-08-040133'\n tag fix_id: 'F-33165r792929_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n path = '/var/tmp'\n option = 'nosuid'\n\n describe mount(path) do\n its('options') { should include option }\n end\n\n describe etc_fstab.where { mount_point == path } do\n its('mount_options.flatten') { should include option }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257878.rb" + }, + "title": "RHEL 8 must mount /var/tmp with the nosuid option.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n The \"noexec\" mount option causes the system to not execute binary files.\nThis option must be used for mounting any file system not containing approved\nbinary files, as they may be incompatible. Executing files from untrusted file\nsystems increases the opportunity for unprivileged users to attain unauthorized\nadministrative access.\n\n The \"nodev\" mount option causes the system to not interpret character or\nblock special devices. Executing character or block special devices from\nuntrusted file systems increases the opportunity for unprivileged users to\nattain unauthorized administrative access.\n\n The \"nosuid\" mount option causes the system to not execute \"setuid\" and\n\"setgid\" files with owner privileges. This option must be used for mounting\nany file system not containing approved \"setuid\" and \"setguid\" files.\nExecuting files from untrusted file systems increases the opportunity for\nunprivileged users to attain unauthorized administrative access.", + "check": "Verify \"/var/tmp\" is mounted with the \"nosuid\" option:\n\n$ sudo mount | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel)\n\nVerify that the \"nosuid\" option is configured for /var/tmp:\n\n$ sudo cat /etc/fstab | grep /var/tmp\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0\n\nIf results are returned and the \"nosuid\" option is missing, or if /var/tmp is mounted without the \"nosuid\" option, this is a finding.", + "fix": "Configure the system so that /var/tmp is mounted with the \"nosuid\" option by adding /modifying the /etc/fstab with the following line:\n\n/dev/mapper/rhel-var-tmp /var/tmp xfs defaults,nodev,nosuid,noexec 0 0" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "gid": "V-230521", + "rid": "SV-257878r854062_rule", + "stig_id": "RHEL-08-040133", + "fix_id": "F-33165r792929_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-257879", + "code": "control 'SV-257879' do\n title 'All RHEL 8 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at rest protection.'\n desc 'RHEL 8 systems handling data requiring \"data at rest\" protections\n must employ cryptographic mechanisms to prevent unauthorized disclosure and\n modification of the information at rest.\n\n Selection of a cryptographic mechanism is based on the need to protect the\nintegrity of organizational information. The strength of the mechanism is\ncommensurate with the security category and/or classification of the\ninformation. Organizations have the flexibility to either encrypt all\ninformation on storage devices (i.e., full disk encryption) or encrypt specific\ndata structures (e.g., files, records, or fields).'\n desc 'check', 'Verify RHEL 8 prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption.\n\nIf there is a documented and approved reason for not having data-at-rest encryption at the operating system level, such as encryption provided by a hypervisor or a disk storage array in a virtualized environment, this requirement is not applicable.\n\nVerify all system partitions are encrypted with the following command:\n\n $ sudo blkid\n\n /dev/mapper/rhel-root: UUID=\"67b7d7fe-de60-6fd0-befb-e6748cf97743\" TYPE=\"crypto_LUKS\"\n\nEvery persistent disk partition present must be of type \"crypto_LUKS\". If any partitions other than the boot partition or pseudo file systems (such as /proc or /sys) are not type \"crypto_LUKS\", ask the administrator to indicate how the partitions are encrypted.\n\nIf there is no evidence that these partitions are encrypted, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to prevent unauthorized modification of all information at\nrest by using disk encryption.\n\n Encrypting a partition in an already installed system is more difficult,\n because existing partitions will need to be resized and changed. To encrypt an\n entire partition, dedicate a partition for encryption in the partition layout.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000185-GPOS-00079'\n tag satisfies: ['SRG-OS-000185-GPOS-00079', 'SRG-OS-000404-GPOS-00183', 'SRG-OS-000405-GPOS-00184']\n tag gid: 'V-230224'\n tag rid: 'SV-257879r917864_rule'\n tag stig_id: 'RHEL-08-010030'\n tag fix_id: 'F-32868r567419_fix'\n tag cci: ['CCI-001199']\n tag nist: ['SC-28']\n tag 'host'\n\n all_args = command('blkid').stdout.strip.split(\"\\n\").map { |s| s.sub(/^\"(.*)\"$/, '\\1') }\n\n def describe_and_skip(message)\n describe message do\n skip message\n end\n end\n\n # TODO: This should really have a resource\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe_and_skip('Disk Encryption and Data At Rest Implementation is handled on the Container Host')\n elsif input('data_at_rest_exempt') == true\n impact 0.0\n describe_and_skip('Data At Rest Requirements have been set to Not Applicabe by the `data_at_rest_exempt` input.')\n elsif all_args.empty?\n # TODO: Determine if this is an NA vs and NR or even a pass\n describe_and_skip('Command blkid did not return and non-psuedo block devices.')\n else\n all_args.each do |args|\n describe args do\n it { should match(/\\bcrypto_LUKS\\b/) }\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257879.rb" + }, + "title": "All RHEL 8 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at rest protection.", + "desc": "RHEL 8 systems handling data requiring \"data at rest\" protections\n must employ cryptographic mechanisms to prevent unauthorized disclosure and\n modification of the information at rest.\n\n Selection of a cryptographic mechanism is based on the need to protect the\nintegrity of organizational information. The strength of the mechanism is\ncommensurate with the security category and/or classification of the\ninformation. Organizations have the flexibility to either encrypt all\ninformation on storage devices (i.e., full disk encryption) or encrypt specific\ndata structures (e.g., files, records, or fields).", + "descriptions": { + "default": "RHEL 8 systems handling data requiring \"data at rest\" protections\n must employ cryptographic mechanisms to prevent unauthorized disclosure and\n modification of the information at rest.\n\n Selection of a cryptographic mechanism is based on the need to protect the\nintegrity of organizational information. The strength of the mechanism is\ncommensurate with the security category and/or classification of the\ninformation. Organizations have the flexibility to either encrypt all\ninformation on storage devices (i.e., full disk encryption) or encrypt specific\ndata structures (e.g., files, records, or fields).", + "check": "Verify RHEL 8 prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption.\n\nIf there is a documented and approved reason for not having data-at-rest encryption at the operating system level, such as encryption provided by a hypervisor or a disk storage array in a virtualized environment, this requirement is not applicable.\n\nVerify all system partitions are encrypted with the following command:\n\n $ sudo blkid\n\n /dev/mapper/rhel-root: UUID=\"67b7d7fe-de60-6fd0-befb-e6748cf97743\" TYPE=\"crypto_LUKS\"\n\nEvery persistent disk partition present must be of type \"crypto_LUKS\". If any partitions other than the boot partition or pseudo file systems (such as /proc or /sys) are not type \"crypto_LUKS\", ask the administrator to indicate how the partitions are encrypted.\n\nIf there is no evidence that these partitions are encrypted, this is a finding.", + "fix": "Configure RHEL 8 to prevent unauthorized modification of all information at\nrest by using disk encryption.\n\n Encrypting a partition in an already installed system is more difficult,\n because existing partitions will need to be resized and changed. To encrypt an\n entire partition, dedicate a partition for encryption in the partition layout." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000185-GPOS-00079", + "satisfies": [ + "SRG-OS-000185-GPOS-00079", + "SRG-OS-000404-GPOS-00183", + "SRG-OS-000405-GPOS-00184" + ], + "gid": "V-230224", + "rid": "SV-257879r917864_rule", + "stig_id": "RHEL-08-010030", + "fix_id": "F-32868r567419_fix", + "cci": [ + "CCI-001199" + ], + "nist": [ + "SC-28" + ], + "host": null + } + }, + { + "id": "SV-257880", + "code": "control 'SV-257880' do\n title 'RHEL 8 must disable mounting of cramfs.'\n desc 'It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Removing support for unneeded filesystem types reduces the local attack\nsurface of the server.\n\n Compressed ROM/RAM file system (or cramfs) is a read-only file system\ndesigned for simplicity and space-efficiency. It is mainly used in embedded\nand small-footprint systems.'\n desc 'check', 'Verify the operating system disables the ability to load the cramfs kernel module.\n\n $ sudo grep -r cramfs /etc/modprobe.d/* | grep \"/bin/false\"\n install cramfs /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the cramfs protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the cramfs kernel module.\n\nCheck to see if the cramfs kernel module is disabled with the following command:\n\n $ sudo grep -r cramfs /etc/modprobe.d/* | grep \"blacklist\"\n blacklist cramfs\n\nIf the command does not return any output or the output is not \"blacklist cramfs\", and use of the cramfs kernel module is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to use the cramfs kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install cramfs /bin/false\n blacklist cramfs\n\nReboot the system for the settings to take effect.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230498'\n tag rid: 'SV-257880r942930_rule'\n tag stig_id: 'RHEL-08-040025'\n tag fix_id: 'F-33142r942929_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe kernel_module('cramfs') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257880.rb" + }, + "title": "RHEL 8 must disable mounting of cramfs.", + "desc": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Removing support for unneeded filesystem types reduces the local attack\nsurface of the server.\n\n Compressed ROM/RAM file system (or cramfs) is a read-only file system\ndesigned for simplicity and space-efficiency. It is mainly used in embedded\nand small-footprint systems.", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by\ndefault, functionality exceeding requirements or mission objectives. These\nunnecessary capabilities or services are often overlooked and therefore may\nremain unsecured. They increase the risk to the platform by providing\nadditional attack vectors.\n\n Removing support for unneeded filesystem types reduces the local attack\nsurface of the server.\n\n Compressed ROM/RAM file system (or cramfs) is a read-only file system\ndesigned for simplicity and space-efficiency. It is mainly used in embedded\nand small-footprint systems.", + "check": "Verify the operating system disables the ability to load the cramfs kernel module.\n\n $ sudo grep -r cramfs /etc/modprobe.d/* | grep \"/bin/false\"\n install cramfs /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of the cramfs protocol is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use the cramfs kernel module.\n\nCheck to see if the cramfs kernel module is disabled with the following command:\n\n $ sudo grep -r cramfs /etc/modprobe.d/* | grep \"blacklist\"\n blacklist cramfs\n\nIf the command does not return any output or the output is not \"blacklist cramfs\", and use of the cramfs kernel module is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the ability to use the cramfs kernel module.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install cramfs /bin/false\n blacklist cramfs\n\nReboot the system for the settings to take effect." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230498", + "rid": "SV-257880r942930_rule", + "stig_id": "RHEL-08-040025", + "fix_id": "F-33142r942929_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257881", + "code": "control 'SV-257881' do\n title 'RHEL 8 must prevent special devices on non-root local partitions.'\n desc 'The \"nodev\" mount option causes the system to not interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access. The only legitimate\nlocation for device files is the /dev directory located on the root partition.'\n desc 'check', %q(Verify all non-root local partitions are mounted with the \"nodev\" option\nwith the following command:\n\n $ sudo mount | grep '^/dev\\S* on /\\S' | grep --invert-match 'nodev'\n\n If any output is produced, this is a finding.)\n desc 'fix', 'Configure the \"/etc/fstab\" to use the \"nodev\" option on all\nnon-root local partitions.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230301'\n tag rid: 'SV-257881r627750_rule'\n tag stig_id: 'RHEL-08-010580'\n tag fix_id: 'F-32945r567650_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n option = 'nodev'\n\n mount_stdout = command('mount').stdout.lines\n failing_mount_points = mount_stdout.select { |mp| mp.match(%r{^/dev\\S*\\s+on\\s+/\\S}) }.reject { |mp| mp.match(/\\(.*#{option}.*\\)/) }\n\n describe \"All mounted devices outside of '/dev' directory\" do\n it \"should be mounted with the '#{option}' option\" do\n expect(failing_mount_points).to be_empty, \"Failing devices:\\n\\t- #{failing_mount_points.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257881.rb" + }, + "title": "RHEL 8 must prevent special devices on non-root local partitions.", + "desc": "The \"nodev\" mount option causes the system to not interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access. The only legitimate\nlocation for device files is the /dev directory located on the root partition.", + "descriptions": { + "default": "The \"nodev\" mount option causes the system to not interpret\ncharacter or block special devices. Executing character or block special\ndevices from untrusted file systems increases the opportunity for unprivileged\nusers to attain unauthorized administrative access. The only legitimate\nlocation for device files is the /dev directory located on the root partition.", + "check": "Verify all non-root local partitions are mounted with the \"nodev\" option\nwith the following command:\n\n $ sudo mount | grep '^/dev\\S* on /\\S' | grep --invert-match 'nodev'\n\n If any output is produced, this is a finding.", + "fix": "Configure the \"/etc/fstab\" to use the \"nodev\" option on all\nnon-root local partitions." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230301", + "rid": "SV-257881r627750_rule", + "stig_id": "RHEL-08-010580", + "fix_id": "F-32945r567650_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257882", + "code": "control 'SV-257882' do\n title 'RHEL 8 system commands must have mode 755 or less permissive.'\n desc 'If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.'\n desc 'check', 'Verify the system commands contained in the following directories have mode \"755\" or less permissive with the following command:\n\n$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -exec ls -l {} \\\\;\n\nIf any system commands are found to be group-writable or world-writable, this is a finding.'\n desc 'fix', 'Configure the system commands to be protected from unauthorized access.\n\nRun the following command, replacing \"[FILE]\" with any system command with a mode more permissive than \"755\".\n\n$ sudo chmod 755 [FILE]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-230257'\n tag rid: 'SV-257882r792862_rule'\n tag stig_id: 'RHEL-08-010300'\n tag fix_id: 'F-32901r792861_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_command_dirs').join(' ')} -perm /0022 -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System commands' do\n it \"should have mode '0755' or less permissive\" do\n expect(failing_files).to be_empty, \"Files with excessive permissions:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257882.rb" + }, + "title": "RHEL 8 system commands must have mode 755 or less permissive.", + "desc": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "check": "Verify the system commands contained in the following directories have mode \"755\" or less permissive with the following command:\n\n$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -exec ls -l {} \\;\n\nIf any system commands are found to be group-writable or world-writable, this is a finding.", + "fix": "Configure the system commands to be protected from unauthorized access.\n\nRun the following command, replacing \"[FILE]\" with any system command with a mode more permissive than \"755\".\n\n$ sudo chmod 755 [FILE]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000259-GPOS-00100", + "gid": "V-230257", + "rid": "SV-257882r792862_rule", + "stig_id": "RHEL-08-010300", + "fix_id": "F-32901r792861_fix", + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257883", + "code": "control 'SV-257883' do\n title 'RHEL 8 library directories must have mode 755 or less permissive.'\n desc 'If RHEL 8 were to allow any user to make changes to software libraries,\n then those changes might be implemented without undergoing the appropriate\n testing and approvals that are part of a robust change management process.\n\n This requirement applies to RHEL 8 with software libraries that are accessible\n and configurable, as in the case of interpreted languages. Software libraries\n also include privileged programs that execute with escalated privileges. Only\n qualified and authorized individuals will be allowed to obtain access to\n information system components for purposes of initiating changes, including\n upgrades and modifications.'\n desc 'check', %q(Verify the system-wide shared library directories within \"/lib\",\n \"/lib64\", \"/usr/lib\" and \"/usr/lib64\" have mode \"755\" or less permissive with\n the following command:\n\n $ sudo find /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type d -exec stat -c \"%n %a\" '{}' \\;\n\n If any system-wide shared library directories are found to be group-writable\n or world-writable, this is a finding.)\n desc 'fix', 'Configure the library directories to be protected from unauthorized\n access. Run the following command, replacing \"[DIRECTORY]\" with any library\n directory with a mode more permissive than 755.\n\n $ sudo chmod 755 [DIRECTORY]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-251707'\n tag rid: 'SV-257883r809345_rule'\n tag stig_id: 'RHEL-08-010331'\n tag fix_id: 'F-55098r809344_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n permissions_for_libs = input('permissions_for_libs')\n\n overly_permissive_libs = input('system_libraries').select { |lib|\n file(lib).more_permissive_than?(permissions_for_libs)\n }\n\n describe 'System libraries' do\n it \"should not have permissions set higher than #{permissions_for_libs}\" do\n fail_msg = \"Overly permissive system libraries:\\n\\t- #{overly_permissive_libs.join(\"\\n\\t- \")}\"\n expect(overly_permissive_libs).to be_empty, fail_msg\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257883.rb" + }, + "title": "RHEL 8 library directories must have mode 755 or less permissive.", + "desc": "If RHEL 8 were to allow any user to make changes to software libraries,\n then those changes might be implemented without undergoing the appropriate\n testing and approvals that are part of a robust change management process.\n\n This requirement applies to RHEL 8 with software libraries that are accessible\n and configurable, as in the case of interpreted languages. Software libraries\n also include privileged programs that execute with escalated privileges. Only\n qualified and authorized individuals will be allowed to obtain access to\n information system components for purposes of initiating changes, including\n upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software libraries,\n then those changes might be implemented without undergoing the appropriate\n testing and approvals that are part of a robust change management process.\n\n This requirement applies to RHEL 8 with software libraries that are accessible\n and configurable, as in the case of interpreted languages. Software libraries\n also include privileged programs that execute with escalated privileges. Only\n qualified and authorized individuals will be allowed to obtain access to\n information system components for purposes of initiating changes, including\n upgrades and modifications.", + "check": "Verify the system-wide shared library directories within \"/lib\",\n \"/lib64\", \"/usr/lib\" and \"/usr/lib64\" have mode \"755\" or less permissive with\n the following command:\n\n $ sudo find /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type d -exec stat -c \"%n %a\" '{}' \\;\n\n If any system-wide shared library directories are found to be group-writable\n or world-writable, this is a finding.", + "fix": "Configure the library directories to be protected from unauthorized\n access. Run the following command, replacing \"[DIRECTORY]\" with any library\n directory with a mode more permissive than 755.\n\n $ sudo chmod 755 [DIRECTORY]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000259-GPOS-00100", + "gid": "V-251707", + "rid": "SV-257883r809345_rule", + "stig_id": "RHEL-08-010331", + "fix_id": "F-55098r809344_fix", + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null + } + }, + { + "id": "SV-257884", + "code": "control 'SV-257884' do\n title 'RHEL 8 library files must have mode 755 or less permissive.'\n desc 'If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.'\n desc 'check', 'Verify the system-wide shared library files contained in the following directories have mode \"755\" or less permissive with the following command:\n\n$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type f -exec ls -l {} \\\\;\n\nIf any system-wide shared library file is found to be group-writable or world-writable, this is a finding.'\n desc 'fix', 'Configure the library files to be protected from unauthorized access. Run the following command, replacing \"[FILE]\" with any library file with a mode more permissive than 755.\n\n$ sudo chmod 755 [FILE]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-230260'\n tag rid: 'SV-257884r792867_rule'\n tag stig_id: 'RHEL-08-010330'\n tag fix_id: 'F-32904r792866_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_libraries').join(' ')} -perm /0022 -type f -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System libraries' do\n it \"should have mode '0755' or less permissive\" do\n expect(failing_files).to be_empty, \"Files with excessive permissions:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257884.rb" + }, + "title": "RHEL 8 library files must have mode 755 or less permissive.", + "desc": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "check": "Verify the system-wide shared library files contained in the following directories have mode \"755\" or less permissive with the following command:\n\n$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type f -exec ls -l {} \\;\n\nIf any system-wide shared library file is found to be group-writable or world-writable, this is a finding.", + "fix": "Configure the library files to be protected from unauthorized access. Run the following command, replacing \"[FILE]\" with any library file with a mode more permissive than 755.\n\n$ sudo chmod 755 [FILE]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000259-GPOS-00100", + "gid": "V-230260", + "rid": "SV-257884r792867_rule", + "stig_id": "RHEL-08-010330", + "fix_id": "F-32904r792866_fix", + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257885", + "code": "control 'SV-257885' do\n title 'The RHEL 8 /var/log directory must have mode 0755 or less permissive.'\n desc \"Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.\"\n desc 'check', 'Verify that the \"/var/log\" directory has a mode of \"0755\" or less with\nthe following command:\n\n $ sudo stat -c \"%a %n\" /var/log\n\n 755\n\n If a value of \"0755\" or less permissive is not returned, this is a\nfinding.'\n desc 'fix', 'Change the permissions of the directory \"/var/log\" to \"0755\" by running\nthe following command:\n\n $ sudo chmod 0755 /var/log'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-230248'\n tag rid: 'SV-257885r627750_rule'\n tag stig_id: 'RHEL-08-010240'\n tag fix_id: 'F-32892r567491_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n tag 'container'\n\n describe directory('/var/log') do\n it { should exist }\n it { should_not be_more_permissive_than('0755') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257885.rb" + }, + "title": "The RHEL 8 /var/log directory must have mode 0755 or less permissive.", + "desc": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "descriptions": { + "default": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "check": "Verify that the \"/var/log\" directory has a mode of \"0755\" or less with\nthe following command:\n\n $ sudo stat -c \"%a %n\" /var/log\n\n 755\n\n If a value of \"0755\" or less permissive is not returned, this is a\nfinding.", + "fix": "Change the permissions of the directory \"/var/log\" to \"0755\" by running\nthe following command:\n\n $ sudo chmod 0755 /var/log" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000206-GPOS-00084", + "gid": "V-230248", + "rid": "SV-257885r627750_rule", + "stig_id": "RHEL-08-010240", + "fix_id": "F-32892r567491_fix", + "cci": [ + "CCI-001314" + ], + "nist": [ + "SI-11 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257886", + "code": "control 'SV-257886' do\n title 'The RHEL 8 /var/log/messages file must have mode 0640 or less\npermissive.'\n desc \"Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.\"\n desc 'check', 'Verify that the \"/var/log/messages\" file has mode \"0640\" or less\npermissive with the following command:\n\n $ sudo stat -c \"%a %n\" /var/log/messages\n\n 640 /var/log/messages\n\n If a value of \"0640\" or less permissive is not returned, this is a\nfinding.'\n desc 'fix', 'Change the permissions of the file \"/var/log/messages\" to \"0640\" by\nrunning the following command:\n\n $ sudo chmod 0640 /var/log/messages'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-230245'\n tag rid: 'SV-257886r627750_rule'\n tag stig_id: 'RHEL-08-010210'\n tag fix_id: 'F-32889r567482_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe.one do\n describe file('/var/log/messages') do\n it { should_not be_more_permissive_than('0640') }\n end\n describe file('/var/log/messages') do\n it { should_not exist }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257886.rb" + }, + "title": "The RHEL 8 /var/log/messages file must have mode 0640 or less\npermissive.", + "desc": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "descriptions": { + "default": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "check": "Verify that the \"/var/log/messages\" file has mode \"0640\" or less\npermissive with the following command:\n\n $ sudo stat -c \"%a %n\" /var/log/messages\n\n 640 /var/log/messages\n\n If a value of \"0640\" or less permissive is not returned, this is a\nfinding.", + "fix": "Change the permissions of the file \"/var/log/messages\" to \"0640\" by\nrunning the following command:\n\n $ sudo chmod 0640 /var/log/messages" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000206-GPOS-00084", + "gid": "V-230245", + "rid": "SV-257886r627750_rule", + "stig_id": "RHEL-08-010210", + "fix_id": "F-32889r567482_fix", + "cci": [ + "CCI-001314" + ], + "nist": [ + "SI-11 b" + ], + "host": null + } + }, + { + "id": "SV-257887", + "code": "control 'SV-257887' do\n title 'RHEL 8 audit tools must have a mode of 0755 or less permissive.'\n desc 'Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.'\n desc 'check', 'Verify the audit tools are protected from unauthorized access, deletion, or\nmodification by checking the permissive mode.\n\n Check the octal permission of each audit tool by running the following\ncommand:\n\n $ sudo stat -c \"%a %n\" /sbin/auditctl /sbin/aureport /sbin/ausearch\n/sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules\n\n 755 /sbin/auditctl\n 755 /sbin/aureport\n 755 /sbin/ausearch\n 750 /sbin/autrace\n 755 /sbin/auditd\n 755 /sbin/rsyslogd\n 755 /sbin/augenrules\n\n If any of the audit tools has a mode more permissive than \"0755\", this is\na finding.'\n desc 'fix', 'Configure the audit tools to be protected from unauthorized access by\nsetting the correct permissive mode using the following command:\n\n $ sudo chmod 0755 [audit_tool]\n\n Replace \"[audit_tool]\" with the audit tool that does not have the correct\npermissive mode.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000256-GPOS-00097'\n tag gid: 'V-230472'\n tag rid: 'SV-257887r627750_rule'\n tag stig_id: 'RHEL-08-030620'\n tag fix_id: 'F-33116r568163_fix'\n tag cci: ['CCI-001493']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_tools = ['/sbin/auditctl', '/sbin/aureport', '/sbin/ausearch', '/sbin/autrace', '/sbin/auditd', '/sbin/rsyslogd', '/sbin/augenrules']\n\n failing_tools = audit_tools.select { |at| file(at).more_permissive_than?(input('audit_tool_mode')) }\n\n describe 'Audit executables' do\n it \"should be no more permissive than '#{input('audit_tool_mode')}'\" do\n expect(failing_tools).to be_empty, \"Failing tools:\\n\\t- #{failing_tools.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257887.rb" + }, + "title": "RHEL 8 audit tools must have a mode of 0755 or less permissive.", + "desc": "Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.", + "descriptions": { + "default": "Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.", + "check": "Verify the audit tools are protected from unauthorized access, deletion, or\nmodification by checking the permissive mode.\n\n Check the octal permission of each audit tool by running the following\ncommand:\n\n $ sudo stat -c \"%a %n\" /sbin/auditctl /sbin/aureport /sbin/ausearch\n/sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules\n\n 755 /sbin/auditctl\n 755 /sbin/aureport\n 755 /sbin/ausearch\n 750 /sbin/autrace\n 755 /sbin/auditd\n 755 /sbin/rsyslogd\n 755 /sbin/augenrules\n\n If any of the audit tools has a mode more permissive than \"0755\", this is\na finding.", + "fix": "Configure the audit tools to be protected from unauthorized access by\nsetting the correct permissive mode using the following command:\n\n $ sudo chmod 0755 [audit_tool]\n\n Replace \"[audit_tool]\" with the audit tool that does not have the correct\npermissive mode." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000256-GPOS-00097", + "gid": "V-230472", + "rid": "SV-257887r627750_rule", + "stig_id": "RHEL-08-030620", + "fix_id": "F-33116r568163_fix", + "cci": [ + "CCI-001493" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-257888", + "code": "control 'SV-257888' do\n title 'RHEL 9 cron configuration directories must have a mode of 0700 or less permissive.'\n desc 'Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should have the correct access rights to prevent unauthorized changes.'\n desc 'check', 'Verify the permissions of the cron directories with the following command:\n\n$ find /etc/cron* -type d | xargs stat -c \"%a %n\"\n\n700 /etc/cron.d\n700 /etc/cron.daily\n700 /etc/cron.hourly\n700 /etc/cron.monthly\n700 /etc/cron.weekly\n\nIf any cron configuration directory is more permissive than \"700\", this is a finding.'\n desc 'fix', 'Configure any RHEL 9 cron configuration directory with a mode more permissive than \"0700\" as follows:\n\nchmod 0700 [cron configuration directory]'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61629r925649_chk'\n tag severity: 'medium'\n tag gid: 'V-257888'\n tag rid: 'SV-257888r925651_rule'\n tag stig_id: 'RHEL-09-232040'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61553r925650_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257888.rb" + }, + "title": "RHEL 9 cron configuration directories must have a mode of 0700 or less permissive.", + "desc": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should have the correct access rights to prevent unauthorized changes.", + "descriptions": { + "default": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should have the correct access rights to prevent unauthorized changes.", + "check": "Verify the permissions of the cron directories with the following command:\n\n$ find /etc/cron* -type d | xargs stat -c \"%a %n\"\n\n700 /etc/cron.d\n700 /etc/cron.daily\n700 /etc/cron.hourly\n700 /etc/cron.monthly\n700 /etc/cron.weekly\n\nIf any cron configuration directory is more permissive than \"700\", this is a finding.", + "fix": "Configure any RHEL 9 cron configuration directory with a mode more permissive than \"0700\" as follows:\n\nchmod 0700 [cron configuration directory]" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61629r925649_chk", + "severity": "medium", + "gid": "V-257888", + "rid": "SV-257888r925651_rule", + "stig_id": "RHEL-09-232040", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61553r925650_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257889", + "code": "control 'SV-257889' do\n title 'All RHEL 8 local initialization files must have mode 0740 or less\npermissive.'\n desc \"Local initialization files are used to configure the user's shell\nenvironment upon logon. Malicious modification of these files could compromise\naccounts upon logon.\"\n desc 'check', 'Verify that all local initialization files have a mode of \"0740\" or less permissive with the following command:\n\nNote: The example will be for the \"smithj\" user, who has a home directory of \"/home/smithj\".\n\n $ sudo ls -al /home/smithj/.[^.]* | more\n\n -rw-------. 1 smithj users 2984 Apr 27 19:02 .bash_history\n -rw-r--r--. 1 smithj users 18 Aug 21 2019 .bash_logout\n -rw-r--r--. 1 smithj users 193 Aug 21 2019 .bash_profile\n\nIf any local initialization files have a mode more permissive than \"0740\", this is a finding.'\n desc 'fix', 'Set the mode of the local initialization files to \"0740\" with the\nfollowing command:\n\n Note: The example will be for the smithj user, who has a home directory of\n\"/home/smithj\".\n\n $ sudo chmod 0740 /home/smithj/.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230325'\n tag rid: 'SV-257889r917879_rule'\n tag stig_id: 'RHEL-08-010770'\n tag fix_id: 'F-32969r917878_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n ignore_shells = input('non_interactive_shells').join('|')\n\n homedirs = users.where { !shell.match(ignore_shells) && (uid >= 1000 || uid.zero?) }.homes\n ifiles = command(\"find #{homedirs.join(' ')} -xdev -maxdepth 1 -name '.*' -type f\").stdout.split(\"\\n\")\n\n expected_mode = input('initialization_file_mode')\n failing_files = ifiles.select { |ifile| file(ifile).more_permissive_than?(expected_mode) }\n\n describe 'All RHEL 8 local initialization files' do\n it \"must have mode '#{expected_mode}' or less permissive\" do\n expect(failing_files).to be_empty, \"Failing files:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257889.rb" + }, + "title": "All RHEL 8 local initialization files must have mode 0740 or less\npermissive.", + "desc": "Local initialization files are used to configure the user's shell\nenvironment upon logon. Malicious modification of these files could compromise\naccounts upon logon.", + "descriptions": { + "default": "Local initialization files are used to configure the user's shell\nenvironment upon logon. Malicious modification of these files could compromise\naccounts upon logon.", + "check": "Verify that all local initialization files have a mode of \"0740\" or less permissive with the following command:\n\nNote: The example will be for the \"smithj\" user, who has a home directory of \"/home/smithj\".\n\n $ sudo ls -al /home/smithj/.[^.]* | more\n\n -rw-------. 1 smithj users 2984 Apr 27 19:02 .bash_history\n -rw-r--r--. 1 smithj users 18 Aug 21 2019 .bash_logout\n -rw-r--r--. 1 smithj users 193 Aug 21 2019 .bash_profile\n\nIf any local initialization files have a mode more permissive than \"0740\", this is a finding.", + "fix": "Set the mode of the local initialization files to \"0740\" with the\nfollowing command:\n\n Note: The example will be for the smithj user, who has a home directory of\n\"/home/smithj\".\n\n $ sudo chmod 0740 /home/smithj/." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230325", + "rid": "SV-257889r917879_rule", + "stig_id": "RHEL-08-010770", + "fix_id": "F-32969r917878_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257890", + "code": "control 'SV-257890' do\n title 'All RHEL 8 local interactive user home directories must have mode 0750\nor less permissive.'\n desc 'Excessive permissions on local interactive user home directories may\nallow unauthorized access to user files by other users.'\n desc 'check', %q(Verify the assigned home directory of all local interactive users has a\nmode of \"0750\" or less permissive with the following command:\n\n Note: This may miss interactive users that have been assigned a privileged\nUser Identifier (UID). Evidence of interactive use may be obtained from a\nnumber of log files containing system logon information.\n\n $ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}'\n/etc/passwd)\n\n drwxr-x--- 2 smithj admin 4096 Jun 5 12:41 smithj\n\n If home directories referenced in \"/etc/passwd\" do not have a mode of\n\"0750\" or less permissive, this is a finding.)\n desc 'fix', 'Change the mode of interactive user’s home directories to \"0750\". To\nchange the mode of a local interactive user’s home directory, use the following\ncommand:\n\n Note: The example will be for the user \"smithj\".\n\n $ sudo chmod 0750 /home/smithj'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230321'\n tag rid: 'SV-257890r627750_rule'\n tag stig_id: 'RHEL-08-010730'\n tag fix_id: 'F-32965r567710_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n exempt_home_users = input('exempt_home_users')\n expected_mode = input('home_dir_mode')\n uid_min = login_defs.read_params['UID_MIN'].to_i\n uid_min = 1000 if uid_min.nil?\n\n iuser_entries = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) }\n\n if !iuser_entries.users.nil? && !iuser_entries.users.empty?\n failing_homedirs = iuser_entries.homes.select { |home|\n file(home).more_permissive_than?(expected_mode)\n }\n describe 'All non-exempt interactive user account home directories on the system' do\n it \"should not be more permissive than '#{expected_mode}'\" do\n expect(failing_homedirs).to be_empty, \"Failing home directories:\\n\\t- #{failing_homedirs.join(\"\\n\\t- \")}\"\n end\n end\n else\n describe 'No non-exempt interactive user accounts' do\n it 'were detected on the system' do\n expect(true).to eq(true)\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257890.rb" + }, + "title": "All RHEL 8 local interactive user home directories must have mode 0750\nor less permissive.", + "desc": "Excessive permissions on local interactive user home directories may\nallow unauthorized access to user files by other users.", + "descriptions": { + "default": "Excessive permissions on local interactive user home directories may\nallow unauthorized access to user files by other users.", + "check": "Verify the assigned home directory of all local interactive users has a\nmode of \"0750\" or less permissive with the following command:\n\n Note: This may miss interactive users that have been assigned a privileged\nUser Identifier (UID). Evidence of interactive use may be obtained from a\nnumber of log files containing system logon information.\n\n $ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}'\n/etc/passwd)\n\n drwxr-x--- 2 smithj admin 4096 Jun 5 12:41 smithj\n\n If home directories referenced in \"/etc/passwd\" do not have a mode of\n\"0750\" or less permissive, this is a finding.", + "fix": "Change the mode of interactive user’s home directories to \"0750\". To\nchange the mode of a local interactive user’s home directory, use the following\ncommand:\n\n Note: The example will be for the user \"smithj\".\n\n $ sudo chmod 0750 /home/smithj" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230321", + "rid": "SV-257890r627750_rule", + "stig_id": "RHEL-08-010730", + "fix_id": "F-32965r567710_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257891", + "code": "control 'SV-257891' do\n title 'RHEL 9 /etc/group file must have mode 0644 or less permissive to prevent unauthorized access.'\n desc 'The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.'\n desc 'check', 'Verify that the \"/etc/group\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/group\n\n644 /etc/group\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/group\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/group'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61632r925658_chk'\n tag severity: 'medium'\n tag gid: 'V-257891'\n tag rid: 'SV-257891r925660_rule'\n tag stig_id: 'RHEL-09-232055'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61556r925659_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257891.rb" + }, + "title": "RHEL 9 /etc/group file must have mode 0644 or less permissive to prevent unauthorized access.", + "desc": "The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "descriptions": { + "default": "The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "check": "Verify that the \"/etc/group\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/group\n\n644 /etc/group\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/group\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/group" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61632r925658_chk", + "severity": "medium", + "gid": "V-257891", + "rid": "SV-257891r925660_rule", + "stig_id": "RHEL-09-232055", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61556r925659_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257892", + "code": "control 'SV-257892' do\n title 'RHEL 9 /etc/group- file must have mode 0644 or less permissive to prevent unauthorized access.'\n desc 'The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.'\n desc 'check', 'Verify that the \"/etc/group-\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/group-\n\n644 /etc/group-\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/group-\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/group-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61633r925661_chk'\n tag severity: 'medium'\n tag gid: 'V-257892'\n tag rid: 'SV-257892r925663_rule'\n tag stig_id: 'RHEL-09-232060'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61557r925662_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257892.rb" + }, + "title": "RHEL 9 /etc/group- file must have mode 0644 or less permissive to prevent unauthorized access.", + "desc": "The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "descriptions": { + "default": "The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "check": "Verify that the \"/etc/group-\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/group-\n\n644 /etc/group-\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/group-\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/group-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61633r925661_chk", + "severity": "medium", + "gid": "V-257892", + "rid": "SV-257892r925663_rule", + "stig_id": "RHEL-09-232060", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61557r925662_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257893", + "code": "control 'SV-257893' do\n title 'RHEL 9 /etc/gshadow file must have mode 0000 or less permissive to prevent unauthorized access.'\n desc 'The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify that the \"/etc/gshadow\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/gshadow\n\n0 /etc/gshadow\n\nIf a value of \"0\" is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/gshadow\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/gshadow'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61634r925664_chk'\n tag severity: 'medium'\n tag gid: 'V-257893'\n tag rid: 'SV-257893r925666_rule'\n tag stig_id: 'RHEL-09-232065'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61558r925665_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257893.rb" + }, + "title": "RHEL 9 /etc/gshadow file must have mode 0000 or less permissive to prevent unauthorized access.", + "desc": "The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.", + "check": "Verify that the \"/etc/gshadow\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/gshadow\n\n0 /etc/gshadow\n\nIf a value of \"0\" is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/gshadow\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/gshadow" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61634r925664_chk", + "severity": "medium", + "gid": "V-257893", + "rid": "SV-257893r925666_rule", + "stig_id": "RHEL-09-232065", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61558r925665_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257894", + "code": "control 'SV-257894' do\n title 'RHEL 9 /etc/gshadow- file must have mode 0000 or less permissive to prevent unauthorized access.'\n desc 'The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify that the \"/etc/gshadow-\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/gshadow-\n\n0 /etc/gshadow-\n\nIf a value of \"0\" is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/gshadow-\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/gshadow-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61635r925667_chk'\n tag severity: 'medium'\n tag gid: 'V-257894'\n tag rid: 'SV-257894r925669_rule'\n tag stig_id: 'RHEL-09-232070'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61559r925668_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257894.rb" + }, + "title": "RHEL 9 /etc/gshadow- file must have mode 0000 or less permissive to prevent unauthorized access.", + "desc": "The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.", + "check": "Verify that the \"/etc/gshadow-\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/gshadow-\n\n0 /etc/gshadow-\n\nIf a value of \"0\" is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/gshadow-\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/gshadow-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61635r925667_chk", + "severity": "medium", + "gid": "V-257894", + "rid": "SV-257894r925669_rule", + "stig_id": "RHEL-09-232070", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61559r925668_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257895", + "code": "control 'SV-257895' do\n title 'RHEL 9 /etc/passwd file must have mode 0644 or less permissive to prevent unauthorized access.'\n desc 'If the \"/etc/passwd\" file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the list of accounts on the system and associated information, and protection of this file is critical for system security.'\n desc 'check', 'Verify that the \"/etc/passwd\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/passwd\n\n644 /etc/passwd\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/passwd\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/passwd'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61636r925670_chk'\n tag severity: 'medium'\n tag gid: 'V-257895'\n tag rid: 'SV-257895r925672_rule'\n tag stig_id: 'RHEL-09-232075'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61560r925671_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257895.rb" + }, + "title": "RHEL 9 /etc/passwd file must have mode 0644 or less permissive to prevent unauthorized access.", + "desc": "If the \"/etc/passwd\" file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the list of accounts on the system and associated information, and protection of this file is critical for system security.", + "descriptions": { + "default": "If the \"/etc/passwd\" file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the list of accounts on the system and associated information, and protection of this file is critical for system security.", + "check": "Verify that the \"/etc/passwd\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/passwd\n\n644 /etc/passwd\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/passwd\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/passwd" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61636r925670_chk", + "severity": "medium", + "gid": "V-257895", + "rid": "SV-257895r925672_rule", + "stig_id": "RHEL-09-232075", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61560r925671_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257896", + "code": "control 'SV-257896' do\n title 'RHEL 9 /etc/passwd- file must have mode 0644 or less permissive to prevent unauthorized access.'\n desc 'The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.'\n desc 'check', 'Verify that the \"/etc/passwd-\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/passwd-\n\n644 /etc/passwd-\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/passwd-\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/passwd-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61637r925673_chk'\n tag severity: 'medium'\n tag gid: 'V-257896'\n tag rid: 'SV-257896r925675_rule'\n tag stig_id: 'RHEL-09-232080'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61561r925674_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257896.rb" + }, + "title": "RHEL 9 /etc/passwd- file must have mode 0644 or less permissive to prevent unauthorized access.", + "desc": "The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "check": "Verify that the \"/etc/passwd-\" file has mode \"0644\" or less permissive with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/passwd-\n\n644 /etc/passwd-\n\nIf a value of \"0644\" or less permissive is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/passwd-\" to \"0644\" by running the following command:\n\n$ sudo chmod 0644 /etc/passwd-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61637r925673_chk", + "severity": "medium", + "gid": "V-257896", + "rid": "SV-257896r925675_rule", + "stig_id": "RHEL-09-232080", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61561r925674_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257897", + "code": "control 'SV-257897' do\n title 'RHEL 9 /etc/shadow- file must have mode 0000 or less permissive to prevent unauthorized access.'\n desc 'The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify that the \"/etc/shadow-\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/shadow-\n\n0 /etc/shadow-\n\nIf a value of \"0\" is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/shadow-\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/shadow-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61638r925676_chk'\n tag severity: 'medium'\n tag gid: 'V-257897'\n tag rid: 'SV-257897r925678_rule'\n tag stig_id: 'RHEL-09-232085'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61562r925677_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257897.rb" + }, + "title": "RHEL 9 /etc/shadow- file must have mode 0000 or less permissive to prevent unauthorized access.", + "desc": "The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.", + "check": "Verify that the \"/etc/shadow-\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/shadow-\n\n0 /etc/shadow-\n\nIf a value of \"0\" is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/shadow-\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/shadow-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61638r925676_chk", + "severity": "medium", + "gid": "V-257897", + "rid": "SV-257897r925678_rule", + "stig_id": "RHEL-09-232085", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61562r925677_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257898", + "code": "control 'SV-257898' do\n title 'RHEL 9 /etc/group file must be owned by root.'\n desc 'The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.'\n desc 'check', 'Verify the ownership of the \"/etc/group\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/group \n\nroot /etc/group \n\nIf \"/etc/group\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/group to root by running the following command:\n\n$ sudo chown root /etc/group'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61639r925679_chk'\n tag severity: 'medium'\n tag gid: 'V-257898'\n tag rid: 'SV-257898r925681_rule'\n tag stig_id: 'RHEL-09-232090'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61563r925680_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257898.rb" + }, + "title": "RHEL 9 /etc/group file must be owned by root.", + "desc": "The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "descriptions": { + "default": "The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "check": "Verify the ownership of the \"/etc/group\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/group \n\nroot /etc/group \n\nIf \"/etc/group\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/group to root by running the following command:\n\n$ sudo chown root /etc/group" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61639r925679_chk", + "severity": "medium", + "gid": "V-257898", + "rid": "SV-257898r925681_rule", + "stig_id": "RHEL-09-232090", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61563r925680_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257899", + "code": "control 'SV-257899' do\n title 'RHEL 9 /etc/group file must be group-owned by root.'\n desc 'The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/group\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/group \n\nroot /etc/group\n\nIf \"/etc/group\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/group to root by running the following command:\n\n$ sudo chgrp root /etc/group'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61640r925682_chk'\n tag severity: 'medium'\n tag gid: 'V-257899'\n tag rid: 'SV-257899r925684_rule'\n tag stig_id: 'RHEL-09-232095'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61564r925683_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257899.rb" + }, + "title": "RHEL 9 /etc/group file must be group-owned by root.", + "desc": "The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "descriptions": { + "default": "The \"/etc/group\" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "check": "Verify the group ownership of the \"/etc/group\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/group \n\nroot /etc/group\n\nIf \"/etc/group\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/group to root by running the following command:\n\n$ sudo chgrp root /etc/group" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61640r925682_chk", + "severity": "medium", + "gid": "V-257899", + "rid": "SV-257899r925684_rule", + "stig_id": "RHEL-09-232095", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61564r925683_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257900", + "code": "control 'SV-257900' do\n title 'RHEL 9 /etc/group- file must be owned by root.'\n desc 'The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.'\n desc 'check', 'Verify the ownership of the \"/etc/group-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/group- \n\nroot /etc/group- \n\nIf \"/etc/group-\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/group- to root by running the following command:\n\n$ sudo chown root /etc/group-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61641r925685_chk'\n tag severity: 'medium'\n tag gid: 'V-257900'\n tag rid: 'SV-257900r925687_rule'\n tag stig_id: 'RHEL-09-232100'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61565r925686_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257900.rb" + }, + "title": "RHEL 9 /etc/group- file must be owned by root.", + "desc": "The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "descriptions": { + "default": "The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "check": "Verify the ownership of the \"/etc/group-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/group- \n\nroot /etc/group- \n\nIf \"/etc/group-\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/group- to root by running the following command:\n\n$ sudo chown root /etc/group-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61641r925685_chk", + "severity": "medium", + "gid": "V-257900", + "rid": "SV-257900r925687_rule", + "stig_id": "RHEL-09-232100", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61565r925686_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257901", + "code": "control 'SV-257901' do\n title 'RHEL 9 /etc/group- file must be group-owned by root.'\n desc 'The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/group-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/group- \n\nroot /etc/group-\n\nIf \"/etc/group-\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/group- to root by running the following command:\n\n$ sudo chgrp root /etc/group-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61642r925688_chk'\n tag severity: 'medium'\n tag gid: 'V-257901'\n tag rid: 'SV-257901r925690_rule'\n tag stig_id: 'RHEL-09-232105'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61566r925689_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257901.rb" + }, + "title": "RHEL 9 /etc/group- file must be group-owned by root.", + "desc": "The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "descriptions": { + "default": "The \"/etc/group-\" file is a backup file of \"/etc/group\", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.", + "check": "Verify the group ownership of the \"/etc/group-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/group- \n\nroot /etc/group-\n\nIf \"/etc/group-\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/group- to root by running the following command:\n\n$ sudo chgrp root /etc/group-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61642r925688_chk", + "severity": "medium", + "gid": "V-257901", + "rid": "SV-257901r925690_rule", + "stig_id": "RHEL-09-232105", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61566r925689_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257902", + "code": "control 'SV-257902' do\n title 'RHEL 9 /etc/gshadow file must be owned by root.'\n desc 'The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify the ownership of the \"/etc/gshadow\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/gshadow \n\nroot /etc/gshadow \n\nIf \"/etc/gshadow\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/gshadow to root by running the following command:\n\n$ sudo chown root /etc/gshadow'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61643r925691_chk'\n tag severity: 'medium'\n tag gid: 'V-257902'\n tag rid: 'SV-257902r925693_rule'\n tag stig_id: 'RHEL-09-232110'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61567r925692_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257902.rb" + }, + "title": "RHEL 9 /etc/gshadow file must be owned by root.", + "desc": "The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.", + "check": "Verify the ownership of the \"/etc/gshadow\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/gshadow \n\nroot /etc/gshadow \n\nIf \"/etc/gshadow\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/gshadow to root by running the following command:\n\n$ sudo chown root /etc/gshadow" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61643r925691_chk", + "severity": "medium", + "gid": "V-257902", + "rid": "SV-257902r925693_rule", + "stig_id": "RHEL-09-232110", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61567r925692_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257903", + "code": "control 'SV-257903' do\n title 'RHEL 9 /etc/gshadow file must be group-owned by root.'\n desc 'The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/gshadow\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/gshadow \n\nroot /etc/gshadow\n\nIf \"/etc/gshadow\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/gshadow to root by running the following command:\n\n$ sudo chgrp root /etc/gshadow'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61644r925694_chk'\n tag severity: 'medium'\n tag gid: 'V-257903'\n tag rid: 'SV-257903r925696_rule'\n tag stig_id: 'RHEL-09-232115'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61568r925695_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257903.rb" + }, + "title": "RHEL 9 /etc/gshadow file must be group-owned by root.", + "desc": "The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/gshadow\" file contains group password hashes. Protection of this file is critical for system security.", + "check": "Verify the group ownership of the \"/etc/gshadow\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/gshadow \n\nroot /etc/gshadow\n\nIf \"/etc/gshadow\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/gshadow to root by running the following command:\n\n$ sudo chgrp root /etc/gshadow" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61644r925694_chk", + "severity": "medium", + "gid": "V-257903", + "rid": "SV-257903r925696_rule", + "stig_id": "RHEL-09-232115", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61568r925695_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257904", + "code": "control 'SV-257904' do\n title 'RHEL 9 /etc/gshadow- file must be owned by root.'\n desc 'The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify the ownership of the \"/etc/gshadow-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/gshadow- \n\nroot /etc/gshadow- \n\nIf \"/etc/gshadow-\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/gshadow- to root by running the following command:\n\n$ sudo chown root /etc/gshadow-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61645r925697_chk'\n tag severity: 'medium'\n tag gid: 'V-257904'\n tag rid: 'SV-257904r925699_rule'\n tag stig_id: 'RHEL-09-232120'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61569r925698_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257904.rb" + }, + "title": "RHEL 9 /etc/gshadow- file must be owned by root.", + "desc": "The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.", + "check": "Verify the ownership of the \"/etc/gshadow-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/gshadow- \n\nroot /etc/gshadow- \n\nIf \"/etc/gshadow-\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/gshadow- to root by running the following command:\n\n$ sudo chown root /etc/gshadow-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61645r925697_chk", + "severity": "medium", + "gid": "V-257904", + "rid": "SV-257904r925699_rule", + "stig_id": "RHEL-09-232120", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61569r925698_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257905", + "code": "control 'SV-257905' do\n title 'RHEL 9 /etc/gshadow- file must be group-owned by root.'\n desc 'The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/gshadow-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/gshadow- \n\nroot /etc/gshadow-\n\nIf \"/etc/gshadow-\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/gshadow- to root by running the following command:\n\n$ sudo chgrp root /etc/gshadow-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61646r925700_chk'\n tag severity: 'medium'\n tag gid: 'V-257905'\n tag rid: 'SV-257905r925702_rule'\n tag stig_id: 'RHEL-09-232125'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61570r925701_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257905.rb" + }, + "title": "RHEL 9 /etc/gshadow- file must be group-owned by root.", + "desc": "The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/gshadow-\" file is a backup of \"/etc/gshadow\", and as such, contains group password hashes. Protection of this file is critical for system security.", + "check": "Verify the group ownership of the \"/etc/gshadow-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/gshadow- \n\nroot /etc/gshadow-\n\nIf \"/etc/gshadow-\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/gshadow- to root by running the following command:\n\n$ sudo chgrp root /etc/gshadow-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61646r925700_chk", + "severity": "medium", + "gid": "V-257905", + "rid": "SV-257905r925702_rule", + "stig_id": "RHEL-09-232125", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61570r925701_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257906", + "code": "control 'SV-257906' do\n title 'RHEL 9 /etc/passwd file must be owned by root.'\n desc 'The \"/etc/passwd\" file contains information about the users that are configured on the system. Protection of this file is critical for system security.'\n desc 'check', 'Verify the ownership of the \"/etc/passwd\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/passwd\n\nroot /etc/passwd\n\nIf \"/etc/passwd\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/passwd to root by running the following command:\n\n$ sudo chown root /etc/passwd'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61647r925703_chk'\n tag severity: 'medium'\n tag gid: 'V-257906'\n tag rid: 'SV-257906r925705_rule'\n tag stig_id: 'RHEL-09-232130'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61571r925704_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257906.rb" + }, + "title": "RHEL 9 /etc/passwd file must be owned by root.", + "desc": "The \"/etc/passwd\" file contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/passwd\" file contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "check": "Verify the ownership of the \"/etc/passwd\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/passwd\n\nroot /etc/passwd\n\nIf \"/etc/passwd\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/passwd to root by running the following command:\n\n$ sudo chown root /etc/passwd" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61647r925703_chk", + "severity": "medium", + "gid": "V-257906", + "rid": "SV-257906r925705_rule", + "stig_id": "RHEL-09-232130", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61571r925704_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257907", + "code": "control 'SV-257907' do\n title 'RHEL 9 /etc/passwd file must be group-owned by root.'\n desc 'The \"/etc/passwd\" file contains information about the users that are configured on the system. Protection of this file is critical for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/passwd\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/passwd \n\nroot /etc/passwd\n\nIf \"/etc/passwd\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/passwd to root by running the following command:\n\n$ sudo chgrp root /etc/passwd'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61648r925706_chk'\n tag severity: 'medium'\n tag gid: 'V-257907'\n tag rid: 'SV-257907r925708_rule'\n tag stig_id: 'RHEL-09-232135'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61572r925707_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257907.rb" + }, + "title": "RHEL 9 /etc/passwd file must be group-owned by root.", + "desc": "The \"/etc/passwd\" file contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/passwd\" file contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "check": "Verify the group ownership of the \"/etc/passwd\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/passwd \n\nroot /etc/passwd\n\nIf \"/etc/passwd\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/passwd to root by running the following command:\n\n$ sudo chgrp root /etc/passwd" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61648r925706_chk", + "severity": "medium", + "gid": "V-257907", + "rid": "SV-257907r925708_rule", + "stig_id": "RHEL-09-232135", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61572r925707_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257908", + "code": "control 'SV-257908' do\n title 'RHEL 9 /etc/passwd- file must be owned by root.'\n desc 'The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.'\n desc 'check', 'Verify the ownership of the \"/etc/passwd-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/passwd- \n\nroot /etc/passwd- \n\nIf \"/etc/passwd-\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/passwd- to root by running the following command:\n\n$ sudo chown root /etc/passwd-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61649r925709_chk'\n tag severity: 'medium'\n tag gid: 'V-257908'\n tag rid: 'SV-257908r925711_rule'\n tag stig_id: 'RHEL-09-232140'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61573r925710_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257908.rb" + }, + "title": "RHEL 9 /etc/passwd- file must be owned by root.", + "desc": "The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "check": "Verify the ownership of the \"/etc/passwd-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/passwd- \n\nroot /etc/passwd- \n\nIf \"/etc/passwd-\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/passwd- to root by running the following command:\n\n$ sudo chown root /etc/passwd-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61649r925709_chk", + "severity": "medium", + "gid": "V-257908", + "rid": "SV-257908r925711_rule", + "stig_id": "RHEL-09-232140", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61573r925710_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257909", + "code": "control 'SV-257909' do\n title 'RHEL 9 /etc/passwd- file must be group-owned by root.'\n desc 'The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/passwd-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/passwd-\n\nroot /etc/passwd-\n\nIf \"/etc/passwd-\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/passwd- to root by running the following command:\n\n$ sudo chgrp root /etc/passwd-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61650r925712_chk'\n tag severity: 'medium'\n tag gid: 'V-257909'\n tag rid: 'SV-257909r925714_rule'\n tag stig_id: 'RHEL-09-232145'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61574r925713_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257909.rb" + }, + "title": "RHEL 9 /etc/passwd- file must be group-owned by root.", + "desc": "The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/passwd-\" file is a backup file of \"/etc/passwd\", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.", + "check": "Verify the group ownership of the \"/etc/passwd-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/passwd-\n\nroot /etc/passwd-\n\nIf \"/etc/passwd-\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/passwd- to root by running the following command:\n\n$ sudo chgrp root /etc/passwd-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61650r925712_chk", + "severity": "medium", + "gid": "V-257909", + "rid": "SV-257909r925714_rule", + "stig_id": "RHEL-09-232145", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61574r925713_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257910", + "code": "control 'SV-257910' do\n title 'RHEL 9 /etc/shadow file must be owned by root.'\n desc 'The \"/etc/shadow\" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.'\n desc 'check', 'Verify the ownership of the \"/etc/shadow\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/shadow\n\nroot /etc/shadow\n\nIf \"/etc/shadow\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/shadow to root by running the following command:\n\n$ sudo chown root /etc/shadow'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61651r925715_chk'\n tag severity: 'medium'\n tag gid: 'V-257910'\n tag rid: 'SV-257910r925717_rule'\n tag stig_id: 'RHEL-09-232150'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61575r925716_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257910.rb" + }, + "title": "RHEL 9 /etc/shadow file must be owned by root.", + "desc": "The \"/etc/shadow\" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.", + "descriptions": { + "default": "The \"/etc/shadow\" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.", + "check": "Verify the ownership of the \"/etc/shadow\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/shadow\n\nroot /etc/shadow\n\nIf \"/etc/shadow\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/shadow to root by running the following command:\n\n$ sudo chown root /etc/shadow" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61651r925715_chk", + "severity": "medium", + "gid": "V-257910", + "rid": "SV-257910r925717_rule", + "stig_id": "RHEL-09-232150", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61575r925716_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257911", + "code": "control 'SV-257911' do\n title 'RHEL 9 /etc/shadow file must be group-owned by root.'\n desc 'The \"/etc/shadow\" file stores password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/shadow\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/shadow \n\nroot /etc/shadow\n\nIf \"/etc/shadow\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/shadow to root by running the following command:\n\n$ sudo chgrp root /etc/shadow'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61652r925718_chk'\n tag severity: 'medium'\n tag gid: 'V-257911'\n tag rid: 'SV-257911r925720_rule'\n tag stig_id: 'RHEL-09-232155'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61576r925719_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257911.rb" + }, + "title": "RHEL 9 /etc/shadow file must be group-owned by root.", + "desc": "The \"/etc/shadow\" file stores password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/shadow\" file stores password hashes. Protection of this file is critical for system security.", + "check": "Verify the group ownership of the \"/etc/shadow\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/shadow \n\nroot /etc/shadow\n\nIf \"/etc/shadow\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/shadow to root by running the following command:\n\n$ sudo chgrp root /etc/shadow" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61652r925718_chk", + "severity": "medium", + "gid": "V-257911", + "rid": "SV-257911r925720_rule", + "stig_id": "RHEL-09-232155", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61576r925719_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257912", + "code": "control 'SV-257912' do\n title 'RHEL 9 /etc/shadow- file must be owned by root.'\n desc 'The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify the ownership of the \"/etc/shadow-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/shadow- \n\nroot /etc/shadow- \n\nIf \"/etc/shadow-\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Change the owner of the file /etc/shadow- to root by running the following command:\n\n$ sudo chown root /etc/shadow-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61653r925721_chk'\n tag severity: 'medium'\n tag gid: 'V-257912'\n tag rid: 'SV-257912r925723_rule'\n tag stig_id: 'RHEL-09-232160'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61577r925722_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257912.rb" + }, + "title": "RHEL 9 /etc/shadow- file must be owned by root.", + "desc": "The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.", + "check": "Verify the ownership of the \"/etc/shadow-\" file with the following command:\n\n$ sudo stat -c \"%U %n\" /etc/shadow- \n\nroot /etc/shadow- \n\nIf \"/etc/shadow-\" file does not have an owner of \"root\", this is a finding.", + "fix": "Change the owner of the file /etc/shadow- to root by running the following command:\n\n$ sudo chown root /etc/shadow-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61653r925721_chk", + "severity": "medium", + "gid": "V-257912", + "rid": "SV-257912r925723_rule", + "stig_id": "RHEL-09-232160", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61577r925722_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257913", + "code": "control 'SV-257913' do\n title 'RHEL 9 /etc/shadow- file must be group-owned by root.'\n desc 'The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.'\n desc 'check', 'Verify the group ownership of the \"/etc/shadow-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/shadow-\n\nroot /etc/shadow-\n\nIf \"/etc/shadow-\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Change the group of the file /etc/shadow- to root by running the following command:\n\n$ sudo chgrp root /etc/shadow-'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61654r925724_chk'\n tag severity: 'medium'\n tag gid: 'V-257913'\n tag rid: 'SV-257913r925726_rule'\n tag stig_id: 'RHEL-09-232165'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61578r925725_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257913.rb" + }, + "title": "RHEL 9 /etc/shadow- file must be group-owned by root.", + "desc": "The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.", + "descriptions": { + "default": "The \"/etc/shadow-\" file is a backup file of \"/etc/shadow\", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.", + "check": "Verify the group ownership of the \"/etc/shadow-\" file with the following command:\n\n$ sudo stat -c \"%G %n\" /etc/shadow-\n\nroot /etc/shadow-\n\nIf \"/etc/shadow-\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Change the group of the file /etc/shadow- to root by running the following command:\n\n$ sudo chgrp root /etc/shadow-" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61654r925724_chk", + "severity": "medium", + "gid": "V-257913", + "rid": "SV-257913r925726_rule", + "stig_id": "RHEL-09-232165", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61578r925725_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257914", + "code": "control 'SV-257914' do\n title 'The RHEL 8 /var/log directory must be owned by root.'\n desc \"Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.\"\n desc 'check', 'Verify the /var/log directory is owned by root with the following command:\n\n$ sudo stat -c \"%U\" /var/log\n\nroot\n\nIf \"root\" is not returned as a result, this is a finding.'\n desc 'fix', 'Change the owner of the directory /var/log to root by running the following\ncommand:\n\n $ sudo chown root /var/log'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-230249'\n tag rid: 'SV-257914r627750_rule'\n tag stig_id: 'RHEL-08-010250'\n tag fix_id: 'F-32893r567494_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n tag 'container'\n\n describe directory('/var/log') do\n it { should exist }\n it { should be_owned_by 'root' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257914.rb" + }, + "title": "The RHEL 8 /var/log directory must be owned by root.", + "desc": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "descriptions": { + "default": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "check": "Verify the /var/log directory is owned by root with the following command:\n\n$ sudo stat -c \"%U\" /var/log\n\nroot\n\nIf \"root\" is not returned as a result, this is a finding.", + "fix": "Change the owner of the directory /var/log to root by running the following\ncommand:\n\n $ sudo chown root /var/log" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000206-GPOS-00084", + "gid": "V-230249", + "rid": "SV-257914r627750_rule", + "stig_id": "RHEL-08-010250", + "fix_id": "F-32893r567494_fix", + "cci": [ + "CCI-001314" + ], + "nist": [ + "SI-11 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257915", + "code": "control 'SV-257915' do\n title 'The RHEL 8 /var/log directory must be group-owned by root.'\n desc \"Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.\"\n desc 'check', 'Verify the \"/var/log\" directory is group-owned by root with the following\ncommand:\n\n $ sudo stat -c \"%G\" /var/log\n\n root\n\n If \"root\" is not returned as a result, this is a finding.'\n desc 'fix', 'Change the group of the directory \"/var/log\" to \"root\" by running the\nfollowing command:\n\n $ sudo chgrp root /var/log'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-230250'\n tag rid: 'SV-257915r627750_rule'\n tag stig_id: 'RHEL-08-010260'\n tag fix_id: 'F-32894r567497_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n tag 'container'\n\n describe directory('/var/log') do\n it { should exist }\n its('group') { should eq 'root' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257915.rb" + }, + "title": "The RHEL 8 /var/log directory must be group-owned by root.", + "desc": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "descriptions": { + "default": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "check": "Verify the \"/var/log\" directory is group-owned by root with the following\ncommand:\n\n $ sudo stat -c \"%G\" /var/log\n\n root\n\n If \"root\" is not returned as a result, this is a finding.", + "fix": "Change the group of the directory \"/var/log\" to \"root\" by running the\nfollowing command:\n\n $ sudo chgrp root /var/log" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000206-GPOS-00084", + "gid": "V-230250", + "rid": "SV-257915r627750_rule", + "stig_id": "RHEL-08-010260", + "fix_id": "F-32894r567497_fix", + "cci": [ + "CCI-001314" + ], + "nist": [ + "SI-11 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257916", + "code": "control 'SV-257916' do\n title 'The RHEL 8 /var/log/messages file must be owned by root.'\n desc \"Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.\"\n desc 'check', 'Verify that the /var/log/messages file is owned by root with the following\ncommand:\n\n $ sudo stat -c \"%U\" /var/log/messages\n\n root\n\n If \"root\" is not returned as a result, this is a finding.'\n desc 'fix', 'Change the owner of the file /var/log/messages to root by running the\nfollowing command:\n\n $ sudo chown root /var/log/messages'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-230246'\n tag rid: 'SV-257916r627750_rule'\n tag stig_id: 'RHEL-08-010220'\n tag fix_id: 'F-32890r567485_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe.one do\n describe file('/var/log/messages') do\n it { should be_owned_by 'root' }\n end\n describe file('/var/log/messages') do\n it { should_not exist }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257916.rb" + }, + "title": "The RHEL 8 /var/log/messages file must be owned by root.", + "desc": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "descriptions": { + "default": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "check": "Verify that the /var/log/messages file is owned by root with the following\ncommand:\n\n $ sudo stat -c \"%U\" /var/log/messages\n\n root\n\n If \"root\" is not returned as a result, this is a finding.", + "fix": "Change the owner of the file /var/log/messages to root by running the\nfollowing command:\n\n $ sudo chown root /var/log/messages" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000206-GPOS-00084", + "gid": "V-230246", + "rid": "SV-257916r627750_rule", + "stig_id": "RHEL-08-010220", + "fix_id": "F-32890r567485_fix", + "cci": [ + "CCI-001314" + ], + "nist": [ + "SI-11 b" + ], + "host": null + } + }, + { + "id": "SV-257917", + "code": "control 'SV-257917' do\n title 'The RHEL 8 /var/log/messages file must be group-owned by root.'\n desc \"Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.\"\n desc 'check', 'Verify the \"/var/log/messages\" file is group-owned by root with the\nfollowing command:\n\n $ sudo stat -c \"%G\" /var/log/messages\n\n root\n\n If \"root\" is not returned as a result, this is a finding.'\n desc 'fix', 'Change the group of the file \"/var/log/messages\" to \"root\" by running\nthe following command:\n\n $ sudo chgrp root /var/log/messages'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-230247'\n tag rid: 'SV-257917r627750_rule'\n tag stig_id: 'RHEL-08-010230'\n tag fix_id: 'F-32891r567488_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe.one do\n describe file('/var/log/messages') do\n its('group') { should be_in input('var_log_messages_group') }\n end\n describe file('/var/log/messages') do\n it { should_not exist }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257917.rb" + }, + "title": "The RHEL 8 /var/log/messages file must be group-owned by root.", + "desc": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "descriptions": { + "default": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "check": "Verify the \"/var/log/messages\" file is group-owned by root with the\nfollowing command:\n\n $ sudo stat -c \"%G\" /var/log/messages\n\n root\n\n If \"root\" is not returned as a result, this is a finding.", + "fix": "Change the group of the file \"/var/log/messages\" to \"root\" by running\nthe following command:\n\n $ sudo chgrp root /var/log/messages" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000206-GPOS-00084", + "gid": "V-230247", + "rid": "SV-257917r627750_rule", + "stig_id": "RHEL-08-010230", + "fix_id": "F-32891r567488_fix", + "cci": [ + "CCI-001314" + ], + "nist": [ + "SI-11 b" + ], + "host": null + } + }, + { + "id": "SV-257918", + "code": "control 'SV-257918' do\n title 'RHEL 8 system commands must be owned by root.'\n desc 'If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.'\n desc 'check', 'Verify the system commands contained in the following directories are owned\nby \"root\" with the following command:\n\n $ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin\n! -user root -exec ls -l {} \\\\;\n\n If any system commands are returned, this is a finding.'\n desc 'fix', 'Configure the system commands to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any system command\nfile not owned by \"root\".\n\n $ sudo chown root [FILE]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-230258'\n tag rid: 'SV-257918r627750_rule'\n tag stig_id: 'RHEL-08-010310'\n tag fix_id: 'F-32902r567521_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_command_dirs').join(' ')} ! -user root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System commands' do\n it 'should be owned by root' do\n expect(failing_files).to be_empty, \"Files not owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257918.rb" + }, + "title": "RHEL 8 system commands must be owned by root.", + "desc": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "check": "Verify the system commands contained in the following directories are owned\nby \"root\" with the following command:\n\n $ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin\n! -user root -exec ls -l {} \\;\n\n If any system commands are returned, this is a finding.", + "fix": "Configure the system commands to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any system command\nfile not owned by \"root\".\n\n $ sudo chown root [FILE]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000259-GPOS-00100", + "gid": "V-230258", + "rid": "SV-257918r627750_rule", + "stig_id": "RHEL-08-010310", + "fix_id": "F-32902r567521_fix", + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257919", + "code": "control 'SV-257919' do\n title 'RHEL 8 system commands must be group-owned by root or a system\naccount.'\n desc 'If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.'\n desc 'check', 'Verify the system commands contained in the following directories are group-owned by \"root\", or a required system account, with the following command:\n\n$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -exec ls -l {} \\\\;\n\nIf any system commands are returned and is not group-owned by a required system account, this is a finding.'\n desc 'fix', 'Configure the system commands to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any system command\nfile not group-owned by \"root\" or a required system account.\n\n $ sudo chgrp root [FILE]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-230259'\n tag rid: 'SV-257919r792864_rule'\n tag stig_id: 'RHEL-08-010320'\n tag fix_id: 'F-32903r567524_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_command_dirs').join(' ')} ! -group root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System commands' do\n it 'should be group-owned by root' do\n expect(failing_files).to be_empty, \"Files not group-owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257919.rb" + }, + "title": "RHEL 8 system commands must be group-owned by root or a system\naccount.", + "desc": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "check": "Verify the system commands contained in the following directories are group-owned by \"root\", or a required system account, with the following command:\n\n$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -exec ls -l {} \\;\n\nIf any system commands are returned and is not group-owned by a required system account, this is a finding.", + "fix": "Configure the system commands to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any system command\nfile not group-owned by \"root\" or a required system account.\n\n $ sudo chgrp root [FILE]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000259-GPOS-00100", + "gid": "V-230259", + "rid": "SV-257919r792864_rule", + "stig_id": "RHEL-08-010320", + "fix_id": "F-32903r567524_fix", + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257920", + "code": "control 'SV-257920' do\n title 'RHEL 8 library files must be owned by root.'\n desc 'If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.'\n desc 'check', 'Verify the system-wide shared library files are owned by \"root\" with the\nfollowing command:\n\n $ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -user root -exec ls -l {}\n\\\\;\n\n If any system wide shared library file is returned, this is a finding.'\n desc 'fix', 'Configure the system-wide shared library files (/lib, /lib64, /usr/lib and\n/usr/lib64) to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any library file not\nowned by \"root\".\n\n $ sudo chown root [FILE]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-230261'\n tag rid: 'SV-257920r627750_rule'\n tag stig_id: 'RHEL-08-010340'\n tag fix_id: 'F-32905r567530_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_libraries').join(' ')} ! -user root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System libraries' do\n it 'should be owned by root' do\n expect(failing_files).to be_empty, \"Files not owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257920.rb" + }, + "title": "RHEL 8 library files must be owned by root.", + "desc": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "check": "Verify the system-wide shared library files are owned by \"root\" with the\nfollowing command:\n\n $ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -user root -exec ls -l {}\n\\;\n\n If any system wide shared library file is returned, this is a finding.", + "fix": "Configure the system-wide shared library files (/lib, /lib64, /usr/lib and\n/usr/lib64) to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any library file not\nowned by \"root\".\n\n $ sudo chown root [FILE]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000259-GPOS-00100", + "gid": "V-230261", + "rid": "SV-257920r627750_rule", + "stig_id": "RHEL-08-010340", + "fix_id": "F-32905r567530_fix", + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257921", + "code": "control 'SV-257921' do\n title 'RHEL 8 library files must be group-owned by root or a system account.'\n desc 'If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.'\n desc 'check', 'Verify the system-wide shared library files are group-owned by \"root\"\nwith the following command:\n\n $ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -group root -exec ls -l {}\n\\\\;\n\n If any system wide shared library file is returned and is not group-owned\nby a required system account, this is a finding.'\n desc 'fix', 'Configure the system-wide shared library files (/lib, /lib64, /usr/lib and\n/usr/lib64) to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any library file not\ngroup-owned by \"root\".\n\n $ sudo chgrp root [FILE]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-230262'\n tag rid: 'SV-257921r627750_rule'\n tag stig_id: 'RHEL-08-010350'\n tag fix_id: 'F-32906r567533_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_libraries').join(' ')} ! -group root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System libraries' do\n it 'should be group-owned by root' do\n expect(failing_files).to be_empty, \"Files not group-owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257921.rb" + }, + "title": "RHEL 8 library files must be group-owned by root or a system account.", + "desc": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software\nlibraries, then those changes might be implemented without undergoing the\nappropriate testing and approvals that are part of a robust change management\nprocess.\n\n This requirement applies to RHEL 8 with software libraries that are\naccessible and configurable, as in the case of interpreted languages. Software\nlibraries also include privileged programs that execute with escalated\nprivileges. Only qualified and authorized individuals will be allowed to obtain\naccess to information system components for purposes of initiating changes,\nincluding upgrades and modifications.", + "check": "Verify the system-wide shared library files are group-owned by \"root\"\nwith the following command:\n\n $ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -group root -exec ls -l {}\n\\;\n\n If any system wide shared library file is returned and is not group-owned\nby a required system account, this is a finding.", + "fix": "Configure the system-wide shared library files (/lib, /lib64, /usr/lib and\n/usr/lib64) to be protected from unauthorized access.\n\n Run the following command, replacing \"[FILE]\" with any library file not\ngroup-owned by \"root\".\n\n $ sudo chgrp root [FILE]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000259-GPOS-00100", + "gid": "V-230262", + "rid": "SV-257921r627750_rule", + "stig_id": "RHEL-08-010350", + "fix_id": "F-32906r567533_fix", + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257922", + "code": "control 'SV-257922' do\n title 'RHEL 8 library directories must be owned by root.'\n desc 'If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the system-wide shared library directories are owned by \"root\" with\nthe following command:\n\n$ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -user root -type d -exec stat -c \"%n %U\" '{}' \\;\n\nIf any system-wide shared library directory is returned, this is a finding.)\n desc 'fix', 'Configure the system-wide shared library directories within (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. Run the following command, replacing \"[DIRECTORY]\" with any library directory not owned by \"root\".\n\n $ sudo chown root [DIRECTORY]'\n impact 0.5\n tag check_id: 'C-55145r810011_chk'\n tag severity: 'medium'\n tag gid: 'V-251708'\n tag rid: 'SV-257922r810012_rule'\n tag stig_id: 'RHEL-08-010341'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag fix_id: 'F-55099r809347_fix'\n tag 'documentable'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n non_root_owned_libs = input('system_libraries').reject { |lib| file(lib).owned_by?('root') }\n\n describe 'System libraries' do\n it 'should be owned by root' do\n fail_msg = \"Libs not owned by root:\\n\\t- #{non_root_owned_libs.join(\"\\n\\t- \")}\"\n expect(non_root_owned_libs).to be_empty, fail_msg\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257922.rb" + }, + "title": "RHEL 8 library directories must be owned by root.", + "desc": "If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.", + "check": "Verify the system-wide shared library directories are owned by \"root\" with\nthe following command:\n\n$ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -user root -type d -exec stat -c \"%n %U\" '{}' \\;\n\nIf any system-wide shared library directory is returned, this is a finding.", + "fix": "Configure the system-wide shared library directories within (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. Run the following command, replacing \"[DIRECTORY]\" with any library directory not owned by \"root\".\n\n $ sudo chown root [DIRECTORY]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-55145r810011_chk", + "severity": "medium", + "gid": "V-251708", + "rid": "SV-257922r810012_rule", + "stig_id": "RHEL-08-010341", + "gtitle": "SRG-OS-000259-GPOS-00100", + "fix_id": "F-55099r809347_fix", + "documentable": null, + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257923", + "code": "control 'SV-257923' do\n title 'RHEL 8 library directories must be group-owned by root or a system account.'\n desc 'If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the system-wide shared library directories are group-owned\n by \"root\" with the following command:\n\n $ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -group root -type d -exec stat -c \"%n %G\" '{}' \\;\n\n If any system-wide shared library directory is returned and is not group-owned\n by a required system account, this is a finding.)\n desc 'fix', 'Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. Run the following command, replacing \"[DIRECTORY]\" with any library directory not group-owned by \"root\". $ sudo chgrp root [DIRECTORY]'\n impact 0.5\n tag check_id: 'C-55146r810013_chk'\n tag severity: 'medium'\n tag gid: 'V-251709'\n tag rid: 'SV-257923r810014_rule'\n tag stig_id: 'RHEL-08-010351'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag fix_id: 'F-55100r809350_fix'\n tag 'documentable'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n non_root_owned_libs = input('system_libraries').filter { |lib|\n !input('required_system_accounts').include?(file(lib).group)\n }\n\n describe 'System libraries' do\n it 'should be owned by a required system account' do\n fail_msg = \"Libs not group-owned by a system account:\\n\\t- #{non_root_owned_libs.join(\"\\n\\t- \")}\"\n expect(non_root_owned_libs).to be_empty, fail_msg\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257923.rb" + }, + "title": "RHEL 8 library directories must be group-owned by root or a system account.", + "desc": "If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.", + "descriptions": { + "default": "If RHEL 8 were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. This requirement applies to RHEL 8 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals will be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.", + "check": "Verify the system-wide shared library directories are group-owned\n by \"root\" with the following command:\n\n $ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -group root -type d -exec stat -c \"%n %G\" '{}' \\;\n\n If any system-wide shared library directory is returned and is not group-owned\n by a required system account, this is a finding.", + "fix": "Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. Run the following command, replacing \"[DIRECTORY]\" with any library directory not group-owned by \"root\". $ sudo chgrp root [DIRECTORY]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-55146r810013_chk", + "severity": "medium", + "gid": "V-251709", + "rid": "SV-257923r810014_rule", + "stig_id": "RHEL-08-010351", + "gtitle": "SRG-OS-000259-GPOS-00100", + "fix_id": "F-55100r809350_fix", + "documentable": null, + "cci": [ + "CCI-001499" + ], + "nist": [ + "CM-5 (6)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257924", + "code": "control 'SV-257924' do\n title 'RHEL 8 audit tools must be owned by root.'\n desc 'Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.'\n desc 'check', 'Verify the audit tools are owned by \"root\" to prevent any unauthorized\naccess, deletion, or modification.\n\n Check the owner of each audit tool by running the following command:\n\n $ sudo stat -c \"%U %n\" /sbin/auditctl /sbin/aureport /sbin/ausearch\n/sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules\n\n root /sbin/auditctl\n root /sbin/aureport\n root /sbin/ausearch\n root /sbin/autrace\n root /sbin/auditd\n root /sbin/rsyslogd\n root /sbin/augenrules\n\n If any of the audit tools are not owned by \"root\", this is a finding.'\n desc 'fix', 'Configure the audit tools to be owned by \"root\", by running the following\ncommand:\n\n $ sudo chown root [audit_tool]\n\n Replace \"[audit_tool]\" with each audit tool not owned by \"root\".'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000256-GPOS-00097'\n tag satisfies: ['SRG-OS-000256-GPOS-00097', 'SRG-OS-000257-GPOS-00098', 'SRG-OS-000258-GPOS-00099']\n tag gid: 'V-230473'\n tag rid: 'SV-257924r744008_rule'\n tag stig_id: 'RHEL-08-030630'\n tag fix_id: 'F-33117r568166_fix'\n tag cci: ['CCI-001493']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_tools = ['/sbin/auditctl', '/sbin/aureport', '/sbin/ausearch', '/sbin/autrace', '/sbin/auditd', '/sbin/rsyslogd', '/sbin/augenrules']\n\n failing_tools = audit_tools.reject { |at| file(at).owned_by?('root') }\n\n describe 'Audit executables' do\n it 'should be owned by root' do\n expect(failing_tools).to be_empty, \"Failing tools:\\n\\t- #{failing_tools.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257924.rb" + }, + "title": "RHEL 8 audit tools must be owned by root.", + "desc": "Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.", + "descriptions": { + "default": "Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.", + "check": "Verify the audit tools are owned by \"root\" to prevent any unauthorized\naccess, deletion, or modification.\n\n Check the owner of each audit tool by running the following command:\n\n $ sudo stat -c \"%U %n\" /sbin/auditctl /sbin/aureport /sbin/ausearch\n/sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules\n\n root /sbin/auditctl\n root /sbin/aureport\n root /sbin/ausearch\n root /sbin/autrace\n root /sbin/auditd\n root /sbin/rsyslogd\n root /sbin/augenrules\n\n If any of the audit tools are not owned by \"root\", this is a finding.", + "fix": "Configure the audit tools to be owned by \"root\", by running the following\ncommand:\n\n $ sudo chown root [audit_tool]\n\n Replace \"[audit_tool]\" with each audit tool not owned by \"root\"." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000256-GPOS-00097", + "satisfies": [ + "SRG-OS-000256-GPOS-00097", + "SRG-OS-000257-GPOS-00098", + "SRG-OS-000258-GPOS-00099" + ], + "gid": "V-230473", + "rid": "SV-257924r744008_rule", + "stig_id": "RHEL-08-030630", + "fix_id": "F-33117r568166_fix", + "cci": [ + "CCI-001493" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-257925", + "code": "control 'SV-257925' do\n title 'RHEL 8 audit tools must be group-owned by root.'\n desc 'Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.'\n desc 'check', 'Verify the audit tools are group-owned by \"root\" to prevent any\nunauthorized access, deletion, or modification.\n\n Check the owner of each audit tool by running the following commands:\n\n $ sudo stat -c \"%G %n\" /sbin/auditctl /sbin/aureport /sbin/ausearch\n/sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules\n\n root /sbin/auditctl\n root /sbin/aureport\n root /sbin/ausearch\n root /sbin/autrace\n root /sbin/auditd\n root /sbin/rsyslogd\n root /sbin/augenrules\n\n If any of the audit tools are not group-owned by \"root\", this is a\nfinding.'\n desc 'fix', 'Configure the audit tools to be group-owned by \"root\", by running the\nfollowing command:\n\n $ sudo chgrp root [audit_tool]\n\n Replace \"[audit_tool]\" with each audit tool not group-owned by \"root\".'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000256-GPOS-00097'\n tag satisfies: ['SRG-OS-000256-GPOS-00097', 'SRG-OS-000257-GPOS-00098', 'SRG-OS-000258-GPOS-00099']\n tag gid: 'V-230474'\n tag rid: 'SV-257925r627750_rule'\n tag stig_id: 'RHEL-08-030640'\n tag fix_id: 'F-33118r568169_fix'\n tag cci: ['CCI-001493']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_tools = ['/sbin/auditctl', '/sbin/aureport', '/sbin/ausearch', '/sbin/autrace', '/sbin/auditd', '/sbin/rsyslogd', '/sbin/augenrules']\n\n failing_tools = audit_tools.reject { |at| file(at).group == 'root' }\n\n describe 'Audit executables' do\n it 'should be group owned by root' do\n expect(failing_tools).to be_empty, \"Failing tools:\\n\\t- #{failing_tools.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257925.rb" + }, + "title": "RHEL 8 audit tools must be group-owned by root.", + "desc": "Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.", + "descriptions": { + "default": "Protecting audit information also includes identifying and protecting\nthe tools used to view and manipulate log data. Therefore, protecting audit\ntools is necessary to prevent unauthorized operation on audit information.\n\n RHEL 8 systems providing tools to interface with audit information will\nleverage user permissions and roles identifying the user accessing the tools,\nand the corresponding rights the user enjoys, to make access decisions\nregarding the access to audit tools.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.", + "check": "Verify the audit tools are group-owned by \"root\" to prevent any\nunauthorized access, deletion, or modification.\n\n Check the owner of each audit tool by running the following commands:\n\n $ sudo stat -c \"%G %n\" /sbin/auditctl /sbin/aureport /sbin/ausearch\n/sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules\n\n root /sbin/auditctl\n root /sbin/aureport\n root /sbin/ausearch\n root /sbin/autrace\n root /sbin/auditd\n root /sbin/rsyslogd\n root /sbin/augenrules\n\n If any of the audit tools are not group-owned by \"root\", this is a\nfinding.", + "fix": "Configure the audit tools to be group-owned by \"root\", by running the\nfollowing command:\n\n $ sudo chgrp root [audit_tool]\n\n Replace \"[audit_tool]\" with each audit tool not group-owned by \"root\"." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000256-GPOS-00097", + "satisfies": [ + "SRG-OS-000256-GPOS-00097", + "SRG-OS-000257-GPOS-00098", + "SRG-OS-000258-GPOS-00099" + ], + "gid": "V-230474", + "rid": "SV-257925r627750_rule", + "stig_id": "RHEL-08-030640", + "fix_id": "F-33118r568169_fix", + "cci": [ + "CCI-001493" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-257926", + "code": "control 'SV-257926' do\n title 'RHEL 9 cron configuration files directory must be owned by root.'\n desc 'Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.'\n desc 'check', 'Verify the ownership of all cron configuration files with the command:\n\n$ stat -c \"%U %n\" /etc/cron*\n\nroot /etc/cron.d\nroot /etc/cron.daily\nroot /etc/cron.deny\nroot /etc/cron.hourly\nroot /etc/cron.monthly\nroot /etc/crontab\nroot /etc/cron.weekly\n\nIf any crontab is not owned by root, this is a finding.'\n desc 'fix', 'Configure any cron configuration not owned by root with the following command:\n\n$ sudo chown root [cron config file]'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61667r925763_chk'\n tag severity: 'medium'\n tag gid: 'V-257926'\n tag rid: 'SV-257926r925765_rule'\n tag stig_id: 'RHEL-09-232230'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61591r925764_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257926.rb" + }, + "title": "RHEL 9 cron configuration files directory must be owned by root.", + "desc": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.", + "descriptions": { + "default": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.", + "check": "Verify the ownership of all cron configuration files with the command:\n\n$ stat -c \"%U %n\" /etc/cron*\n\nroot /etc/cron.d\nroot /etc/cron.daily\nroot /etc/cron.deny\nroot /etc/cron.hourly\nroot /etc/cron.monthly\nroot /etc/crontab\nroot /etc/cron.weekly\n\nIf any crontab is not owned by root, this is a finding.", + "fix": "Configure any cron configuration not owned by root with the following command:\n\n$ sudo chown root [cron config file]" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61667r925763_chk", + "severity": "medium", + "gid": "V-257926", + "rid": "SV-257926r925765_rule", + "stig_id": "RHEL-09-232230", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61591r925764_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257927", + "code": "control 'SV-257927' do\n title 'RHEL 9 cron configuration files directory must be group-owned by root.'\n desc 'Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.'\n desc 'check', 'Verify the group ownership of all cron configuration files with the following command:\n\n$ stat -c \"%G %n\" /etc/cron*\n\nroot /etc/cron.d\nroot /etc/cron.daily\nroot /etc/cron.deny\nroot /etc/cron.hourly\nroot /etc/cron.monthly\nroot /etc/crontab\nroot /etc/cron.weekly\n\nIf any crontab is not group owned by root, this is a finding.'\n desc 'fix', 'Configure any cron configuration not group-owned by root with the following command:\n\n$ sudo chgrp root [cron config file]'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61668r925766_chk'\n tag severity: 'medium'\n tag gid: 'V-257927'\n tag rid: 'SV-257927r925768_rule'\n tag stig_id: 'RHEL-09-232235'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61592r925767_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257927.rb" + }, + "title": "RHEL 9 cron configuration files directory must be group-owned by root.", + "desc": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.", + "descriptions": { + "default": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.", + "check": "Verify the group ownership of all cron configuration files with the following command:\n\n$ stat -c \"%G %n\" /etc/cron*\n\nroot /etc/cron.d\nroot /etc/cron.daily\nroot /etc/cron.deny\nroot /etc/cron.hourly\nroot /etc/cron.monthly\nroot /etc/crontab\nroot /etc/cron.weekly\n\nIf any crontab is not group owned by root, this is a finding.", + "fix": "Configure any cron configuration not group-owned by root with the following command:\n\n$ sudo chgrp root [cron config file]" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61668r925766_chk", + "severity": "medium", + "gid": "V-257927", + "rid": "SV-257927r925768_rule", + "stig_id": "RHEL-09-232235", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61592r925767_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257928", + "code": "control 'SV-257928' do\n title 'All RHEL 8 world-writable directories must be owned by root, sys, bin,\nor an application user.'\n desc 'If a world-writable directory is not owned by root, sys, bin, or an\napplication User Identifier (UID), unauthorized users may be able to modify\nfiles created by others.\n\n The only authorized public directories are those temporary directories\nsupplied with the system or those designed to be temporary file repositories.\nThe setting is normally reserved for directories used by the system and by\nusers for temporary file storage, (e.g., /tmp), and for directories requiring\nglobal read/write access.'\n desc 'check', 'The following command will discover and print world-writable directories\nthat are not owned by a system account, given the assumption that only system\naccounts have a uid lower than 1000. Run it once for each local partition\n[PART]:\n\n $ sudo find [PART] -xdev -type d -perm -0002 -uid +999 -print\n\n If there is output, this is a finding.'\n desc 'fix', 'All directories in local partitions which are world-writable\nshould be owned by root or another system account. If any world-writable\ndirectories are not owned by a system account, this should be investigated.\nFollowing this, the files should be deleted or assigned to an appropriate\ngroup.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230318'\n tag rid: 'SV-257928r743960_rule'\n tag stig_id: 'RHEL-08-010700'\n tag fix_id: 'F-32962r567701_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n partitions = etc_fstab.params.map { |partition| partition['mount_point'] }.uniq\n\n cmd = \"find #{partitions.join(' ')} -xdev -type d -perm -0002 -uid +999 -print\"\n failing_dirs = command(cmd).stdout.split(\"\\n\").uniq\n\n describe 'Any world-writeable directories' do\n it 'should be owned by system accounts' do\n expect(failing_dirs).to be_empty, \"Failing directories:\\n\\t- #{failing_dirs.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257928.rb" + }, + "title": "All RHEL 8 world-writable directories must be owned by root, sys, bin,\nor an application user.", + "desc": "If a world-writable directory is not owned by root, sys, bin, or an\napplication User Identifier (UID), unauthorized users may be able to modify\nfiles created by others.\n\n The only authorized public directories are those temporary directories\nsupplied with the system or those designed to be temporary file repositories.\nThe setting is normally reserved for directories used by the system and by\nusers for temporary file storage, (e.g., /tmp), and for directories requiring\nglobal read/write access.", + "descriptions": { + "default": "If a world-writable directory is not owned by root, sys, bin, or an\napplication User Identifier (UID), unauthorized users may be able to modify\nfiles created by others.\n\n The only authorized public directories are those temporary directories\nsupplied with the system or those designed to be temporary file repositories.\nThe setting is normally reserved for directories used by the system and by\nusers for temporary file storage, (e.g., /tmp), and for directories requiring\nglobal read/write access.", + "check": "The following command will discover and print world-writable directories\nthat are not owned by a system account, given the assumption that only system\naccounts have a uid lower than 1000. Run it once for each local partition\n[PART]:\n\n $ sudo find [PART] -xdev -type d -perm -0002 -uid +999 -print\n\n If there is output, this is a finding.", + "fix": "All directories in local partitions which are world-writable\nshould be owned by root or another system account. If any world-writable\ndirectories are not owned by a system account, this should be investigated.\nFollowing this, the files should be deleted or assigned to an appropriate\ngroup." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230318", + "rid": "SV-257928r743960_rule", + "stig_id": "RHEL-08-010700", + "fix_id": "F-32962r567701_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257929", + "code": "control 'SV-257929' do\n title 'A sticky bit must be set on all RHEL 8 public directories to prevent\nunauthorized and unintended information transferred via shared system\nresources.'\n desc 'Preventing unauthorized information transfers mitigates the risk of\ninformation, including encrypted representations of information, produced by\nthe actions of prior users/roles (or the actions of processes acting on behalf\nof prior users/roles) from being available to any current users/roles (or\ncurrent processes) that obtain access to shared system resources (e.g.,\nregisters, main memory, hard disks) after those resources have been released\nback to information systems. The control of information in shared resources is\nalso commonly referred to as object reuse and residual information protection.\n\n This requirement generally applies to the design of an information\ntechnology product, but it can also apply to the configuration of particular\ninformation system components that are, or use, such products. This can be\nverified by acceptance/validation processes in DoD or other government agencies.\n\n There may be shared resources with configurable protections (e.g., files in\nstorage) that may be assessed on specific information system components.'\n desc 'check', 'Verify that all world-writable directories have the sticky bit set.\n\nCheck to see that all world-writable directories have the sticky bit set by running the following command:\n\n$ sudo find / -type d \\\\( -perm -0002 -a ! -perm -1000 \\\\) -print 2>/dev/null\n\ndrwxrwxrwt 7 root root 4096 Jul 26 11:19 /tmp\n\nIf any of the returned directories are world-writable and do not have the sticky bit set, this is a finding.'\n desc 'fix', 'Configure all world-writable directories to have the sticky bit set to\nprevent unauthorized and unintended information transferred via shared system\nresources.\n\n Set the sticky bit on all world-writable directories using the command,\nreplace \"[World-Writable Directory]\" with any directory path missing the\nsticky bit:\n\n $ sudo chmod 1777 [World-Writable Directory]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000138-GPOS-00069'\n tag gid: 'V-230243'\n tag rid: 'SV-257929r792857_rule'\n tag stig_id: 'RHEL-08-010190'\n tag fix_id: 'F-32887r567476_fix'\n tag cci: ['CCI-001090']\n tag nist: ['SC-4']\n tag 'host'\n tag 'container'\n\n partitions = etc_fstab.params.map { |partition| partition['mount_point'] }.uniq\n\n ww_dirs = command(\"find #{partitions} -type d \\\\( -perm -0002 -a ! -perm -1000 \\\\) -print 2>/dev/null\").stdout.split(\"\\n\")\n\n if ww_dirs.empty?\n describe 'List of world-writable directories on the target' do\n subject { ww_dirs }\n it { should be_empty }\n end\n else\n non_sticky_ww_dirs = ww_dirs.reject { |dir| file(dir).sticky? }\n describe 'All world-writeable directories' do\n it 'should have the sticky bit set' do\n fail_msg = \"Public directories without sticky bit:\\n\\t- #{non_sticky_ww_dirs.join(\"\\n\\t- \")}\"\n expect(non_sticky_ww_dirs).to be_empty, fail_msg\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257929.rb" + }, + "title": "A sticky bit must be set on all RHEL 8 public directories to prevent\nunauthorized and unintended information transferred via shared system\nresources.", + "desc": "Preventing unauthorized information transfers mitigates the risk of\ninformation, including encrypted representations of information, produced by\nthe actions of prior users/roles (or the actions of processes acting on behalf\nof prior users/roles) from being available to any current users/roles (or\ncurrent processes) that obtain access to shared system resources (e.g.,\nregisters, main memory, hard disks) after those resources have been released\nback to information systems. The control of information in shared resources is\nalso commonly referred to as object reuse and residual information protection.\n\n This requirement generally applies to the design of an information\ntechnology product, but it can also apply to the configuration of particular\ninformation system components that are, or use, such products. This can be\nverified by acceptance/validation processes in DoD or other government agencies.\n\n There may be shared resources with configurable protections (e.g., files in\nstorage) that may be assessed on specific information system components.", + "descriptions": { + "default": "Preventing unauthorized information transfers mitigates the risk of\ninformation, including encrypted representations of information, produced by\nthe actions of prior users/roles (or the actions of processes acting on behalf\nof prior users/roles) from being available to any current users/roles (or\ncurrent processes) that obtain access to shared system resources (e.g.,\nregisters, main memory, hard disks) after those resources have been released\nback to information systems. The control of information in shared resources is\nalso commonly referred to as object reuse and residual information protection.\n\n This requirement generally applies to the design of an information\ntechnology product, but it can also apply to the configuration of particular\ninformation system components that are, or use, such products. This can be\nverified by acceptance/validation processes in DoD or other government agencies.\n\n There may be shared resources with configurable protections (e.g., files in\nstorage) that may be assessed on specific information system components.", + "check": "Verify that all world-writable directories have the sticky bit set.\n\nCheck to see that all world-writable directories have the sticky bit set by running the following command:\n\n$ sudo find / -type d \\( -perm -0002 -a ! -perm -1000 \\) -print 2>/dev/null\n\ndrwxrwxrwt 7 root root 4096 Jul 26 11:19 /tmp\n\nIf any of the returned directories are world-writable and do not have the sticky bit set, this is a finding.", + "fix": "Configure all world-writable directories to have the sticky bit set to\nprevent unauthorized and unintended information transferred via shared system\nresources.\n\n Set the sticky bit on all world-writable directories using the command,\nreplace \"[World-Writable Directory]\" with any directory path missing the\nsticky bit:\n\n $ sudo chmod 1777 [World-Writable Directory]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000138-GPOS-00069", + "gid": "V-230243", + "rid": "SV-257929r792857_rule", + "stig_id": "RHEL-08-010190", + "fix_id": "F-32887r567476_fix", + "cci": [ + "CCI-001090" + ], + "nist": [ + "SC-4" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257930", + "code": "control 'SV-257930' do\n title 'All RHEL 8 local files and directories must have a valid group owner.'\n desc 'Files without a valid group owner may be unintentionally inherited if\na group is assigned the same Group Identifier (GID) as the GID of the files\nwithout a valid group owner.'\n desc 'check', 'Verify all local files and directories on RHEL 8 have a valid group with\nthe following command:\n\n Note: The value after -fstype must be replaced with the filesystem type.\nXFS is used as an example.\n\n $ sudo find / -fstype xfs -nogroup\n\n If any files on the system do not have an assigned group, this is a finding.\n\n Note: Command may produce error messages from the /proc and /sys\ndirectories.'\n desc 'fix', 'Either remove all files and directories from RHEL 8 that do not have a\nvalid group, or assign a valid group to all files and directories on the system\nwith the \"chgrp\" command:\n\n $ sudo chgrp '\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230327'\n tag rid: 'SV-257930r627750_rule'\n tag stig_id: 'RHEL-08-010790'\n tag fix_id: 'F-32971r567728_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if input('disable_slow_controls')\n describe 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute.' do\n skip 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute. You must enable this control for a full accredidation for production.'\n end\n else\n\n failing_files = Set[]\n\n command('grep -v \"nodev\" /proc/filesystems | awk \\'NF{ print $NF }\\'')\n .stdout.strip.split(\"\\n\").each do |fs|\n failing_files += command(\"find / -xdev -xautofs -fstype #{fs} -nogroup\").stdout.strip.split(\"\\n\")\n end\n\n describe 'All files on RHEL 8' do\n it 'should have a group' do\n expect(failing_files).to be_empty, \"Files with no group:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257930.rb" + }, + "title": "All RHEL 8 local files and directories must have a valid group owner.", + "desc": "Files without a valid group owner may be unintentionally inherited if\na group is assigned the same Group Identifier (GID) as the GID of the files\nwithout a valid group owner.", + "descriptions": { + "default": "Files without a valid group owner may be unintentionally inherited if\na group is assigned the same Group Identifier (GID) as the GID of the files\nwithout a valid group owner.", + "check": "Verify all local files and directories on RHEL 8 have a valid group with\nthe following command:\n\n Note: The value after -fstype must be replaced with the filesystem type.\nXFS is used as an example.\n\n $ sudo find / -fstype xfs -nogroup\n\n If any files on the system do not have an assigned group, this is a finding.\n\n Note: Command may produce error messages from the /proc and /sys\ndirectories.", + "fix": "Either remove all files and directories from RHEL 8 that do not have a\nvalid group, or assign a valid group to all files and directories on the system\nwith the \"chgrp\" command:\n\n $ sudo chgrp " + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230327", + "rid": "SV-257930r627750_rule", + "stig_id": "RHEL-08-010790", + "fix_id": "F-32971r567728_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257931", + "code": "control 'SV-257931' do\n title 'All RHEL 8 local files and directories must have a valid owner.'\n desc 'Unowned files and directories may be unintentionally inherited if a\nuser is assigned the same User Identifier \"UID\" as the UID of the un-owned\nfiles.'\n desc 'check', 'Verify all local files and directories on RHEL 8 have a valid owner with\nthe following command:\n\n Note: The value after -fstype must be replaced with the filesystem type.\nXFS is used as an example.\n\n $ sudo find / -fstype xfs -nouser\n\n If any files on the system do not have an assigned owner, this is a finding.\n\n Note: Command may produce error messages from the /proc and /sys\ndirectories.'\n desc 'fix', 'Either remove all files and directories from the system that do not have a\nvalid user, or assign a valid user to all unowned files and directories on RHEL\n8 with the \"chown\" command:\n\n $ sudo chown '\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230326'\n tag rid: 'SV-257931r627750_rule'\n tag stig_id: 'RHEL-08-010780'\n tag fix_id: 'F-32970r567725_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if input('disable_slow_controls')\n describe 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute.' do\n skip 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute. You must enable this control for a full accredidation for production.'\n end\n else\n\n failing_files = Set[]\n\n command('grep -v \"nodev\" /proc/filesystems | awk \\'NF{ print $NF }\\'')\n .stdout.strip.split(\"\\n\").each do |fs|\n failing_files += command(\"find / -xdev -xautofs -fstype #{fs} -nouser\").stdout.strip.split(\"\\n\")\n end\n\n describe 'All files on RHEL 8' do\n it 'should have an owner' do\n expect(failing_files).to be_empty, \"Files with no owner:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257931.rb" + }, + "title": "All RHEL 8 local files and directories must have a valid owner.", + "desc": "Unowned files and directories may be unintentionally inherited if a\nuser is assigned the same User Identifier \"UID\" as the UID of the un-owned\nfiles.", + "descriptions": { + "default": "Unowned files and directories may be unintentionally inherited if a\nuser is assigned the same User Identifier \"UID\" as the UID of the un-owned\nfiles.", + "check": "Verify all local files and directories on RHEL 8 have a valid owner with\nthe following command:\n\n Note: The value after -fstype must be replaced with the filesystem type.\nXFS is used as an example.\n\n $ sudo find / -fstype xfs -nouser\n\n If any files on the system do not have an assigned owner, this is a finding.\n\n Note: Command may produce error messages from the /proc and /sys\ndirectories.", + "fix": "Either remove all files and directories from the system that do not have a\nvalid user, or assign a valid user to all unowned files and directories on RHEL\n8 with the \"chown\" command:\n\n $ sudo chown " + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230326", + "rid": "SV-257931r627750_rule", + "stig_id": "RHEL-08-010780", + "fix_id": "F-32970r567725_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257932", + "code": "control 'SV-257932' do\n title 'RHEL 9 must be configured so that all system device files are correctly labeled to prevent unauthorized modification.'\n desc 'If an unauthorized or modified device is allowed to exist on the system, there is the possibility the system may perform unintended or unauthorized operations.'\n desc 'check', 'Verify that all system device files are correctly labeled to prevent unauthorized modification.\n\nList all device files on the system that are incorrectly labeled with the following commands:\n\nNote: Device files are normally found under \"/dev\", but applications may place device files in other directories and may necessitate a search of the entire system.\n\n# find /dev -context *:device_t:* \\\\( -type c -o -type b \\\\) -printf \"%p %Z\\\\n\"\n\n# find /dev -context *:unlabeled_t:* \\\\( -type c -o -type b \\\\) -printf \"%p %Z\\\\n\"\n\nNote: There are device files, such as \"/dev/vmci\", that are used when the operating system is a host virtual machine. They will not be owned by a user on the system and require the \"device_t\" label to operate. These device files are not a finding.\n\nIf there is output from either of these commands, other than already noted, this is a finding.'\n desc 'fix', 'Restore the SELinux policy for the affected device file from the system policy database using the following command:\n\n$ sudo restorecon -v \n\nSubstituting \"\" with the path to the affected device file (from the output of the previous commands). An example device file path would be \"/dev/ttyUSB0\". If the output of the above command does not indicate that the device was relabeled to a more specific SELinux type label, then the SELinux policy of the system must be updated with more specific policy for the device class specified. If a package was used to install support for a device class, that package could be reinstalled using the following command:\n\n$ sudo dnf reinstall \n\nIf a package was not used to install the SELinux policy for a given device class, then it must be generated manually and provide specific type labels.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61673r925781_chk'\n tag severity: 'medium'\n tag gid: 'V-257932'\n tag rid: 'SV-257932r925783_rule'\n tag stig_id: 'RHEL-09-232260'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61597r925782_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257932.rb" + }, + "title": "RHEL 9 must be configured so that all system device files are correctly labeled to prevent unauthorized modification.", + "desc": "If an unauthorized or modified device is allowed to exist on the system, there is the possibility the system may perform unintended or unauthorized operations.", + "descriptions": { + "default": "If an unauthorized or modified device is allowed to exist on the system, there is the possibility the system may perform unintended or unauthorized operations.", + "check": "Verify that all system device files are correctly labeled to prevent unauthorized modification.\n\nList all device files on the system that are incorrectly labeled with the following commands:\n\nNote: Device files are normally found under \"/dev\", but applications may place device files in other directories and may necessitate a search of the entire system.\n\n# find /dev -context *:device_t:* \\( -type c -o -type b \\) -printf \"%p %Z\\n\"\n\n# find /dev -context *:unlabeled_t:* \\( -type c -o -type b \\) -printf \"%p %Z\\n\"\n\nNote: There are device files, such as \"/dev/vmci\", that are used when the operating system is a host virtual machine. They will not be owned by a user on the system and require the \"device_t\" label to operate. These device files are not a finding.\n\nIf there is output from either of these commands, other than already noted, this is a finding.", + "fix": "Restore the SELinux policy for the affected device file from the system policy database using the following command:\n\n$ sudo restorecon -v \n\nSubstituting \"\" with the path to the affected device file (from the output of the previous commands). An example device file path would be \"/dev/ttyUSB0\". If the output of the above command does not indicate that the device was relabeled to a more specific SELinux type label, then the SELinux policy of the system must be updated with more specific policy for the device class specified. If a package was used to install support for a device class, that package could be reinstalled using the following command:\n\n$ sudo dnf reinstall \n\nIf a package was not used to install the SELinux policy for a given device class, then it must be generated manually and provide specific type labels." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61673r925781_chk", + "severity": "medium", + "gid": "V-257932", + "rid": "SV-257932r925783_rule", + "stig_id": "RHEL-09-232260", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61597r925782_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257933", + "code": "control 'SV-257933' do\n title 'RHEL 9 /etc/crontab file must have mode 0600.'\n desc 'Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must have the correct access rights to prevent unauthorized changes.'\n desc 'check', 'Verify the permissions of /etc/crontab with the following command:\n\n$ stat -c \"%a %n\" /etc/crontab\n\n0600\n\nIf /etc/crontab does not have a mode of \"0600\", this is a finding.'\n desc 'fix', 'Configure the RHEL 9 file /etc/crontab with mode 600.\n\n$ sudo chmod 0600 /etc/crontab'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61674r925784_chk'\n tag severity: 'medium'\n tag gid: 'V-257933'\n tag rid: 'SV-257933r925786_rule'\n tag stig_id: 'RHEL-09-232265'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61598r925785_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257933.rb" + }, + "title": "RHEL 9 /etc/crontab file must have mode 0600.", + "desc": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must have the correct access rights to prevent unauthorized changes.", + "descriptions": { + "default": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must have the correct access rights to prevent unauthorized changes.", + "check": "Verify the permissions of /etc/crontab with the following command:\n\n$ stat -c \"%a %n\" /etc/crontab\n\n0600\n\nIf /etc/crontab does not have a mode of \"0600\", this is a finding.", + "fix": "Configure the RHEL 9 file /etc/crontab with mode 600.\n\n$ sudo chmod 0600 /etc/crontab" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61674r925784_chk", + "severity": "medium", + "gid": "V-257933", + "rid": "SV-257933r925786_rule", + "stig_id": "RHEL-09-232265", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61598r925785_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257934", + "code": "control 'SV-257934' do\n title 'RHEL 9 /etc/shadow file must have mode 0000 to prevent unauthorized access.'\n desc 'The \"/etc/shadow\" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.'\n desc 'check', 'Verify that the \"/etc/shadow\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/shadow\n\n0 /etc/shadow\n\nIf a value of \"0\" is not returned, this is a finding.'\n desc 'fix', 'Change the mode of the file \"/etc/shadow\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/shadow'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61675r925787_chk'\n tag severity: 'medium'\n tag gid: 'V-257934'\n tag rid: 'SV-257934r925789_rule'\n tag stig_id: 'RHEL-09-232270'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61599r925788_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257934.rb" + }, + "title": "RHEL 9 /etc/shadow file must have mode 0000 to prevent unauthorized access.", + "desc": "The \"/etc/shadow\" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.", + "descriptions": { + "default": "The \"/etc/shadow\" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.", + "check": "Verify that the \"/etc/shadow\" file has mode \"0000\" with the following command:\n\n$ sudo stat -c \"%a %n\" /etc/shadow\n\n0 /etc/shadow\n\nIf a value of \"0\" is not returned, this is a finding.", + "fix": "Change the mode of the file \"/etc/shadow\" to \"0000\" by running the following command:\n\n$ sudo chmod 0000 /etc/shadow" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61675r925787_chk", + "severity": "medium", + "gid": "V-257934", + "rid": "SV-257934r925789_rule", + "stig_id": "RHEL-09-232270", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61599r925788_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257935", + "code": "control 'SV-257935' do\n title 'A firewall must be installed on RHEL 8.'\n desc '\"Firewalld\" provides an easy and effective way to block/limit remote\naccess to the system via ports, services, and protocols.\n\n Remote access services, such as those providing remote access to network\ndevices and information systems, which lack automated control capabilities,\nincrease risk and make remote user access management difficult at best.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n\n RHEL 8 functionality (e.g., RDP) must be capable of taking enforcement\naction if the audit reveals unauthorized activity. Automated control of remote\naccess sessions allows organizations to ensure ongoing compliance with remote\naccess policies by enforcing connection rules of remote access applications on\na variety of information system components (e.g., servers, workstations,\nnotebook computers, smartphones, and tablets).'\n desc 'check', 'Verify that \"firewalld\" is installed with the following commands:\n\n $ sudo yum list installed firewalld\n\n firewalld.noarch 0.7.0-5.el8\n\n If the \"firewalld\" package is not installed, ask the System Administrator\nif another firewall is installed. If no firewall is installed this is a finding.'\n desc 'fix', 'Install \"firewalld\" with the following command:\n\n$ sudo yum install firewalld.noarch'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000297-GPOS-00115'\n tag gid: 'V-230505'\n tag rid: 'SV-257935r854048_rule'\n tag stig_id: 'RHEL-08-040100'\n tag fix_id: 'F-33149r744019_fix'\n tag cci: ['CCI-002314']\n tag nist: ['AC-17 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n alternate_firewall_tool = input('alternate_firewall_tool')\n\n if alternate_firewall_tool != ''\n describe package(alternate_firewall_tool) do\n it { should be_installed }\n end\n else\n describe package('firewalld') do\n it { should be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257935.rb" + }, + "title": "A firewall must be installed on RHEL 8.", + "desc": "\"Firewalld\" provides an easy and effective way to block/limit remote\naccess to the system via ports, services, and protocols.\n\n Remote access services, such as those providing remote access to network\ndevices and information systems, which lack automated control capabilities,\nincrease risk and make remote user access management difficult at best.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n\n RHEL 8 functionality (e.g., RDP) must be capable of taking enforcement\naction if the audit reveals unauthorized activity. Automated control of remote\naccess sessions allows organizations to ensure ongoing compliance with remote\naccess policies by enforcing connection rules of remote access applications on\na variety of information system components (e.g., servers, workstations,\nnotebook computers, smartphones, and tablets).", + "descriptions": { + "default": "\"Firewalld\" provides an easy and effective way to block/limit remote\naccess to the system via ports, services, and protocols.\n\n Remote access services, such as those providing remote access to network\ndevices and information systems, which lack automated control capabilities,\nincrease risk and make remote user access management difficult at best.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n\n RHEL 8 functionality (e.g., RDP) must be capable of taking enforcement\naction if the audit reveals unauthorized activity. Automated control of remote\naccess sessions allows organizations to ensure ongoing compliance with remote\naccess policies by enforcing connection rules of remote access applications on\na variety of information system components (e.g., servers, workstations,\nnotebook computers, smartphones, and tablets).", + "check": "Verify that \"firewalld\" is installed with the following commands:\n\n $ sudo yum list installed firewalld\n\n firewalld.noarch 0.7.0-5.el8\n\n If the \"firewalld\" package is not installed, ask the System Administrator\nif another firewall is installed. If no firewall is installed this is a finding.", + "fix": "Install \"firewalld\" with the following command:\n\n$ sudo yum install firewalld.noarch" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000297-GPOS-00115", + "gid": "V-230505", + "rid": "SV-257935r854048_rule", + "stig_id": "RHEL-08-040100", + "fix_id": "F-33149r744019_fix", + "cci": [ + "CCI-002314" + ], + "nist": [ + "AC-17 (1)" + ], + "host": null + } + }, + { + "id": "SV-257936", + "code": "control 'SV-257936' do\n title 'A firewall must be active on RHEL 8.'\n desc '\"Firewalld\" provides an easy and effective way to block/limit remote\naccess to the system via ports, services, and protocols.\n\n Remote access services, such as those providing remote access to network\ndevices and information systems, which lack automated control capabilities,\nincrease risk and make remote user access management difficult at best.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n RHEL 8 functionality (e.g., RDP) must be capable of taking enforcement\naction if the audit reveals unauthorized activity. Automated control of remote\naccess sessions allows organizations to ensure ongoing compliance with remote\naccess policies by enforcing connection rules of remote access applications on\na variety of information system components (e.g., servers, workstations,\nnotebook computers, smartphones, and tablets).'\n desc 'check', 'Verify that \"firewalld\" is active with the following commands:\n\n $ sudo systemctl is-active firewalld\n\n active\n\n If the \"firewalld\" package is not \"active\", ask the System\nAdministrator if another firewall is installed. If no firewall is installed and\nactive this is a finding.'\n desc 'fix', 'Configure \"firewalld\" to protect the operating system with the following\ncommand:\n\n $ sudo systemctl enable firewalld'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000297-GPOS-00115'\n tag gid: 'V-244544'\n tag rid: 'SV-257936r854073_rule'\n tag stig_id: 'RHEL-08-040101'\n tag fix_id: 'F-47776r743880_fix'\n tag cci: ['CCI-002314']\n tag nist: ['AC-17 (1)']\n\n only_if('This requirment is Not Applicable in the container, the container management platform manages the firewall service', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('external_firewall')\n message = 'This system uses an externally managed firewall service, verify with the system administrator that the firewall is configured to requirements'\n describe message do\n skip message\n end\n else\n describe package('firewalld') do\n it { should be_installed }\n end\n describe firewalld do\n it { should be_installed }\n it { should be_running }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257936.rb" + }, + "title": "A firewall must be active on RHEL 8.", + "desc": "\"Firewalld\" provides an easy and effective way to block/limit remote\naccess to the system via ports, services, and protocols.\n\n Remote access services, such as those providing remote access to network\ndevices and information systems, which lack automated control capabilities,\nincrease risk and make remote user access management difficult at best.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n RHEL 8 functionality (e.g., RDP) must be capable of taking enforcement\naction if the audit reveals unauthorized activity. Automated control of remote\naccess sessions allows organizations to ensure ongoing compliance with remote\naccess policies by enforcing connection rules of remote access applications on\na variety of information system components (e.g., servers, workstations,\nnotebook computers, smartphones, and tablets).", + "descriptions": { + "default": "\"Firewalld\" provides an easy and effective way to block/limit remote\naccess to the system via ports, services, and protocols.\n\n Remote access services, such as those providing remote access to network\ndevices and information systems, which lack automated control capabilities,\nincrease risk and make remote user access management difficult at best.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n RHEL 8 functionality (e.g., RDP) must be capable of taking enforcement\naction if the audit reveals unauthorized activity. Automated control of remote\naccess sessions allows organizations to ensure ongoing compliance with remote\naccess policies by enforcing connection rules of remote access applications on\na variety of information system components (e.g., servers, workstations,\nnotebook computers, smartphones, and tablets).", + "check": "Verify that \"firewalld\" is active with the following commands:\n\n $ sudo systemctl is-active firewalld\n\n active\n\n If the \"firewalld\" package is not \"active\", ask the System\nAdministrator if another firewall is installed. If no firewall is installed and\nactive this is a finding.", + "fix": "Configure \"firewalld\" to protect the operating system with the following\ncommand:\n\n $ sudo systemctl enable firewalld" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000297-GPOS-00115", + "gid": "V-244544", + "rid": "SV-257936r854073_rule", + "stig_id": "RHEL-08-040101", + "fix_id": "F-47776r743880_fix", + "cci": [ + "CCI-002314" + ], + "nist": [ + "AC-17 (1)" + ] + } + }, + { + "id": "SV-257937", + "code": "control 'SV-257937' do\n title 'The RHEL 8 fapolicy module must be configured to employ a deny-all,\npermit-by-exception policy to allow the execution of authorized software\nprograms.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.'\n desc 'check', 'Verify the RHEL 8 \"fapolicyd\" employs a deny-all, permit-by-exception policy.\n\nCheck that \"fapolicyd\" is in enforcement mode with the following command:\n\n$ sudo grep permissive /etc/fapolicyd/fapolicyd.conf\n\npermissive = 0\n\nCheck that fapolicyd employs a deny-all policy on system mounts with the following commands:\n\nFor RHEL 8.4 systems and older:\n$ sudo tail /etc/fapolicyd/fapolicyd.rules\n\nFor RHEL 8.5 systems and newer:\n$ sudo tail /etc/fapolicyd/compiled.rules\n\nallow exe=/usr/bin/python3.7 : ftype=text/x-python\ndeny_audit perm=any pattern=ld_so : all\ndeny perm=any all : all\n\nIf fapolicyd is not running in enforcement mode with a deny-all, permit-by-exception policy, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to employ a deny-all, permit-by-exception application whitelisting policy with \"fapolicyd\".\n\nWith the \"fapolicyd\" installed and enabled, configure the daemon to function in permissive mode until the whitelist is built correctly to avoid system lockout. Do this by editing the \"/etc/fapolicyd/fapolicyd.conf\" file with the following line:\n\npermissive = 1\n\nFor RHEL 8.4 systems and older:\nBuild the whitelist in the \"/etc/fapolicyd/fapolicyd.rules\" file ensuring the last rule is \"deny perm=any all : all\".\n\nFor RHEL 8.5 systems and newer:\nBuild the whitelist in a file within the \"/etc/fapolicyd/rules.d\" directory ensuring the last rule is \"deny perm=any all : all\".\n\nOnce it is determined the whitelist is built correctly, set the fapolicyd to enforcing mode by editing the \"permissive\" line in the /etc/fapolicyd/fapolicyd.conf file.\n\npermissive = 0'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155', 'SRG-OS-000480-GPOS-00232']\n tag gid: 'V-244546'\n tag rid: 'SV-257937r858730_rule'\n tag stig_id: 'RHEL-08-040137'\n tag fix_id: 'F-47778r858729_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n\n # Check if the system is a Docker container or not using Fapolicyd\n if virtualization.system.eql?('docker') || !input('use_fapolicyd')\n impact 0.0\n describe 'Control not applicable' do\n skip 'The organization is not using the Fapolicyd service to manage firewall services, this control is Not Applicable' unless input('use_fapolicyd')\n skip 'Control not applicable within a container' if virtualization.system.eql?('docker')\n end\n else\n # Parse the fapolicyd configuration file\n fapolicyd_config = parse_config_file('/etc/fapolicyd/fapolicyd.conf')\n\n describe 'Fapolicyd configuration' do\n it 'permissive should not be commented out' do\n expect(fapolicyd_config.content).to match(/^permissive\\s*=\\s*0$/), 'permissive is commented out in the fapolicyd.conf file'\n end\n it 'should have permissive set to 0' do\n expect(fapolicyd_config.params['permissive']).to cmp '0'\n end\n end\n\n # Determine the rules file based on the OS release\n rules_file = os.release.to_f < 8.4 ? '/etc/fapolicyd/fapolicyd.rules' : '/etc/fapolicyd/compiled.rules'\n\n # Check if the rules file exists\n describe file(rules_file) do\n it { should exist }\n end\n\n # If the rules file exists, check the last rule\n if file(rules_file).exist?\n rules = file(rules_file).content.strip.split(\"\\n\")\n last_rule = rules.last\n\n describe 'Last rule in the rules file' do\n it { expect(last_rule).to cmp 'deny perm=any all : all' }\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257937.rb" + }, + "title": "The RHEL 8 fapolicy module must be configured to employ a deny-all,\npermit-by-exception policy to allow the execution of authorized software\nprograms.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.", + "check": "Verify the RHEL 8 \"fapolicyd\" employs a deny-all, permit-by-exception policy.\n\nCheck that \"fapolicyd\" is in enforcement mode with the following command:\n\n$ sudo grep permissive /etc/fapolicyd/fapolicyd.conf\n\npermissive = 0\n\nCheck that fapolicyd employs a deny-all policy on system mounts with the following commands:\n\nFor RHEL 8.4 systems and older:\n$ sudo tail /etc/fapolicyd/fapolicyd.rules\n\nFor RHEL 8.5 systems and newer:\n$ sudo tail /etc/fapolicyd/compiled.rules\n\nallow exe=/usr/bin/python3.7 : ftype=text/x-python\ndeny_audit perm=any pattern=ld_so : all\ndeny perm=any all : all\n\nIf fapolicyd is not running in enforcement mode with a deny-all, permit-by-exception policy, this is a finding.", + "fix": "Configure RHEL 8 to employ a deny-all, permit-by-exception application whitelisting policy with \"fapolicyd\".\n\nWith the \"fapolicyd\" installed and enabled, configure the daemon to function in permissive mode until the whitelist is built correctly to avoid system lockout. Do this by editing the \"/etc/fapolicyd/fapolicyd.conf\" file with the following line:\n\npermissive = 1\n\nFor RHEL 8.4 systems and older:\nBuild the whitelist in the \"/etc/fapolicyd/fapolicyd.rules\" file ensuring the last rule is \"deny perm=any all : all\".\n\nFor RHEL 8.5 systems and newer:\nBuild the whitelist in a file within the \"/etc/fapolicyd/rules.d\" directory ensuring the last rule is \"deny perm=any all : all\".\n\nOnce it is determined the whitelist is built correctly, set the fapolicyd to enforcing mode by editing the \"permissive\" line in the /etc/fapolicyd/fapolicyd.conf file.\n\npermissive = 0" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "satisfies": [ + "SRG-OS-000368-GPOS-00154", + "SRG-OS-000370-GPOS-00155", + "SRG-OS-000480-GPOS-00232" + ], + "gid": "V-244546", + "rid": "SV-257937r858730_rule", + "stig_id": "RHEL-08-040137", + "fix_id": "F-47778r858729_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ] + } + }, + { + "id": "SV-257938", + "code": "control 'SV-257938' do\n title 'RHEL 9 must control remote access methods.'\n desc 'To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols on information systems.\n\nOperating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., VPN and IPS); however, doing so increases risk over limiting the services provided by one component.\n\nTo support the requirements and principles of least functionality, the operating system must support the organizational requirements, providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business.\n\n'\n desc 'check', 'Inspect the list of enabled firewall ports and verify they are configured correctly by running the following command:\n\n$ sudo firewall-cmd --list-all \n\nAsk the system administrator for the site or program Ports, Protocols, and Services Management Component Local Service Assessment (PPSM CLSA). Verify the services allowed by the firewall match the PPSM CLSA. \n\nIf there are additional ports, protocols, or services that are not in the PPSM CLSA, or there are ports, protocols, or services that are prohibited by the PPSM Category Assurance List (CAL), or there are no firewall rules configured, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to allow approved settings and/or running services to comply with the PPSM CLSA for the site or program and the PPSM CAL.\n\nTo open a port for a service, configure firewalld using the following command:\n\n$ sudo firewall-cmd --permanent --add-port=port_number/tcp\nor\n$ sudo firewall-cmd --permanent --add-service=service_name'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61679r925799_chk'\n tag severity: 'medium'\n tag gid: 'V-257938'\n tag rid: 'SV-257938r925801_rule'\n tag stig_id: 'RHEL-09-251025'\n tag gtitle: 'SRG-OS-000096-GPOS-00050'\n tag fix_id: 'F-61603r925800_fix'\n tag satisfies: ['SRG-OS-000096-GPOS-00050', 'SRG-OS-000297-GPOS-00115']\n tag 'documentable'\n tag cci: ['CCI-000382', 'CCI-002314']\n tag nist: ['CM-7 b', 'AC-17 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257938.rb" + }, + "title": "RHEL 9 must control remote access methods.", + "desc": "To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols on information systems.\n\nOperating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., VPN and IPS); however, doing so increases risk over limiting the services provided by one component.\n\nTo support the requirements and principles of least functionality, the operating system must support the organizational requirements, providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business.\n\n", + "descriptions": { + "default": "To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols on information systems.\n\nOperating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., VPN and IPS); however, doing so increases risk over limiting the services provided by one component.\n\nTo support the requirements and principles of least functionality, the operating system must support the organizational requirements, providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business.\n\n", + "check": "Inspect the list of enabled firewall ports and verify they are configured correctly by running the following command:\n\n$ sudo firewall-cmd --list-all \n\nAsk the system administrator for the site or program Ports, Protocols, and Services Management Component Local Service Assessment (PPSM CLSA). Verify the services allowed by the firewall match the PPSM CLSA. \n\nIf there are additional ports, protocols, or services that are not in the PPSM CLSA, or there are ports, protocols, or services that are prohibited by the PPSM Category Assurance List (CAL), or there are no firewall rules configured, this is a finding.", + "fix": "Configure RHEL 9 to allow approved settings and/or running services to comply with the PPSM CLSA for the site or program and the PPSM CAL.\n\nTo open a port for a service, configure firewalld using the following command:\n\n$ sudo firewall-cmd --permanent --add-port=port_number/tcp\nor\n$ sudo firewall-cmd --permanent --add-service=service_name" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61679r925799_chk", + "severity": "medium", + "gid": "V-257938", + "rid": "SV-257938r925801_rule", + "stig_id": "RHEL-09-251025", + "gtitle": "SRG-OS-000096-GPOS-00050", + "fix_id": "F-61603r925800_fix", + "satisfies": [ + "SRG-OS-000096-GPOS-00050", + "SRG-OS-000297-GPOS-00115" + ], + "documentable": null, + "cci": [ + "CCI-000382", + "CCI-002314" + ], + "nist": [ + "CM-7 b", + "AC-17 (1)" + ] + } + }, + { + "id": "SV-257939", + "code": "control 'SV-257939' do\n title 'A firewall must be able to protect against or limit the effects of\nDenial of Service (DoS) attacks by ensuring RHEL 8 can implement rate-limiting\nmeasures on impacted network interfaces.'\n desc 'DoS is a condition when a resource is not available for legitimate\nusers. When this occurs, the organization either cannot accomplish its mission\nor must operate at degraded capacity.\n\n This requirement addresses the configuration of RHEL 8 to mitigate the\nimpact of DoS attacks that have occurred or are ongoing on system availability.\nFor each system, known and potential DoS attacks must be identified and\nsolutions for each type implemented. A variety of technologies exists to limit\nor, in some cases, eliminate the effects of DoS attacks (e.g., limiting\nprocesses or establishing memory partitions). Employing increased capacity and\nbandwidth, combined with service redundancy, may reduce the susceptibility to\nsome DoS attacks.\n\n Since version 0.6.0, \"firewalld\" has incorporated \"nftables\" as its\nbackend support. Utilizing the limit statement in \"nftables\" can help to\nmitigate DoS attacks.'\n desc 'check', 'Verify \"nftables\" is configured to allow rate limits on any connection to\nthe system with the following command:\n\n Verify \"firewalld\" has \"nftables\" set as the default backend:\n\n $ sudo grep -i firewallbackend /etc/firewalld/firewalld.conf\n\n # FirewallBackend\n FirewallBackend=nftables\n\n If the \"nftables\" is not set as the \"firewallbackend\" default, this is\na finding.'\n desc 'fix', 'Configure \"nftables\" to be the default \"firewallbackend\" for \"firewalld\" by adding or editing the following line in \"/etc/firewalld/firewalld.conf\":\n\nFirewallBackend=nftables\n\nEstablish rate-limiting rules based on organization-defined types of DoS attacks on impacted network interfaces.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000420-GPOS-00186'\n tag gid: 'V-230525'\n tag rid: 'SV-257939r902735_rule'\n tag stig_id: 'RHEL-08-040150'\n tag fix_id: 'F-33169r902734_fix'\n tag cci: ['CCI-002385']\n tag nist: ['SC-5', 'SC-5 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe parse_config_file('/etc/firewalld/firewalld.conf') do\n its('FirewallBackend') { should eq 'nftables' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257939.rb" + }, + "title": "A firewall must be able to protect against or limit the effects of\nDenial of Service (DoS) attacks by ensuring RHEL 8 can implement rate-limiting\nmeasures on impacted network interfaces.", + "desc": "DoS is a condition when a resource is not available for legitimate\nusers. When this occurs, the organization either cannot accomplish its mission\nor must operate at degraded capacity.\n\n This requirement addresses the configuration of RHEL 8 to mitigate the\nimpact of DoS attacks that have occurred or are ongoing on system availability.\nFor each system, known and potential DoS attacks must be identified and\nsolutions for each type implemented. A variety of technologies exists to limit\nor, in some cases, eliminate the effects of DoS attacks (e.g., limiting\nprocesses or establishing memory partitions). Employing increased capacity and\nbandwidth, combined with service redundancy, may reduce the susceptibility to\nsome DoS attacks.\n\n Since version 0.6.0, \"firewalld\" has incorporated \"nftables\" as its\nbackend support. Utilizing the limit statement in \"nftables\" can help to\nmitigate DoS attacks.", + "descriptions": { + "default": "DoS is a condition when a resource is not available for legitimate\nusers. When this occurs, the organization either cannot accomplish its mission\nor must operate at degraded capacity.\n\n This requirement addresses the configuration of RHEL 8 to mitigate the\nimpact of DoS attacks that have occurred or are ongoing on system availability.\nFor each system, known and potential DoS attacks must be identified and\nsolutions for each type implemented. A variety of technologies exists to limit\nor, in some cases, eliminate the effects of DoS attacks (e.g., limiting\nprocesses or establishing memory partitions). Employing increased capacity and\nbandwidth, combined with service redundancy, may reduce the susceptibility to\nsome DoS attacks.\n\n Since version 0.6.0, \"firewalld\" has incorporated \"nftables\" as its\nbackend support. Utilizing the limit statement in \"nftables\" can help to\nmitigate DoS attacks.", + "check": "Verify \"nftables\" is configured to allow rate limits on any connection to\nthe system with the following command:\n\n Verify \"firewalld\" has \"nftables\" set as the default backend:\n\n $ sudo grep -i firewallbackend /etc/firewalld/firewalld.conf\n\n # FirewallBackend\n FirewallBackend=nftables\n\n If the \"nftables\" is not set as the \"firewallbackend\" default, this is\na finding.", + "fix": "Configure \"nftables\" to be the default \"firewallbackend\" for \"firewalld\" by adding or editing the following line in \"/etc/firewalld/firewalld.conf\":\n\nFirewallBackend=nftables\n\nEstablish rate-limiting rules based on organization-defined types of DoS attacks on impacted network interfaces." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000420-GPOS-00186", + "gid": "V-230525", + "rid": "SV-257939r902735_rule", + "stig_id": "RHEL-08-040150", + "fix_id": "F-33169r902734_fix", + "cci": [ + "CCI-002385" + ], + "nist": [ + "SC-5", + "SC-5 a" + ], + "host": null + } + }, + { + "id": "SV-257940", + "code": "control 'SV-257940' do\n title 'RHEL 8 must be configured to prohibit or restrict the use of\nfunctions, ports, protocols, and/or services, as defined in the Ports,\nProtocols, and Services Management (PPSM) Category Assignments List (CAL) and\nvulnerability assessments.'\n desc 'To prevent unauthorized connection of devices, unauthorized transfer\nof information, or unauthorized tunneling (i.e., embedding of data types within\ndata types), organizations must disable or restrict unused or unnecessary\nphysical and logical ports/protocols on information systems.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services provided by default may not be\nnecessary to support essential organizational operations. Additionally, it is\nsometimes convenient to provide multiple services from a single component\n(e.g., VPN and IPS); however, doing so increases risk over limiting the\nservices provided by any one component.\n\n To support the requirements and principles of least functionality, the\noperating system must support the organizational requirements, providing only\nessential capabilities and limiting the use of ports, protocols, and/or\nservices to only those required, authorized, and approved to conduct official\nbusiness or to address authorized quality-of-life issues.'\n desc 'check', 'Inspect the firewall configuration and running services to verify it is\nconfigured to prohibit or restrict the use of functions, ports, protocols,\nand/or services that are unnecessary or prohibited.\n\n Check which services are currently active with the following command:\n\n $ sudo firewall-cmd --list-all-zones\n\n custom (active)\n target: DROP\n icmp-block-inversion: no\n interfaces: ens33\n sources:\n services: dhcpv6-client dns http https ldaps rpc-bind ssh\n ports:\n masquerade: no\n forward-ports:\n icmp-blocks:\n rich rules:\n\n Ask the System Administrator for the site or program Ports, Protocols, and\nServices Management Component Local Service Assessment (PPSM CLSA). Verify the\nservices allowed by the firewall match the PPSM CLSA.\n\n If there are additional ports, protocols, or services that are not in the\nPPSM CLSA, or there are ports, protocols, or services that are prohibited by\nthe PPSM Category Assurance List (CAL), this is a finding.'\n desc 'fix', \"Update the host's firewall settings and/or running services to\ncomply with the PPSM Component Local Service Assessment (CLSA) for the site or\nprogram and the PPSM CAL.\"\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000096-GPOS-00050'\n tag gid: 'V-230500'\n tag rid: 'SV-257940r627750_rule'\n tag stig_id: 'RHEL-08-040030'\n tag fix_id: 'F-33144r568247_fix'\n tag cci: ['CCI-000382']\n tag nist: ['CM-7 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n firewalld_properties = input('firewalld_properties')\n\n describe firewalld do\n it { should be_running }\n end\n describe firewalld do\n its('ports') { should cmp [firewalld_properties['ports']] }\n its('protocols') { should cmp [firewalld_properties['protocols']] }\n its('services') { should cmp [firewalld_properties['services']] }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257940.rb" + }, + "title": "RHEL 8 must be configured to prohibit or restrict the use of\nfunctions, ports, protocols, and/or services, as defined in the Ports,\nProtocols, and Services Management (PPSM) Category Assignments List (CAL) and\nvulnerability assessments.", + "desc": "To prevent unauthorized connection of devices, unauthorized transfer\nof information, or unauthorized tunneling (i.e., embedding of data types within\ndata types), organizations must disable or restrict unused or unnecessary\nphysical and logical ports/protocols on information systems.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services provided by default may not be\nnecessary to support essential organizational operations. Additionally, it is\nsometimes convenient to provide multiple services from a single component\n(e.g., VPN and IPS); however, doing so increases risk over limiting the\nservices provided by any one component.\n\n To support the requirements and principles of least functionality, the\noperating system must support the organizational requirements, providing only\nessential capabilities and limiting the use of ports, protocols, and/or\nservices to only those required, authorized, and approved to conduct official\nbusiness or to address authorized quality-of-life issues.", + "descriptions": { + "default": "To prevent unauthorized connection of devices, unauthorized transfer\nof information, or unauthorized tunneling (i.e., embedding of data types within\ndata types), organizations must disable or restrict unused or unnecessary\nphysical and logical ports/protocols on information systems.\n\n Operating systems are capable of providing a wide variety of functions and\nservices. Some of the functions and services provided by default may not be\nnecessary to support essential organizational operations. Additionally, it is\nsometimes convenient to provide multiple services from a single component\n(e.g., VPN and IPS); however, doing so increases risk over limiting the\nservices provided by any one component.\n\n To support the requirements and principles of least functionality, the\noperating system must support the organizational requirements, providing only\nessential capabilities and limiting the use of ports, protocols, and/or\nservices to only those required, authorized, and approved to conduct official\nbusiness or to address authorized quality-of-life issues.", + "check": "Inspect the firewall configuration and running services to verify it is\nconfigured to prohibit or restrict the use of functions, ports, protocols,\nand/or services that are unnecessary or prohibited.\n\n Check which services are currently active with the following command:\n\n $ sudo firewall-cmd --list-all-zones\n\n custom (active)\n target: DROP\n icmp-block-inversion: no\n interfaces: ens33\n sources:\n services: dhcpv6-client dns http https ldaps rpc-bind ssh\n ports:\n masquerade: no\n forward-ports:\n icmp-blocks:\n rich rules:\n\n Ask the System Administrator for the site or program Ports, Protocols, and\nServices Management Component Local Service Assessment (PPSM CLSA). Verify the\nservices allowed by the firewall match the PPSM CLSA.\n\n If there are additional ports, protocols, or services that are not in the\nPPSM CLSA, or there are ports, protocols, or services that are prohibited by\nthe PPSM Category Assurance List (CAL), this is a finding.", + "fix": "Update the host's firewall settings and/or running services to\ncomply with the PPSM Component Local Service Assessment (CLSA) for the site or\nprogram and the PPSM CAL." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000096-GPOS-00050", + "gid": "V-230500", + "rid": "SV-257940r627750_rule", + "stig_id": "RHEL-08-040030", + "fix_id": "F-33144r568247_fix", + "cci": [ + "CCI-000382" + ], + "nist": [ + "CM-7 b" + ], + "host": null + } + }, + { + "id": "SV-257941", + "code": "control 'SV-257941' do\n title 'RHEL 8 network interfaces must not be in promiscuous mode.'\n desc 'Network interfaces in promiscuous mode allow for the capture of all\nnetwork traffic visible to the system. If unauthorized individuals can access\nthese applications, it may allow them to collect information such as logon IDs,\npasswords, and key exchanges between systems.\n\n If the system is being used to perform a network troubleshooting function,\nthe use of these tools must be documented with the Information System Security\nOfficer (ISSO) and restricted to only authorized personnel.'\n desc 'check', 'Verify network interfaces are not in promiscuous mode unless approved by\nthe ISSO and documented.\n\n Check for the status with the following command:\n\n $ sudo ip link | grep -i promisc\n\n If network interfaces are found on the system in promiscuous mode and their\nuse has not been approved by the ISSO and documented, this is a finding.'\n desc 'fix', 'Configure network interfaces to turn off promiscuous mode unless approved\nby the ISSO and documented.\n\n Set the promiscuous mode of an interface to off with the following command:\n\n $ sudo ip link set dev multicast off promisc off'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230554'\n tag rid: 'SV-257941r627750_rule'\n tag stig_id: 'RHEL-08-040330'\n tag fix_id: 'F-33198r568409_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('promiscuous_mode_permitted')\n describe command('ip link | grep -i promisc') do\n its('stdout.strip') { should_not match(/^$/) }\n end\n else\n describe command('ip link | grep -i promisc') do\n its('stdout.strip') { should match(/^$/) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257941.rb" + }, + "title": "RHEL 8 network interfaces must not be in promiscuous mode.", + "desc": "Network interfaces in promiscuous mode allow for the capture of all\nnetwork traffic visible to the system. If unauthorized individuals can access\nthese applications, it may allow them to collect information such as logon IDs,\npasswords, and key exchanges between systems.\n\n If the system is being used to perform a network troubleshooting function,\nthe use of these tools must be documented with the Information System Security\nOfficer (ISSO) and restricted to only authorized personnel.", + "descriptions": { + "default": "Network interfaces in promiscuous mode allow for the capture of all\nnetwork traffic visible to the system. If unauthorized individuals can access\nthese applications, it may allow them to collect information such as logon IDs,\npasswords, and key exchanges between systems.\n\n If the system is being used to perform a network troubleshooting function,\nthe use of these tools must be documented with the Information System Security\nOfficer (ISSO) and restricted to only authorized personnel.", + "check": "Verify network interfaces are not in promiscuous mode unless approved by\nthe ISSO and documented.\n\n Check for the status with the following command:\n\n $ sudo ip link | grep -i promisc\n\n If network interfaces are found on the system in promiscuous mode and their\nuse has not been approved by the ISSO and documented, this is a finding.", + "fix": "Configure network interfaces to turn off promiscuous mode unless approved\nby the ISSO and documented.\n\n Set the promiscuous mode of an interface to off with the following command:\n\n $ sudo ip link set dev multicast off promisc off" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230554", + "rid": "SV-257941r627750_rule", + "stig_id": "RHEL-08-040330", + "fix_id": "F-33198r568409_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257942", + "code": "control 'SV-257942' do\n title 'RHEL 8 must enable hardening for the Berkeley Packet Filter\nJust-in-time compiler.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nEnabling hardening for the Berkeley Packet Filter (BPF) Just-in-time (JIT) compiler aids in mitigating JIT spraying attacks. Setting the value to \"2\" enables JIT hardening for all users.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 enables hardening for the BPF JIT with the following commands:\n\n$ sudo sysctl net.core.bpf_jit_harden\n\nnet.core.bpf_jit_harden = 2\n\nIf the returned line does not have a value of \"2\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.core.bpf_jit_harden /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.core.bpf_jit_harden = 2\n\nIf \"net.core.bpf_jit_harden\" is not set to \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to enable hardening for the BPF JIT compiler by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nnet.core.bpf_jit_harden = 2\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244554'\n tag rid: 'SV-257942r858832_rule'\n tag stig_id: 'RHEL-08-040286'\n tag fix_id: 'F-47786r858831_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.core.bpf_jit_harden'\n action = 'BPF JIT compiler'\n value = 2\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257942.rb" + }, + "title": "RHEL 8 must enable hardening for the Berkeley Packet Filter\nJust-in-time compiler.", + "desc": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nEnabling hardening for the Berkeley Packet Filter (BPF) Just-in-time (JIT) compiler aids in mitigating JIT spraying attacks. Setting the value to \"2\" enables JIT hardening for all users.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nEnabling hardening for the Berkeley Packet Filter (BPF) Just-in-time (JIT) compiler aids in mitigating JIT spraying attacks. Setting the value to \"2\" enables JIT hardening for all users.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 enables hardening for the BPF JIT with the following commands:\n\n$ sudo sysctl net.core.bpf_jit_harden\n\nnet.core.bpf_jit_harden = 2\n\nIf the returned line does not have a value of \"2\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.core.bpf_jit_harden /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.core.bpf_jit_harden = 2\n\nIf \"net.core.bpf_jit_harden\" is not set to \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to enable hardening for the BPF JIT compiler by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nnet.core.bpf_jit_harden = 2\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244554", + "rid": "SV-257942r858832_rule", + "stig_id": "RHEL-08-040286", + "fix_id": "F-47786r858831_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257943", + "code": "control 'SV-257943' do\n title 'RHEL 9 must have the chrony package installed.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.'\n desc 'check', 'Verify that RHEL 9 has the chrony package installed with the following command:\n\n$ sudo dnf list --installed chrony\n\nExample output:\n\nchrony.x86_64 4.1-3.el9 \n\nIf the \"chrony\" package is not installed, this is a finding.'\n desc 'fix', 'The chrony package can be installed with the following command:\n \n$ sudo dnf install chrony'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61684r925814_chk'\n tag severity: 'medium'\n tag gid: 'V-257943'\n tag rid: 'SV-257943r925816_rule'\n tag stig_id: 'RHEL-09-252010'\n tag gtitle: 'SRG-OS-000355-GPOS-00143'\n tag fix_id: 'F-61608r925815_fix'\n tag 'documentable'\n tag cci: ['CCI-001891']\n tag nist: ['AU-8 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257943.rb" + }, + "title": "RHEL 9 must have the chrony package installed.", + "desc": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.", + "descriptions": { + "default": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.", + "check": "Verify that RHEL 9 has the chrony package installed with the following command:\n\n$ sudo dnf list --installed chrony\n\nExample output:\n\nchrony.x86_64 4.1-3.el9 \n\nIf the \"chrony\" package is not installed, this is a finding.", + "fix": "The chrony package can be installed with the following command:\n \n$ sudo dnf install chrony" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61684r925814_chk", + "severity": "medium", + "gid": "V-257943", + "rid": "SV-257943r925816_rule", + "stig_id": "RHEL-09-252010", + "gtitle": "SRG-OS-000355-GPOS-00143", + "fix_id": "F-61608r925815_fix", + "documentable": null, + "cci": [ + "CCI-001891" + ], + "nist": [ + "AU-8 (1) (a)" + ] + } + }, + { + "id": "SV-257944", + "code": "control 'SV-257944' do\n title 'RHEL 9 chronyd service must be enabled.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network.'\n desc 'check', 'Verify the chronyd service is active with the following command:\n\n$ systemctl is-active chronyd\n\nactive \n\nIf the chronyd service is not active, this is a finding.'\n desc 'fix', 'To enable the chronyd service run the following command:\n\n$ sudo systemctl enable --now chronyd'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61685r925817_chk'\n tag severity: 'medium'\n tag gid: 'V-257944'\n tag rid: 'SV-257944r925819_rule'\n tag stig_id: 'RHEL-09-252015'\n tag gtitle: 'SRG-OS-000355-GPOS-00143'\n tag fix_id: 'F-61609r925818_fix'\n tag 'documentable'\n tag cci: ['CCI-001891']\n tag nist: ['AU-8 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257944.rb" + }, + "title": "RHEL 9 chronyd service must be enabled.", + "desc": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network.", + "descriptions": { + "default": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network.", + "check": "Verify the chronyd service is active with the following command:\n\n$ systemctl is-active chronyd\n\nactive \n\nIf the chronyd service is not active, this is a finding.", + "fix": "To enable the chronyd service run the following command:\n\n$ sudo systemctl enable --now chronyd" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61685r925817_chk", + "severity": "medium", + "gid": "V-257944", + "rid": "SV-257944r925819_rule", + "stig_id": "RHEL-09-252015", + "gtitle": "SRG-OS-000355-GPOS-00143", + "fix_id": "F-61609r925818_fix", + "documentable": null, + "cci": [ + "CCI-001891" + ], + "nist": [ + "AU-8 (1) (a)" + ] + } + }, + { + "id": "SV-257945", + "code": "control 'SV-257945' do\n title 'RHEL 8 must securely compare internal information system clocks at\nleast every 24 hours with a server synchronized to an authoritative time\nsource, such as the United States Naval Observatory (USNO) time servers, or a\ntime server designated for the appropriate DoD network (NIPRNet/SIPRNet),\nand/or the Global Positioning System (GPS).'\n desc 'Inaccurate time stamps make it more difficult to correlate events and\ncan lead to an inaccurate analysis. Determining the correct time a particular\nevent occurred on a system is critical when conducting forensic analysis and\ninvestigating system events. Sources outside the configured acceptable\nallowance (drift) may be inaccurate.\n\n Synchronizing internal information system clocks provides uniformity of\ntime stamps for information systems with multiple system clocks and systems\nconnected over a network.\n\n Organizations should consider endpoints that may not have regular access to\nthe authoritative time server (e.g., mobile, teleworking, and tactical\nendpoints).\n\n If time stamps are not consistently applied and there is no common time\nreference, it is difficult to perform forensic analysis.\n\n Time stamps generated by the operating system include date and time. Time\nis commonly expressed in Coordinated Universal Time (UTC), a modern\ncontinuation of Greenwich Mean Time (GMT), or local time with an offset from\nUTC.\n\n RHEL 8 utilizes the \"timedatectl\" command to view the status of the\n\"systemd-timesyncd.service\". The \"timedatectl\" status will display the\nlocal time, UTC, and the offset from UTC.\n\n Note that USNO offers authenticated NTP service to DoD and U.S. Government\nagencies operating on the NIPR and SIPR networks. Visit\nhttps://www.usno.navy.mil/USNO/time/ntp/dod-customers for more information.'\n desc 'check', 'Verify RHEL 8 is securely comparing internal information system clocks at\nleast every 24 hours with an NTP server with the following commands:\n\n $ sudo grep maxpoll /etc/chrony.conf\n\n server 0.us.pool.ntp.mil iburst maxpoll 16\n\n If the \"maxpoll\" option is set to a number greater than 16 or the line is\ncommented out, this is a finding.\n\n Verify the \"chrony.conf\" file is configured to an authoritative DoD time\nsource by running the following command:\n\n $ sudo grep -i server /etc/chrony.conf\n server 0.us.pool.ntp.mil\n\n If the parameter \"server\" is not set or is not set to an authoritative\nDoD time source, this is a finding.'\n desc 'fix', 'Configure the operating system to securely compare internal information\nsystem clocks at least every 24 hours with an NTP server by adding/modifying\nthe following line in the /etc/chrony.conf file.\n\n server [ntp.server.name] iburst maxpoll 16'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000355-GPOS-00143'\n tag satisfies: ['SRG-OS-000355-GPOS-00143', 'SRG-OS-000356-GPOS-00144', 'SRG-OS-000359-GPOS-00146']\n tag gid: 'V-230484'\n tag rid: 'SV-257945r877038_rule'\n tag stig_id: 'RHEL-08-030740'\n tag fix_id: 'F-33128r568199_fix'\n tag cci: ['CCI-001891']\n tag nist: ['AU-8 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n time_sources = ntp_conf('/etc/chrony.conf').server\n\n # Cover case when a single server is defined and resource returns a string and not an array\n time_sources = [time_sources] if time_sources.is_a? String\n\n unless time_sources.nil?\n max_poll_values = time_sources.map { |val|\n val.match?(/.*maxpoll.*/) ? val.gsub(/.*maxpoll\\s+(\\d+)(\\s+.*|$)/, '\\1').to_i : 10\n }\n end\n\n # Verify the \"chrony.conf\" file is configured to an authoritative DoD time source by running the following command:\n\n describe ntp_conf('/etc/chrony.conf') do\n its('server') { should_not be_nil }\n end\n\n unless ntp_conf('/etc/chrony.conf').server.nil?\n if ntp_conf('/etc/chrony.conf').server.is_a? String\n describe ntp_conf('/etc/chrony.conf') do\n its('server') { should match input('authoritative_timeserver') }\n end\n end\n\n if ntp_conf('/etc/chrony.conf').server.is_a? Array\n describe ntp_conf('/etc/chrony.conf') do\n its('server.join') { should match input('authoritative_timeserver') }\n end\n end\n end\n # All time sources must contain valid maxpoll entries\n unless time_sources.nil?\n describe 'chronyd maxpoll values (99=maxpoll absent)' do\n subject { max_poll_values }\n it { should all be < 17 }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257945.rb" + }, + "title": "RHEL 8 must securely compare internal information system clocks at\nleast every 24 hours with a server synchronized to an authoritative time\nsource, such as the United States Naval Observatory (USNO) time servers, or a\ntime server designated for the appropriate DoD network (NIPRNet/SIPRNet),\nand/or the Global Positioning System (GPS).", + "desc": "Inaccurate time stamps make it more difficult to correlate events and\ncan lead to an inaccurate analysis. Determining the correct time a particular\nevent occurred on a system is critical when conducting forensic analysis and\ninvestigating system events. Sources outside the configured acceptable\nallowance (drift) may be inaccurate.\n\n Synchronizing internal information system clocks provides uniformity of\ntime stamps for information systems with multiple system clocks and systems\nconnected over a network.\n\n Organizations should consider endpoints that may not have regular access to\nthe authoritative time server (e.g., mobile, teleworking, and tactical\nendpoints).\n\n If time stamps are not consistently applied and there is no common time\nreference, it is difficult to perform forensic analysis.\n\n Time stamps generated by the operating system include date and time. Time\nis commonly expressed in Coordinated Universal Time (UTC), a modern\ncontinuation of Greenwich Mean Time (GMT), or local time with an offset from\nUTC.\n\n RHEL 8 utilizes the \"timedatectl\" command to view the status of the\n\"systemd-timesyncd.service\". The \"timedatectl\" status will display the\nlocal time, UTC, and the offset from UTC.\n\n Note that USNO offers authenticated NTP service to DoD and U.S. Government\nagencies operating on the NIPR and SIPR networks. Visit\nhttps://www.usno.navy.mil/USNO/time/ntp/dod-customers for more information.", + "descriptions": { + "default": "Inaccurate time stamps make it more difficult to correlate events and\ncan lead to an inaccurate analysis. Determining the correct time a particular\nevent occurred on a system is critical when conducting forensic analysis and\ninvestigating system events. Sources outside the configured acceptable\nallowance (drift) may be inaccurate.\n\n Synchronizing internal information system clocks provides uniformity of\ntime stamps for information systems with multiple system clocks and systems\nconnected over a network.\n\n Organizations should consider endpoints that may not have regular access to\nthe authoritative time server (e.g., mobile, teleworking, and tactical\nendpoints).\n\n If time stamps are not consistently applied and there is no common time\nreference, it is difficult to perform forensic analysis.\n\n Time stamps generated by the operating system include date and time. Time\nis commonly expressed in Coordinated Universal Time (UTC), a modern\ncontinuation of Greenwich Mean Time (GMT), or local time with an offset from\nUTC.\n\n RHEL 8 utilizes the \"timedatectl\" command to view the status of the\n\"systemd-timesyncd.service\". The \"timedatectl\" status will display the\nlocal time, UTC, and the offset from UTC.\n\n Note that USNO offers authenticated NTP service to DoD and U.S. Government\nagencies operating on the NIPR and SIPR networks. Visit\nhttps://www.usno.navy.mil/USNO/time/ntp/dod-customers for more information.", + "check": "Verify RHEL 8 is securely comparing internal information system clocks at\nleast every 24 hours with an NTP server with the following commands:\n\n $ sudo grep maxpoll /etc/chrony.conf\n\n server 0.us.pool.ntp.mil iburst maxpoll 16\n\n If the \"maxpoll\" option is set to a number greater than 16 or the line is\ncommented out, this is a finding.\n\n Verify the \"chrony.conf\" file is configured to an authoritative DoD time\nsource by running the following command:\n\n $ sudo grep -i server /etc/chrony.conf\n server 0.us.pool.ntp.mil\n\n If the parameter \"server\" is not set or is not set to an authoritative\nDoD time source, this is a finding.", + "fix": "Configure the operating system to securely compare internal information\nsystem clocks at least every 24 hours with an NTP server by adding/modifying\nthe following line in the /etc/chrony.conf file.\n\n server [ntp.server.name] iburst maxpoll 16" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000355-GPOS-00143", + "satisfies": [ + "SRG-OS-000355-GPOS-00143", + "SRG-OS-000356-GPOS-00144", + "SRG-OS-000359-GPOS-00146" + ], + "gid": "V-230484", + "rid": "SV-257945r877038_rule", + "stig_id": "RHEL-08-030740", + "fix_id": "F-33128r568199_fix", + "cci": [ + "CCI-001891" + ], + "nist": [ + "AU-8 (1) (a)" + ], + "host": null + } + }, + { + "id": "SV-257946", + "code": "control 'SV-257946' do\n title 'RHEL 8 must disable the chrony daemon from acting as a server.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nMinimizing the exposure of the server functionality of the chrony daemon diminishes the attack surface.\n\nRHEL 8 utilizes the \"timedatectl\" command to view the status of the \"systemd-timesyncd.service\". The \"timedatectl\" status will display the local time, UTC, and the offset from UTC.\n\nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.'\n desc 'check', %q(Note: If the system is approved and documented by the information system security officer (ISSO) to function as an NTP time server, this requirement is Not Applicable.\n\nVerify RHEL 8 disables the chrony daemon from acting as a server with the following command:\n\n $ sudo grep -w 'port' /etc/chrony.conf\n port 0\n\nIf the \"port\" option is not set to \"0\", is commented out or missing, this is a finding.)\n desc 'fix', 'Configure the operating system to disable the chrony daemon from acting as a server by adding or modifying the following line in the \"/etc/chrony.conf\" file:\n\n port 0'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230485'\n tag rid: 'SV-257946r928590_rule'\n tag stig_id: 'RHEL-08-030741'\n tag fix_id: 'F-33129r928589_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/chrony.conf').exist?)\n }\n\n chrony_conf = ntp_conf('/etc/chrony.conf')\n\n describe chrony_conf do\n its('port') { should cmp 0 }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257946.rb" + }, + "title": "RHEL 8 must disable the chrony daemon from acting as a server.", + "desc": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nMinimizing the exposure of the server functionality of the chrony daemon diminishes the attack surface.\n\nRHEL 8 utilizes the \"timedatectl\" command to view the status of the \"systemd-timesyncd.service\". The \"timedatectl\" status will display the local time, UTC, and the offset from UTC.\n\nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.", + "descriptions": { + "default": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nMinimizing the exposure of the server functionality of the chrony daemon diminishes the attack surface.\n\nRHEL 8 utilizes the \"timedatectl\" command to view the status of the \"systemd-timesyncd.service\". The \"timedatectl\" status will display the local time, UTC, and the offset from UTC.\n\nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.", + "check": "Note: If the system is approved and documented by the information system security officer (ISSO) to function as an NTP time server, this requirement is Not Applicable.\n\nVerify RHEL 8 disables the chrony daemon from acting as a server with the following command:\n\n $ sudo grep -w 'port' /etc/chrony.conf\n port 0\n\nIf the \"port\" option is not set to \"0\", is commented out or missing, this is a finding.", + "fix": "Configure the operating system to disable the chrony daemon from acting as a server by adding or modifying the following line in the \"/etc/chrony.conf\" file:\n\n port 0" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230485", + "rid": "SV-257946r928590_rule", + "stig_id": "RHEL-08-030741", + "fix_id": "F-33129r928589_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257947", + "code": "control 'SV-257947' do\n title 'RHEL 8 must disable network management of the chrony daemon.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nNot exposing the management interface of the chrony daemon on the network diminishes the attack space.\n\nRHEL 8 utilizes the \"timedatectl\" command to view the status of the \"systemd-timesyncd.service\". The \"timedatectl\" status will display the local time, UTC, and the offset from UTC.\n\nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.'\n desc 'check', %q(Note: If the system is approved and documented by the information system security officer (ISSO) to function as an NTP time server, this requirement is Not Applicable.\n\nVerify RHEL 8 disables network management of the chrony daemon with the following command:\n\n $ sudo grep -w 'cmdport' /etc/chrony.conf\n cmdport 0\n\nIf the \"cmdport\" option is not set to \"0\", is commented out or missing, this is a finding.)\n desc 'fix', 'Configure the operating system disable network management of the chrony daemon by adding or modifying the following line in the \"/etc/chrony.conf\" file.\n\n cmdport 0'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag gid: 'V-230486'\n tag rid: 'SV-257947r928593_rule'\n tag stig_id: 'RHEL-08-030742'\n tag fix_id: 'F-33130r928592_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/chrony.conf').exist?)\n }\n\n chrony_conf = ntp_conf('/etc/chrony.conf')\n\n describe chrony_conf do\n its('cmdport') { should cmp 0 }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257947.rb" + }, + "title": "RHEL 8 must disable network management of the chrony daemon.", + "desc": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nNot exposing the management interface of the chrony daemon on the network diminishes the attack space.\n\nRHEL 8 utilizes the \"timedatectl\" command to view the status of the \"systemd-timesyncd.service\". The \"timedatectl\" status will display the local time, UTC, and the offset from UTC.\n\nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.", + "descriptions": { + "default": "Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nNot exposing the management interface of the chrony daemon on the network diminishes the attack space.\n\nRHEL 8 utilizes the \"timedatectl\" command to view the status of the \"systemd-timesyncd.service\". The \"timedatectl\" status will display the local time, UTC, and the offset from UTC.\n\nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.", + "check": "Note: If the system is approved and documented by the information system security officer (ISSO) to function as an NTP time server, this requirement is Not Applicable.\n\nVerify RHEL 8 disables network management of the chrony daemon with the following command:\n\n $ sudo grep -w 'cmdport' /etc/chrony.conf\n cmdport 0\n\nIf the \"cmdport\" option is not set to \"0\", is commented out or missing, this is a finding.", + "fix": "Configure the operating system disable network management of the chrony daemon by adding or modifying the following line in the \"/etc/chrony.conf\" file.\n\n cmdport 0" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000095-GPOS-00049", + "gid": "V-230486", + "rid": "SV-257947r928593_rule", + "stig_id": "RHEL-08-030742", + "fix_id": "F-33130r928592_fix", + "cci": [ + "CCI-000381" + ], + "nist": [ + "CM-7 a" + ], + "host": null + } + }, + { + "id": "SV-257948", + "code": "control 'SV-257948' do\n title 'For RHEL 8 systems using Domain Name Servers (DNS) resolution, at\nleast two name servers must be configured.'\n desc 'To provide availability for name resolution services, multiple\nredundant name servers are mandated. A failure in name resolution could lead to\nthe failure of security functions requiring name resolution, which may include\ntime synchronization, centralized authentication, and remote system logging.'\n desc 'check', %q(Determine whether the system is using local or DNS name resolution with the\nfollowing command:\n\n $ sudo grep hosts /etc/nsswitch.conf\n\n hosts: files dns\n\n If the DNS entry is missing from the host's line in the\n\"/etc/nsswitch.conf\" file, the \"/etc/resolv.conf\" file must be empty.\n\n Verify the \"/etc/resolv.conf\" file is empty with the following command:\n\n $ sudo ls -al /etc/resolv.conf\n\n -rw-r--r-- 1 root root 0 Aug 19 08:31 resolv.conf\n\n If local host authentication is being used and the \"/etc/resolv.conf\"\nfile is not empty, this is a finding.\n\n If the DNS entry is found on the host's line of the \"/etc/nsswitch.conf\"\nfile, verify the operating system is configured to use two or more name servers\nfor DNS resolution.\n\n Determine the name servers used by the system with the following command:\n\n $ sudo grep nameserver /etc/resolv.conf\n\n nameserver 192.168.1.2\n nameserver 192.168.1.3\n\n If less than two lines are returned that are not commented out, this is a\nfinding.)\n desc 'fix', 'Configure the operating system to use two or more name servers for DNS\nresolution.\n\n By default, \"NetworkManager\" on RHEL 8 dynamically updates the\n/etc/resolv.conf file with the DNS settings from active \"NetworkManager\"\nconnection profiles. However, this feature can be disabled to allow manual\nconfigurations.\n\n If manually configuring DNS, edit the \"/etc/resolv.conf\" file to\nuncomment or add the two or more \"nameserver\" option lines with the IP\naddress of local authoritative name servers. If local host resolution is being\nperformed, the \"/etc/resolv.conf\" file must be empty. An empty\n\"/etc/resolv.conf\" file can be created as follows:\n\n $ sudo echo -n > /etc/resolv.conf'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230316'\n tag rid: 'SV-257948r627750_rule'\n tag stig_id: 'RHEL-08-010680'\n tag fix_id: 'F-32960r567695_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n dns_in_host_line = parse_config_file('/etc/nsswitch.conf',\n comment_char: '#',\n assignment_regex: /^\\s*([^:]*?)\\s*:\\s*(.*?)\\s*$/).params['hosts'].include?('dns')\n\n unless dns_in_host_line\n describe 'If `local` resolution is being used, a `hosts` entry in /etc/nsswitch.conf having `dns`' do\n subject { dns_in_host_line }\n it { should be false }\n end\n end\n\n unless dns_in_host_line\n describe 'If `local` resoultion is being used, the /etc/resolv.conf file should' do\n subject { parse_config_file('/etc/resolv.conf', comment_char: '#').params }\n it { should be_empty }\n end\n end\n\n nameservers = parse_config_file('/etc/resolv.conf',\n comment_char: '#').params.keys.grep(/nameserver/)\n\n if dns_in_host_line\n describe \"The system's nameservers: #{nameservers}\" do\n subject { nameservers }\n it { should_not be nil }\n end\n end\n\n if dns_in_host_line\n describe 'The number of nameservers' do\n subject { nameservers.count }\n it { should cmp >= 2 }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257948.rb" + }, + "title": "For RHEL 8 systems using Domain Name Servers (DNS) resolution, at\nleast two name servers must be configured.", + "desc": "To provide availability for name resolution services, multiple\nredundant name servers are mandated. A failure in name resolution could lead to\nthe failure of security functions requiring name resolution, which may include\ntime synchronization, centralized authentication, and remote system logging.", + "descriptions": { + "default": "To provide availability for name resolution services, multiple\nredundant name servers are mandated. A failure in name resolution could lead to\nthe failure of security functions requiring name resolution, which may include\ntime synchronization, centralized authentication, and remote system logging.", + "check": "Determine whether the system is using local or DNS name resolution with the\nfollowing command:\n\n $ sudo grep hosts /etc/nsswitch.conf\n\n hosts: files dns\n\n If the DNS entry is missing from the host's line in the\n\"/etc/nsswitch.conf\" file, the \"/etc/resolv.conf\" file must be empty.\n\n Verify the \"/etc/resolv.conf\" file is empty with the following command:\n\n $ sudo ls -al /etc/resolv.conf\n\n -rw-r--r-- 1 root root 0 Aug 19 08:31 resolv.conf\n\n If local host authentication is being used and the \"/etc/resolv.conf\"\nfile is not empty, this is a finding.\n\n If the DNS entry is found on the host's line of the \"/etc/nsswitch.conf\"\nfile, verify the operating system is configured to use two or more name servers\nfor DNS resolution.\n\n Determine the name servers used by the system with the following command:\n\n $ sudo grep nameserver /etc/resolv.conf\n\n nameserver 192.168.1.2\n nameserver 192.168.1.3\n\n If less than two lines are returned that are not commented out, this is a\nfinding.", + "fix": "Configure the operating system to use two or more name servers for DNS\nresolution.\n\n By default, \"NetworkManager\" on RHEL 8 dynamically updates the\n/etc/resolv.conf file with the DNS settings from active \"NetworkManager\"\nconnection profiles. However, this feature can be disabled to allow manual\nconfigurations.\n\n If manually configuring DNS, edit the \"/etc/resolv.conf\" file to\nuncomment or add the two or more \"nameserver\" option lines with the IP\naddress of local authoritative name servers. If local host resolution is being\nperformed, the \"/etc/resolv.conf\" file must be empty. An empty\n\"/etc/resolv.conf\" file can be created as follows:\n\n $ sudo echo -n > /etc/resolv.conf" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230316", + "rid": "SV-257948r627750_rule", + "stig_id": "RHEL-08-010680", + "fix_id": "F-32960r567695_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257949", + "code": "control 'SV-257949' do\n title 'RHEL 9 must configure a DNS processing mode set be Network Manager.'\n desc 'In order to ensure that DNS resolver settings are respected, a DNS mode in Network Manager must be configured.'\n desc 'check', 'Verify that RHEL 9 has a DNS mode configured in Network Manager.\n\n$ NetworkManager --print-config\n[main]\ndns=none\n\nIf the dns key under main does not exist or is not set to \"none\" or \"default\", this is a finding.'\n desc 'fix', 'Configure NetworkManager in RHEL 9 to use a DNS mode.\n\nIn \"/etc/NetworkManager/NetworkManager.conf\" add the following line in the \"[main]\" section:\n\ndns = none\n\nNetworkManager must be reloaded for the change to take effect.\n\n$ sudo systemctl reload NetworkManager'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61690r925832_chk'\n tag severity: 'medium'\n tag gid: 'V-257949'\n tag rid: 'SV-257949r925834_rule'\n tag stig_id: 'RHEL-09-252040'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61614r925833_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257949.rb" + }, + "title": "RHEL 9 must configure a DNS processing mode set be Network Manager.", + "desc": "In order to ensure that DNS resolver settings are respected, a DNS mode in Network Manager must be configured.", + "descriptions": { + "default": "In order to ensure that DNS resolver settings are respected, a DNS mode in Network Manager must be configured.", + "check": "Verify that RHEL 9 has a DNS mode configured in Network Manager.\n\n$ NetworkManager --print-config\n[main]\ndns=none\n\nIf the dns key under main does not exist or is not set to \"none\" or \"default\", this is a finding.", + "fix": "Configure NetworkManager in RHEL 9 to use a DNS mode.\n\nIn \"/etc/NetworkManager/NetworkManager.conf\" add the following line in the \"[main]\" section:\n\ndns = none\n\nNetworkManager must be reloaded for the change to take effect.\n\n$ sudo systemctl reload NetworkManager" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61690r925832_chk", + "severity": "medium", + "gid": "V-257949", + "rid": "SV-257949r925834_rule", + "stig_id": "RHEL-09-252040", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61614r925833_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257950", + "code": "control 'SV-257950' do\n title 'RHEL 9 must not have unauthorized IP tunnels configured.'\n desc 'IP tunneling mechanisms can be used to bypass network filtering. If tunneling is required, it must be documented with the information system security officer (ISSO).'\n desc 'check', 'Verify that RHEL 9 does not have unauthorized IP tunnels configured.\n\nDetermine if the \"IPsec\" service is active with the following command:\n\n$ systemctl status ipsec\n\nipsec.service - Internet Key Exchange (IKE) Protocol Daemon for IPsec\nLoaded: loaded (/usr/lib/systemd/system/ipsec.service; disabled)\nActive: inactive (dead)\n\nIf the \"IPsec\" service is active, check for configured IPsec connections (\"conn\"), with the following command:\n\n$ grep -rni conn /etc/ipsec.conf /etc/ipsec.d/ \n\nVerify any returned results are documented with the ISSO.\n\nIf the IPsec tunnels are active and not approved, this is a finding.'\n desc 'fix', 'Remove all unapproved tunnels from the system, or document them with the ISSO.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61691r925835_chk'\n tag severity: 'medium'\n tag gid: 'V-257950'\n tag rid: 'SV-257950r925837_rule'\n tag stig_id: 'RHEL-09-252045'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61615r925836_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257950.rb" + }, + "title": "RHEL 9 must not have unauthorized IP tunnels configured.", + "desc": "IP tunneling mechanisms can be used to bypass network filtering. If tunneling is required, it must be documented with the information system security officer (ISSO).", + "descriptions": { + "default": "IP tunneling mechanisms can be used to bypass network filtering. If tunneling is required, it must be documented with the information system security officer (ISSO).", + "check": "Verify that RHEL 9 does not have unauthorized IP tunnels configured.\n\nDetermine if the \"IPsec\" service is active with the following command:\n\n$ systemctl status ipsec\n\nipsec.service - Internet Key Exchange (IKE) Protocol Daemon for IPsec\nLoaded: loaded (/usr/lib/systemd/system/ipsec.service; disabled)\nActive: inactive (dead)\n\nIf the \"IPsec\" service is active, check for configured IPsec connections (\"conn\"), with the following command:\n\n$ grep -rni conn /etc/ipsec.conf /etc/ipsec.d/ \n\nVerify any returned results are documented with the ISSO.\n\nIf the IPsec tunnels are active and not approved, this is a finding.", + "fix": "Remove all unapproved tunnels from the system, or document them with the ISSO." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61691r925835_chk", + "severity": "medium", + "gid": "V-257950", + "rid": "SV-257950r925837_rule", + "stig_id": "RHEL-09-252045", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61615r925836_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257951", + "code": "control 'SV-257951' do\n title 'RHEL 8 must be configured to prevent unrestricted mail relaying.'\n desc 'If unrestricted mail relaying is permitted, unauthorized senders could\nuse this host as a mail relay for the purpose of sending spam or other\nunauthorized activity.'\n desc 'check', 'Verify the system is configured to prevent unrestricted mail relaying.\n\n Determine if \"postfix\" is installed with the following commands:\n\n $ sudo yum list installed postfix\n\n postfix.x86_64 2:3.3.1-9.el8\n\n If postfix is not installed, this is Not Applicable.\n\n If postfix is installed, determine if it is configured to reject\nconnections from unknown or untrusted networks with the following command:\n\n $ sudo postconf -n smtpd_client_restrictions\n\n smtpd_client_restrictions = permit_mynetworks, reject\n\n If the \"smtpd_client_restrictions\" parameter contains any entries other\nthan \"permit_mynetworks\" and \"reject\", this is a finding.'\n desc 'fix', %q(If \"postfix\" is installed, modify the \"/etc/postfix/main.cf\" file to\nrestrict client connections to the local network with the following command:\n\n $ sudo postconf -e 'smtpd_client_restrictions = permit_mynetworks,reject')\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230550'\n tag rid: 'SV-257951r627750_rule'\n tag stig_id: 'RHEL-08-040290'\n tag fix_id: 'F-33194r568397_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if package('postfix').installed?\n describe command('postconf -n smtpd_client_restrictions') do\n its('stdout.strip') {\n should match(/^smtpd_client_restrictions\\s+=\\s+(permit_mynetworks|reject)($|(,\\s*(permit_mynetworks|reject)\\s*$))/i)\n }\n end\n else\n impact 0.0\n describe 'The `postfix` package is not installed' do\n skip 'The `postfix` package is not installed, this control is Not Applicable'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257951.rb" + }, + "title": "RHEL 8 must be configured to prevent unrestricted mail relaying.", + "desc": "If unrestricted mail relaying is permitted, unauthorized senders could\nuse this host as a mail relay for the purpose of sending spam or other\nunauthorized activity.", + "descriptions": { + "default": "If unrestricted mail relaying is permitted, unauthorized senders could\nuse this host as a mail relay for the purpose of sending spam or other\nunauthorized activity.", + "check": "Verify the system is configured to prevent unrestricted mail relaying.\n\n Determine if \"postfix\" is installed with the following commands:\n\n $ sudo yum list installed postfix\n\n postfix.x86_64 2:3.3.1-9.el8\n\n If postfix is not installed, this is Not Applicable.\n\n If postfix is installed, determine if it is configured to reject\nconnections from unknown or untrusted networks with the following command:\n\n $ sudo postconf -n smtpd_client_restrictions\n\n smtpd_client_restrictions = permit_mynetworks, reject\n\n If the \"smtpd_client_restrictions\" parameter contains any entries other\nthan \"permit_mynetworks\" and \"reject\", this is a finding.", + "fix": "If \"postfix\" is installed, modify the \"/etc/postfix/main.cf\" file to\nrestrict client connections to the local network with the following command:\n\n $ sudo postconf -e 'smtpd_client_restrictions = permit_mynetworks,reject'" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230550", + "rid": "SV-257951r627750_rule", + "stig_id": "RHEL-08-040290", + "fix_id": "F-33194r568397_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257952", + "code": "control 'SV-257952' do\n title 'The Trivial File Transfer Protocol (TFTP) server package must not be\ninstalled if not required for RHEL 8 operational support.'\n desc 'If TFTP is required for operational support (such as the transmission\nof router configurations) its use must be documented with the Information\nSystem Security Officer (ISSO), restricted to only authorized personnel, and\nhave access control rules established.'\n desc 'check', 'Verify a TFTP server has not been installed on the system with the\nfollowing command:\n\n $ sudo yum list installed tftp-server\n\n tftp-server.x86_64 5.2-24.el8\n\n If TFTP is installed and the requirement for TFTP is not documented with\nthe ISSO, this is a finding.'\n desc 'fix', 'Remove the TFTP package from the system with the following command:\n\n$ sudo yum remove tftp-server'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230533'\n tag rid: 'SV-257952r627750_rule'\n tag stig_id: 'RHEL-08-040190'\n tag fix_id: 'F-33177r568346_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if input('tftp_required')\n describe package('tftp-server') do\n it { should be_installed }\n end\n else\n describe package('tftp-server') do\n it { should_not be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257952.rb" + }, + "title": "The Trivial File Transfer Protocol (TFTP) server package must not be\ninstalled if not required for RHEL 8 operational support.", + "desc": "If TFTP is required for operational support (such as the transmission\nof router configurations) its use must be documented with the Information\nSystem Security Officer (ISSO), restricted to only authorized personnel, and\nhave access control rules established.", + "descriptions": { + "default": "If TFTP is required for operational support (such as the transmission\nof router configurations) its use must be documented with the Information\nSystem Security Officer (ISSO), restricted to only authorized personnel, and\nhave access control rules established.", + "check": "Verify a TFTP server has not been installed on the system with the\nfollowing command:\n\n $ sudo yum list installed tftp-server\n\n tftp-server.x86_64 5.2-24.el8\n\n If TFTP is installed and the requirement for TFTP is not documented with\nthe ISSO, this is a finding.", + "fix": "Remove the TFTP package from the system with the following command:\n\n$ sudo yum remove tftp-server" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230533", + "rid": "SV-257952r627750_rule", + "stig_id": "RHEL-08-040190", + "fix_id": "F-33177r568346_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257953", + "code": "control 'SV-257953' do\n title 'RHEL 9 must forward mail from postmaster to the root account using a postfix alias.'\n desc 'It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected.\n\nAudit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.'\n desc 'check', 'Verify that the administrators are notified in the event of an audit processing failure.\n\nCheck that the \"/etc/aliases\" file has a defined value for \"root\".\n\n$ sudo grep \"postmaster:\\\\s*root$\" /etc/aliases\n\nIf the command does not return a line, or the line is commented out, ask the system administrator to indicate how they and the information systems security officer (ISSO) are notified of an audit process failure. If there is no evidence of the proper personnel being notified of an audit processing failure, this is a finding.'\n desc 'fix', 'Configure a valid email address as an alias for the root account.\n\nAppend the following line to \"/etc/aliases\":\n\npostmaster: root\n\nThen, run the following command:\n\n$ sudo newaliases'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61694r925844_chk'\n tag severity: 'medium'\n tag gid: 'V-257953'\n tag rid: 'SV-257953r925846_rule'\n tag stig_id: 'RHEL-09-252060'\n tag gtitle: 'SRG-OS-000046-GPOS-00022'\n tag fix_id: 'F-61618r925845_fix'\n tag 'documentable'\n tag cci: ['CCI-000139']\n tag nist: ['AU-5 a']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257953.rb" + }, + "title": "RHEL 9 must forward mail from postmaster to the root account using a postfix alias.", + "desc": "It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected.\n\nAudit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.", + "descriptions": { + "default": "It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected.\n\nAudit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.", + "check": "Verify that the administrators are notified in the event of an audit processing failure.\n\nCheck that the \"/etc/aliases\" file has a defined value for \"root\".\n\n$ sudo grep \"postmaster:\\s*root$\" /etc/aliases\n\nIf the command does not return a line, or the line is commented out, ask the system administrator to indicate how they and the information systems security officer (ISSO) are notified of an audit process failure. If there is no evidence of the proper personnel being notified of an audit processing failure, this is a finding.", + "fix": "Configure a valid email address as an alias for the root account.\n\nAppend the following line to \"/etc/aliases\":\n\npostmaster: root\n\nThen, run the following command:\n\n$ sudo newaliases" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61694r925844_chk", + "severity": "medium", + "gid": "V-257953", + "rid": "SV-257953r925846_rule", + "stig_id": "RHEL-09-252060", + "gtitle": "SRG-OS-000046-GPOS-00022", + "fix_id": "F-61618r925845_fix", + "documentable": null, + "cci": [ + "CCI-000139" + ], + "nist": [ + "AU-5 a" + ] + } + }, + { + "id": "SV-257954", + "code": "control 'SV-257954' do\n title 'RHEL 9 libreswan package must be installed.'\n desc 'Providing the ability for remote users or systems to initiate a secure VPN connection protects information when it is transmitted over a wide area network.\n\n'\n desc 'check', 'Verify that RHEL 9 libreswan service package is installed.\n\nCheck that the libreswan service package is installed with the following command:\n\n$ sudo dnf list --installed libreswan\n\nExample output:\n\nlibreswan.x86_64 4.6-3.el9\n\nIf the \"libreswan\" package is not installed, this is a finding.'\n desc 'fix', 'Install the libreswan service (if it is not already installed) with the following command:\n\n$ sudo dnf install libreswan'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61695r925847_chk'\n tag severity: 'medium'\n tag gid: 'V-257954'\n tag rid: 'SV-257954r925849_rule'\n tag stig_id: 'RHEL-09-252065'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61619r925848_fix'\n tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000120-GPOS-00061']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-000803']\n tag nist: ['CM-6 b', 'IA-7']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257954.rb" + }, + "title": "RHEL 9 libreswan package must be installed.", + "desc": "Providing the ability for remote users or systems to initiate a secure VPN connection protects information when it is transmitted over a wide area network.\n\n", + "descriptions": { + "default": "Providing the ability for remote users or systems to initiate a secure VPN connection protects information when it is transmitted over a wide area network.\n\n", + "check": "Verify that RHEL 9 libreswan service package is installed.\n\nCheck that the libreswan service package is installed with the following command:\n\n$ sudo dnf list --installed libreswan\n\nExample output:\n\nlibreswan.x86_64 4.6-3.el9\n\nIf the \"libreswan\" package is not installed, this is a finding.", + "fix": "Install the libreswan service (if it is not already installed) with the following command:\n\n$ sudo dnf install libreswan" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61695r925847_chk", + "severity": "medium", + "gid": "V-257954", + "rid": "SV-257954r925849_rule", + "stig_id": "RHEL-09-252065", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61619r925848_fix", + "satisfies": [ + "SRG-OS-000480-GPOS-00227", + "SRG-OS-000120-GPOS-00061" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-000803" + ], + "nist": [ + "CM-6 b", + "IA-7" + ] + } + }, + { + "id": "SV-257955", + "code": "control 'SV-257955' do\n title 'There must be no shosts.equiv files on the RHEL 8 operating system.'\n desc 'The \"shosts.equiv\" files are used to configure host-based\nauthentication for the system via SSH. Host-based authentication is not\nsufficient for preventing unauthorized access to the system, as it does not\nrequire interactive identification and authentication of a connection request,\nor for the use of two-factor authentication.'\n desc 'check', 'Verify there are no \"shosts.equiv\" files on RHEL 8 with the following\ncommand:\n\n $ sudo find / -name shosts.equiv\n\n If a \"shosts.equiv\" file is found, this is a finding.'\n desc 'fix', 'Remove any found \"shosts.equiv\" files from the system.\n\n$ sudo rm /etc/ssh/shosts.equiv'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230283'\n tag rid: 'SV-257955r627750_rule'\n tag stig_id: 'RHEL-08-010460'\n tag fix_id: 'F-32927r567596_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n shosts_files = command('find / -xdev -xautofs -name shosts.equiv').stdout.strip.split(\"\\n\")\n\n describe 'The RHEL8 filesystem' do\n it 'should not have any shosts.equiv files present' do\n expect(shosts_files).to be_empty, \"Discovered shosts files:\\n\\t- #{shosts_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257955.rb" + }, + "title": "There must be no shosts.equiv files on the RHEL 8 operating system.", + "desc": "The \"shosts.equiv\" files are used to configure host-based\nauthentication for the system via SSH. Host-based authentication is not\nsufficient for preventing unauthorized access to the system, as it does not\nrequire interactive identification and authentication of a connection request,\nor for the use of two-factor authentication.", + "descriptions": { + "default": "The \"shosts.equiv\" files are used to configure host-based\nauthentication for the system via SSH. Host-based authentication is not\nsufficient for preventing unauthorized access to the system, as it does not\nrequire interactive identification and authentication of a connection request,\nor for the use of two-factor authentication.", + "check": "Verify there are no \"shosts.equiv\" files on RHEL 8 with the following\ncommand:\n\n $ sudo find / -name shosts.equiv\n\n If a \"shosts.equiv\" file is found, this is a finding.", + "fix": "Remove any found \"shosts.equiv\" files from the system.\n\n$ sudo rm /etc/ssh/shosts.equiv" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230283", + "rid": "SV-257955r627750_rule", + "stig_id": "RHEL-08-010460", + "fix_id": "F-32927r567596_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257956", + "code": "control 'SV-257956' do\n title 'There must be no .shosts files on the RHEL 8 operating system.'\n desc 'The \".shosts\" files are used to configure host-based authentication\nfor individual users or the system via SSH. Host-based authentication is not\nsufficient for preventing unauthorized access to the system, as it does not\nrequire interactive identification and authentication of a connection request,\nor for the use of two-factor authentication.'\n desc 'check', %q(Verify there are no \".shosts\" files on RHEL 8 with the following command:\n\n$ sudo find / -name '*.shosts'\n\nIf any \".shosts\" files are found, this is a finding.)\n desc 'fix', 'Remove any found \".shosts\" files from the system.\n\n$ sudo rm /[path]/[to]/[file]/.shosts'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230284'\n tag rid: 'SV-257956r627750_rule'\n tag stig_id: 'RHEL-08-010470'\n tag fix_id: 'F-32928r567599_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n shosts_files = command('find / -xdev -xautofs -name .shosts').stdout.strip.split(\"\\n\")\n\n describe 'The RHEL8 filesystem' do\n it 'should not have any .shosts files present' do\n expect(shosts_files).to be_empty, \"Discovered .shosts files:\\n\\t- #{shosts_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257956.rb" + }, + "title": "There must be no .shosts files on the RHEL 8 operating system.", + "desc": "The \".shosts\" files are used to configure host-based authentication\nfor individual users or the system via SSH. Host-based authentication is not\nsufficient for preventing unauthorized access to the system, as it does not\nrequire interactive identification and authentication of a connection request,\nor for the use of two-factor authentication.", + "descriptions": { + "default": "The \".shosts\" files are used to configure host-based authentication\nfor individual users or the system via SSH. Host-based authentication is not\nsufficient for preventing unauthorized access to the system, as it does not\nrequire interactive identification and authentication of a connection request,\nor for the use of two-factor authentication.", + "check": "Verify there are no \".shosts\" files on RHEL 8 with the following command:\n\n$ sudo find / -name '*.shosts'\n\nIf any \".shosts\" files are found, this is a finding.", + "fix": "Remove any found \".shosts\" files from the system.\n\n$ sudo rm /[path]/[to]/[file]/.shosts" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230284", + "rid": "SV-257956r627750_rule", + "stig_id": "RHEL-08-010470", + "fix_id": "F-32928r567599_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-257957", + "code": "control 'SV-257957' do\n title 'RHEL 9 must be configured to use TCP syncookies.'\n desc 'Denial of service (DoS) is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n\nManaging excess capacity ensures that sufficient capacity is available to counter flooding attacks. Employing increased capacity and service redundancy may reduce the susceptibility to some DoS attacks. Managing excess capacity may include, for example, establishing selected usage priorities, quotas, or partitioning.\n\n'\n desc 'check', %q(Verify RHEL 9 is configured to use IPv4 TCP syncookies.\n\nDetermine if syncookies are used with the following command:\n\nCheck the status of the kernel.perf_event_paranoid kernel parameter.\n\n$ sysctl net.ipv4.tcp_syncookies\n\nnet.ipv4.tcp_syncookies = 1\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.tcp_syncookies | tail -1\n\nnet.ipv4.tcp_syncookies = 1\n\nIf the network parameter \"ipv4.tcp_syncookies\" is not equal to \"1\" or nothing is returned, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to use TCP syncookies.\n\nAdd or edit the following line in a system configuration file in the \"/etc/sysctl.d/\" directory:\n net.ipv4.tcp_syncookies = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61698r925856_chk'\n tag severity: 'medium'\n tag gid: 'V-257957'\n tag rid: 'SV-257957r925858_rule'\n tag stig_id: 'RHEL-09-253010'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61622r925857_fix'\n tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000420-GPOS-00186', 'SRG-OS-000142-GPOS-00071']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-001095', 'CCI-002385']\n tag nist: ['CM-6 b', 'SC-5 (2)', 'SC-5 a']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257957.rb" + }, + "title": "RHEL 9 must be configured to use TCP syncookies.", + "desc": "Denial of service (DoS) is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n\nManaging excess capacity ensures that sufficient capacity is available to counter flooding attacks. Employing increased capacity and service redundancy may reduce the susceptibility to some DoS attacks. Managing excess capacity may include, for example, establishing selected usage priorities, quotas, or partitioning.\n\n", + "descriptions": { + "default": "Denial of service (DoS) is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n\nManaging excess capacity ensures that sufficient capacity is available to counter flooding attacks. Employing increased capacity and service redundancy may reduce the susceptibility to some DoS attacks. Managing excess capacity may include, for example, establishing selected usage priorities, quotas, or partitioning.\n\n", + "check": "Verify RHEL 9 is configured to use IPv4 TCP syncookies.\n\nDetermine if syncookies are used with the following command:\n\nCheck the status of the kernel.perf_event_paranoid kernel parameter.\n\n$ sysctl net.ipv4.tcp_syncookies\n\nnet.ipv4.tcp_syncookies = 1\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.tcp_syncookies | tail -1\n\nnet.ipv4.tcp_syncookies = 1\n\nIf the network parameter \"ipv4.tcp_syncookies\" is not equal to \"1\" or nothing is returned, this is a finding.", + "fix": "Configure RHEL 9 to use TCP syncookies.\n\nAdd or edit the following line in a system configuration file in the \"/etc/sysctl.d/\" directory:\n net.ipv4.tcp_syncookies = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61698r925856_chk", + "severity": "medium", + "gid": "V-257957", + "rid": "SV-257957r925858_rule", + "stig_id": "RHEL-09-253010", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61622r925857_fix", + "satisfies": [ + "SRG-OS-000480-GPOS-00227", + "SRG-OS-000420-GPOS-00186", + "SRG-OS-000142-GPOS-00071" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-001095", + "CCI-002385" + ], + "nist": [ + "CM-6 b", + "SC-5 (2)", + "SC-5 a" + ] + } + }, + { + "id": "SV-257958", + "code": "control 'SV-257958' do\n title 'RHEL 8 must ignore IPv4 Internet Control Message Protocol (ICMP) redirect messages.'\n desc \"ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\"\n desc 'check', 'Verify RHEL 8 ignores IPv4 ICMP redirect messages.\n\nCheck the value of the \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.accept_redirects\n\nnet.ipv4.conf.all.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.accept_redirects = 0\n\nIf \"net.ipv4.conf.all.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to ignore IPv4 ICMP redirect messages.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244553'\n tag rid: 'SV-257958r858818_rule'\n tag stig_id: 'RHEL-08-040279'\n tag fix_id: 'F-47785r858817_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.all.accept_redirects'\n action = 'IPv4 redirect messages'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257958.rb" + }, + "title": "RHEL 8 must ignore IPv4 Internet Control Message Protocol (ICMP) redirect messages.", + "desc": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 ignores IPv4 ICMP redirect messages.\n\nCheck the value of the \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.accept_redirects\n\nnet.ipv4.conf.all.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.accept_redirects = 0\n\nIf \"net.ipv4.conf.all.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to ignore IPv4 ICMP redirect messages.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244553", + "rid": "SV-257958r858818_rule", + "stig_id": "RHEL-08-040279", + "fix_id": "F-47785r858817_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257959", + "code": "control 'SV-257959' do\n title 'RHEL 8 must not forward IPv4 source-routed packets.'\n desc 'Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 does not accept IPv4 source-routed packets.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.accept_source_route\n\nnet.ipv4.conf.all.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.accept_source_route = 0\n\nIf \"net.ipv4.conf.all.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not forward IPv4 source-routed packets.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244551'\n tag rid: 'SV-257959r858799_rule'\n tag stig_id: 'RHEL-08-040239'\n tag fix_id: 'F-47783r858798_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.all.accept_source_route'\n action = 'IPv4 source-routed packets'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257959.rb" + }, + "title": "RHEL 8 must not forward IPv4 source-routed packets.", + "desc": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not accept IPv4 source-routed packets.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.accept_source_route\n\nnet.ipv4.conf.all.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.accept_source_route = 0\n\nIf \"net.ipv4.conf.all.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not forward IPv4 source-routed packets.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244551", + "rid": "SV-257959r858799_rule", + "stig_id": "RHEL-08-040239", + "fix_id": "F-47783r858798_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257960", + "code": "control 'SV-257960' do\n title 'RHEL 9 must log IPv4 packets with impossible addresses.'\n desc 'The presence of \"martian\" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.'\n desc 'check', %q(Verify RHEL 9 logs IPv4 martian packets.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.log_martians\n\nnet.ipv4.conf.all.log_martians = 1\n\nIf the returned line does not have a value of \"1\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.all.log_martians | tail -1\n\nnet.ipv4.conf.all.log_martians = 1\n\nIf \"net.ipv4.conf.all.log_martians\" is not set to \"1\" or is missing, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to log martian packets on IPv4 interfaces.\n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.log_martians=1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61701r925865_chk'\n tag severity: 'medium'\n tag gid: 'V-257960'\n tag rid: 'SV-257960r925867_rule'\n tag stig_id: 'RHEL-09-253025'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61625r925866_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257960.rb" + }, + "title": "RHEL 9 must log IPv4 packets with impossible addresses.", + "desc": "The presence of \"martian\" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.", + "descriptions": { + "default": "The presence of \"martian\" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.", + "check": "Verify RHEL 9 logs IPv4 martian packets.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.log_martians\n\nnet.ipv4.conf.all.log_martians = 1\n\nIf the returned line does not have a value of \"1\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.all.log_martians | tail -1\n\nnet.ipv4.conf.all.log_martians = 1\n\nIf \"net.ipv4.conf.all.log_martians\" is not set to \"1\" or is missing, this is a finding.", + "fix": "Configure RHEL 9 to log martian packets on IPv4 interfaces.\n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.log_martians=1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61701r925865_chk", + "severity": "medium", + "gid": "V-257960", + "rid": "SV-257960r925867_rule", + "stig_id": "RHEL-09-253025", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61625r925866_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257961", + "code": "control 'SV-257961' do\n title 'RHEL 9 must log IPv4 packets with impossible addresses by default.'\n desc 'The presence of \"martian\" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.'\n desc 'check', %q(Verify RHEL 9 logs IPv4 martian packets by default.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.log_martians\n\nnet.ipv4.conf.default.log_martians = 1\n\nIf the returned line does not have a value of \"1\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.log_martians | tail -1\n\nnet.ipv4.conf.default.log_martians = 1\n\nIf \"net.ipv4.conf.default.log_martians\" is not set to \"1\" or is missing, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to log martian packets on IPv4 interfaces by default.\n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.log_martians=1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61702r925868_chk'\n tag severity: 'medium'\n tag gid: 'V-257961'\n tag rid: 'SV-257961r925870_rule'\n tag stig_id: 'RHEL-09-253030'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61626r925869_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257961.rb" + }, + "title": "RHEL 9 must log IPv4 packets with impossible addresses by default.", + "desc": "The presence of \"martian\" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.", + "descriptions": { + "default": "The presence of \"martian\" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.", + "check": "Verify RHEL 9 logs IPv4 martian packets by default.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.log_martians\n\nnet.ipv4.conf.default.log_martians = 1\n\nIf the returned line does not have a value of \"1\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.log_martians | tail -1\n\nnet.ipv4.conf.default.log_martians = 1\n\nIf \"net.ipv4.conf.default.log_martians\" is not set to \"1\" or is missing, this is a finding.", + "fix": "Configure RHEL 9 to log martian packets on IPv4 interfaces by default.\n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.log_martians=1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61702r925868_chk", + "severity": "medium", + "gid": "V-257961", + "rid": "SV-257961r925870_rule", + "stig_id": "RHEL-09-253030", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61626r925869_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257962", + "code": "control 'SV-257962' do\n title 'RHEL 8 must use reverse path filtering on all IPv4 interfaces.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 uses reverse path filtering on all IPv4 interfaces with the following commands:\n\n$ sudo sysctl net.ipv4.conf.all.rp_filter\n\nnet.ipv4.conf.all.rp_filter = 1\n\nIf the returned line does not have a value of \"1\" or \"2\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.rp_filter /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.rp_filter = 1\n\nIf \"net.ipv4.conf.all.rp_filter\" is not set to \"1\" or \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to use reverse path filtering on all IPv4 interfaces by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nnet.ipv4.conf.all.rp_filter = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230549'\n tag rid: 'SV-257962r858830_rule'\n tag stig_id: 'RHEL-08-040285'\n tag fix_id: 'F-33193r858829_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.all.rp_filter'\n action = 'IPv4 reverse path filtering'\n value = 1\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257962.rb" + }, + "title": "RHEL 8 must use reverse path filtering on all IPv4 interfaces.", + "desc": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 uses reverse path filtering on all IPv4 interfaces with the following commands:\n\n$ sudo sysctl net.ipv4.conf.all.rp_filter\n\nnet.ipv4.conf.all.rp_filter = 1\n\nIf the returned line does not have a value of \"1\" or \"2\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.rp_filter /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.rp_filter = 1\n\nIf \"net.ipv4.conf.all.rp_filter\" is not set to \"1\" or \"2\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to use reverse path filtering on all IPv4 interfaces by adding the following line to a file, in the \"/etc/sysctl.d\" directory:\n\nnet.ipv4.conf.all.rp_filter = 1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nThe system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230549", + "rid": "SV-257962r858830_rule", + "stig_id": "RHEL-08-040285", + "fix_id": "F-33193r858829_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257963", + "code": "control 'SV-257963' do\n title 'RHEL 8 must prevent IPv4 Internet Control Message Protocol (ICMP)\nredirect messages from being accepted.'\n desc \"ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\"\n desc 'check', 'Verify RHEL 8 will not accept IPv4 ICMP redirect messages.\n\nCheck the value of the default \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.accept_redirects\n\nnet.ipv4.conf.default.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.default.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.accept_redirects = 0\n\nIf \"net.ipv4.conf.default.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to prevent IPv4 ICMP redirect messages from being accepted.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244550'\n tag rid: 'SV-257963r858791_rule'\n tag stig_id: 'RHEL-08-040209'\n tag fix_id: 'F-47782r858790_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.default.accept_redirects'\n action = 'accepting IPv4 redirects'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257963.rb" + }, + "title": "RHEL 8 must prevent IPv4 Internet Control Message Protocol (ICMP)\nredirect messages from being accepted.", + "desc": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 will not accept IPv4 ICMP redirect messages.\n\nCheck the value of the default \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.accept_redirects\n\nnet.ipv4.conf.default.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.default.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.accept_redirects = 0\n\nIf \"net.ipv4.conf.default.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to prevent IPv4 ICMP redirect messages from being accepted.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244550", + "rid": "SV-257963r858791_rule", + "stig_id": "RHEL-08-040209", + "fix_id": "F-47782r858790_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257964", + "code": "control 'SV-257964' do\n title 'RHEL 8 must not forward IPv4 source-routed packets by default.'\n desc 'Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 does not accept IPv4 source-routed packets by default.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.accept_source_route\n\nnet.ipv4.conf.default.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.default.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.accept_source_route = 0\n\nIf \"net.ipv4.conf.default.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not forward IPv4 source-routed packets by default.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244552'\n tag rid: 'SV-257964r858803_rule'\n tag stig_id: 'RHEL-08-040249'\n tag fix_id: 'F-47784r858802_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.default.accept_source_route'\n action = 'IPv4 source-routed packets default'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257964.rb" + }, + "title": "RHEL 8 must not forward IPv4 source-routed packets by default.", + "desc": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not accept IPv4 source-routed packets by default.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.accept_source_route\n\nnet.ipv4.conf.default.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.default.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.accept_source_route = 0\n\nIf \"net.ipv4.conf.default.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not forward IPv4 source-routed packets by default.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244552", + "rid": "SV-257964r858803_rule", + "stig_id": "RHEL-08-040249", + "fix_id": "F-47784r858802_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257965", + "code": "control 'SV-257965' do\n title 'RHEL 9 must use a reverse-path filter for IPv4 network traffic when possible by default.'\n desc 'Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface on which they were received. It must not be used on systems that are routers for complicated networks, but is helpful for end hosts and routers serving small networks.'\n desc 'check', %q(Verify RHEL 9 uses reverse path filtering on IPv4 interfaces with the following commands:\n\n$ sudo sysctl net.ipv4.conf.default.rp_filter\n\nnet.ipv4.conf.default.rp_filter = 1\n\nIf the returned line does not have a value of \"1\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.rp_filter | tail -1\n\nnet.ipv4.conf.default.rp_filter = 1\n\nIf \"net.ipv4.conf.default.rp_filter\" is not set to \"1\" or is missing, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to use reverse path filtering on IPv4 interfaces by default.\n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.rp_filter = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61706r925880_chk'\n tag severity: 'medium'\n tag gid: 'V-257965'\n tag rid: 'SV-257965r925882_rule'\n tag stig_id: 'RHEL-09-253050'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61630r925881_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257965.rb" + }, + "title": "RHEL 9 must use a reverse-path filter for IPv4 network traffic when possible by default.", + "desc": "Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface on which they were received. It must not be used on systems that are routers for complicated networks, but is helpful for end hosts and routers serving small networks.", + "descriptions": { + "default": "Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface on which they were received. It must not be used on systems that are routers for complicated networks, but is helpful for end hosts and routers serving small networks.", + "check": "Verify RHEL 9 uses reverse path filtering on IPv4 interfaces with the following commands:\n\n$ sudo sysctl net.ipv4.conf.default.rp_filter\n\nnet.ipv4.conf.default.rp_filter = 1\n\nIf the returned line does not have a value of \"1\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.rp_filter | tail -1\n\nnet.ipv4.conf.default.rp_filter = 1\n\nIf \"net.ipv4.conf.default.rp_filter\" is not set to \"1\" or is missing, this is a finding.", + "fix": "Configure RHEL 9 to use reverse path filtering on IPv4 interfaces by default.\n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.rp_filter = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61706r925880_chk", + "severity": "medium", + "gid": "V-257965", + "rid": "SV-257965r925882_rule", + "stig_id": "RHEL-09-253050", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61630r925881_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257966", + "code": "control 'SV-257966' do\n title 'RHEL 8 must not respond to Internet Control Message Protocol (ICMP)\nechoes sent to a broadcast address.'\n desc 'Responding to broadcast ICMP echoes facilitates network mapping and provides a vector for amplification attacks.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). IPv6 does not implement the same method of broadcast as IPv4. Instead, IPv6 uses multicast addressing to the all-hosts multicast group. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 does not respond to ICMP echoes sent to a broadcast address.\n\nCheck the value of the \"icmp_echo_ignore_broadcasts\" variable with the following command:\n\n$ sudo sysctl net.ipv4.icmp_echo_ignore_broadcasts\n\nnet.ipv4.icmp_echo_ignore_broadcasts = 1\n\nIf the returned line does not have a value of \"1\", a line is not returned, or the retuned line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.icmp_echo_ignore_broadcasts /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.icmp_echo_ignore_broadcasts = 1\n\nIf \"net.ipv4.icmp_echo_ignore_broadcasts\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not respond to IPv4 ICMP echoes sent to a broadcast address.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.icmp_echo_ignore_broadcasts=1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230537'\n tag rid: 'SV-257966r858797_rule'\n tag stig_id: 'RHEL-08-040230'\n tag fix_id: 'F-33181r858796_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.icmp_echo_ignore_broadcasts'\n action = 'IPv4 broadcasts'\n value = 1\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257966.rb" + }, + "title": "RHEL 8 must not respond to Internet Control Message Protocol (ICMP)\nechoes sent to a broadcast address.", + "desc": "Responding to broadcast ICMP echoes facilitates network mapping and provides a vector for amplification attacks.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). IPv6 does not implement the same method of broadcast as IPv4. Instead, IPv6 uses multicast addressing to the all-hosts multicast group. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Responding to broadcast ICMP echoes facilitates network mapping and provides a vector for amplification attacks.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). IPv6 does not implement the same method of broadcast as IPv4. Instead, IPv6 uses multicast addressing to the all-hosts multicast group. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not respond to ICMP echoes sent to a broadcast address.\n\nCheck the value of the \"icmp_echo_ignore_broadcasts\" variable with the following command:\n\n$ sudo sysctl net.ipv4.icmp_echo_ignore_broadcasts\n\nnet.ipv4.icmp_echo_ignore_broadcasts = 1\n\nIf the returned line does not have a value of \"1\", a line is not returned, or the retuned line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.icmp_echo_ignore_broadcasts /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.icmp_echo_ignore_broadcasts = 1\n\nIf \"net.ipv4.icmp_echo_ignore_broadcasts\" is not set to \"1\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not respond to IPv4 ICMP echoes sent to a broadcast address.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.icmp_echo_ignore_broadcasts=1\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230537", + "rid": "SV-257966r858797_rule", + "stig_id": "RHEL-08-040230", + "fix_id": "F-33181r858796_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257967", + "code": "control 'SV-257967' do\n title 'RHEL 9 must limit the number of bogus Internet Control Message Protocol (ICMP) response errors logs.'\n desc 'Some routers will send responses to broadcast frames that violate RFC-1122, which fills up a log file system with many useless error messages. An attacker may take advantage of this and attempt to flood the logs with bogus error logs. Ignoring bogus ICMP error responses reduces log size, although some activity would not be logged.'\n desc 'check', %q(The runtime status of the net.ipv4.icmp_ignore_bogus_error_responses kernel parameter can be queried by running the following command:\n\n$ sudo sysctl net.ipv4.icmp_ignore_bogus_error_responses \n\nnet.ipv4.icmp_ignore_bogus_error_responses = 1\n\nIf \"net.ipv4.icmp_ignore_bogus_error_responses\" is not set to \"1\", this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.icmp_ignore_bogus_error_response | tail -1\n\nnet.ipv4.icmp_ignore_bogus_error_response = 1\n\nIf \"net.ipv4.icmp_ignore_bogus_error_response\" is not set to \"1\" or is missing, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to not log bogus ICMP errors: \n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.icmp_ignore_bogus_error_responses = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61708r925886_chk'\n tag severity: 'medium'\n tag gid: 'V-257967'\n tag rid: 'SV-257967r925888_rule'\n tag stig_id: 'RHEL-09-253060'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61632r925887_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257967.rb" + }, + "title": "RHEL 9 must limit the number of bogus Internet Control Message Protocol (ICMP) response errors logs.", + "desc": "Some routers will send responses to broadcast frames that violate RFC-1122, which fills up a log file system with many useless error messages. An attacker may take advantage of this and attempt to flood the logs with bogus error logs. Ignoring bogus ICMP error responses reduces log size, although some activity would not be logged.", + "descriptions": { + "default": "Some routers will send responses to broadcast frames that violate RFC-1122, which fills up a log file system with many useless error messages. An attacker may take advantage of this and attempt to flood the logs with bogus error logs. Ignoring bogus ICMP error responses reduces log size, although some activity would not be logged.", + "check": "The runtime status of the net.ipv4.icmp_ignore_bogus_error_responses kernel parameter can be queried by running the following command:\n\n$ sudo sysctl net.ipv4.icmp_ignore_bogus_error_responses \n\nnet.ipv4.icmp_ignore_bogus_error_responses = 1\n\nIf \"net.ipv4.icmp_ignore_bogus_error_responses\" is not set to \"1\", this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.icmp_ignore_bogus_error_response | tail -1\n\nnet.ipv4.icmp_ignore_bogus_error_response = 1\n\nIf \"net.ipv4.icmp_ignore_bogus_error_response\" is not set to \"1\" or is missing, this is a finding.", + "fix": "Configure RHEL 9 to not log bogus ICMP errors: \n\nAdd or edit the following line in a single system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.icmp_ignore_bogus_error_responses = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61708r925886_chk", + "severity": "medium", + "gid": "V-257967", + "rid": "SV-257967r925888_rule", + "stig_id": "RHEL-09-253060", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61632r925887_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257968", + "code": "control 'SV-257968' do\n title 'RHEL 8 must not send Internet Control Message Protocol (ICMP)\nredirects.'\n desc %q(ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf)\n desc 'check', 'Verify RHEL 8 does not IPv4 ICMP redirect messages.\n\nCheck the value of the \"all send_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.send_redirects\n\nnet.ipv4.conf.all.send_redirects = 0\n\nIf the returned line does not have a value of \"0\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.send_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.send_redirects = 0\n\nIf \"net.ipv4.conf.all.send_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not allow interfaces to perform IPv4 ICMP redirects.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.send_redirects=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230536'\n tag rid: 'SV-257968r858795_rule'\n tag stig_id: 'RHEL-08-040220'\n tag fix_id: 'F-33180r858794_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.all.send_redirects'\n action = 'IPv4 redirects'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257968.rb" + }, + "title": "RHEL 8 must not send Internet Control Message Protocol (ICMP)\nredirects.", + "desc": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not IPv4 ICMP redirect messages.\n\nCheck the value of the \"all send_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.all.send_redirects\n\nnet.ipv4.conf.all.send_redirects = 0\n\nIf the returned line does not have a value of \"0\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.send_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.send_redirects = 0\n\nIf \"net.ipv4.conf.all.send_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not allow interfaces to perform IPv4 ICMP redirects.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.all.send_redirects=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230536", + "rid": "SV-257968r858795_rule", + "stig_id": "RHEL-08-040220", + "fix_id": "F-33180r858794_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257969", + "code": "control 'SV-257969' do\n title 'RHEL 8 must not allow interfaces to perform Internet Control Message\nProtocol (ICMP) redirects by default.'\n desc %q(ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf)\n desc 'check', 'Verify RHEL 8 does not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default.\n\nCheck the value of the \"default send_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.send_redirects\n\nnet.ipv4.conf.default.send_redirects=0\n\nIf the returned line does not have a value of \"0\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.default.send_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.send_redirects = 0\n\nIf \"net.ipv4.conf.default.send_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.send_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230543'\n tag rid: 'SV-257969r858816_rule'\n tag stig_id: 'RHEL-08-040270'\n tag fix_id: 'F-33187r858815_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.default.send_redirects'\n action = 'IPv4 packet redirects for interfaces'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257969.rb" + }, + "title": "RHEL 8 must not allow interfaces to perform Internet Control Message\nProtocol (ICMP) redirects by default.", + "desc": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table, possibly revealing portions of the network topology.\n\nThere are notable differences between Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6). There is only a directive to disable sending of IPv4 redirected packets. Refer to RFC4294 for an explanation of \"IPv6 Node Requirements\", which resulted in this difference between IPv4 and IPv6.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default.\n\nCheck the value of the \"default send_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv4.conf.default.send_redirects\n\nnet.ipv4.conf.default.send_redirects=0\n\nIf the returned line does not have a value of \"0\", or a line is not returned, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.default.send_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.default.send_redirects = 0\n\nIf \"net.ipv4.conf.default.send_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv4.conf.default.send_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230543", + "rid": "SV-257969r858816_rule", + "stig_id": "RHEL-08-040270", + "fix_id": "F-33187r858815_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257970", + "code": "control 'SV-257970' do\n title 'RHEL 8 must not enable IPv4 packet forwarding unless the system is a router.'\n desc 'Routing protocol daemons are typically used on routers to exchange network\n topology information with other routers. If this software is used when not required,\n system network information may be unnecessarily transmitted across the network.\n\n The sysctl --system command will load settings from all system configuration files.\n\n All configuration files are sorted by their filename in lexicographic order, regardless\n of which of the directories they reside in. If multiple files specify the same option,\n the entry in the file with the lexicographically latest name will take precedence.\n\n Files are read from directories in the following list from top to bottom. Once a file of a\n given filename is loaded, any file of the same name in subsequent directories is ignored.\n\n /etc/sysctl.d/*.conf\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 is not performing IPv4 packet forwarding, unless the system is a router.\n\nCheck that IPv4 forwarding is disabled using the following command:\n\n$ sudo sysctl net.ipv4.conf.all.forwarding\n\nnet.ipv4.conf.all.forwarding = 0\nIf the IPv4 forwarding value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.forwarding /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.forwarding = 0\n\nIf \"net.ipv4.conf.all.forwarding\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not allow IPv4 packet forwarding, unless the system is a router.\n\n Add or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\n net.ipv4.conf.all.forwarding=0\n\n Remove any configurations that conflict with the above from the following locations:\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf\n /etc/sysctl.d/*.conf\n\n Load settings from all system configuration files with the following command:\n\n $ sudo sysctl --system'\n impact 0.5\n tag check_id: 'C-53751r833382_chk'\n tag severity: 'medium'\n tag gid: 'V-250317'\n tag rid: 'SV-257970r858808_rule'\n tag stig_id: 'RHEL-08-040259'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-53705r858807_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv4.conf.all.forwarding'\n action = 'IPv4 packet forwarding'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv4_enabled') == false\n impact 0.0\n describe 'IPv4 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv4 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257970.rb" + }, + "title": "RHEL 8 must not enable IPv4 packet forwarding unless the system is a router.", + "desc": "Routing protocol daemons are typically used on routers to exchange network\n topology information with other routers. If this software is used when not required,\n system network information may be unnecessarily transmitted across the network.\n\n The sysctl --system command will load settings from all system configuration files.\n\n All configuration files are sorted by their filename in lexicographic order, regardless\n of which of the directories they reside in. If multiple files specify the same option,\n the entry in the file with the lexicographically latest name will take precedence.\n\n Files are read from directories in the following list from top to bottom. Once a file of a\n given filename is loaded, any file of the same name in subsequent directories is ignored.\n\n /etc/sysctl.d/*.conf\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf", + "descriptions": { + "default": "Routing protocol daemons are typically used on routers to exchange network\n topology information with other routers. If this software is used when not required,\n system network information may be unnecessarily transmitted across the network.\n\n The sysctl --system command will load settings from all system configuration files.\n\n All configuration files are sorted by their filename in lexicographic order, regardless\n of which of the directories they reside in. If multiple files specify the same option,\n the entry in the file with the lexicographically latest name will take precedence.\n\n Files are read from directories in the following list from top to bottom. Once a file of a\n given filename is loaded, any file of the same name in subsequent directories is ignored.\n\n /etc/sysctl.d/*.conf\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf", + "check": "Verify RHEL 8 is not performing IPv4 packet forwarding, unless the system is a router.\n\nCheck that IPv4 forwarding is disabled using the following command:\n\n$ sudo sysctl net.ipv4.conf.all.forwarding\n\nnet.ipv4.conf.all.forwarding = 0\nIf the IPv4 forwarding value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv4.conf.all.forwarding /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv4.conf.all.forwarding = 0\n\nIf \"net.ipv4.conf.all.forwarding\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not allow IPv4 packet forwarding, unless the system is a router.\n\n Add or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\n net.ipv4.conf.all.forwarding=0\n\n Remove any configurations that conflict with the above from the following locations:\n /run/sysctl.d/*.conf\n /usr/local/lib/sysctl.d/*.conf\n /usr/lib/sysctl.d/*.conf\n /lib/sysctl.d/*.conf\n /etc/sysctl.conf\n /etc/sysctl.d/*.conf\n\n Load settings from all system configuration files with the following command:\n\n $ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "check_id": "C-53751r833382_chk", + "severity": "medium", + "gid": "V-250317", + "rid": "SV-257970r858808_rule", + "stig_id": "RHEL-08-040259", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-53705r858807_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257971", + "code": "control 'SV-257971' do\n title 'RHEL 8 must not accept router advertisements on all IPv6 interfaces.'\n desc 'Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nAn illicit router advertisement message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 does not accept router advertisements on all IPv6 interfaces, unless the system is a router.\n\nNote: If IPv6 is disabled on the system, this requirement is not applicable.\n\nCheck to see if router advertisements are not accepted by using the following command:\n\n$ sudo sysctl net.ipv6.conf.all.accept_ra\n\nnet.ipv6.conf.all.accept_ra = 0\n\nIf the \"accept_ra\" value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.accept_ra /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_ra = 0\n\nIf \"net.ipv6.conf.all.accept_ra\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces unless the system is a router.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.accept_ra=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230541'\n tag rid: 'SV-257971r858812_rule'\n tag stig_id: 'RHEL-08-040261'\n tag fix_id: 'F-33185r858811_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv6.conf.all.accept_ra'\n action = 'IPv6 router advertisements'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv6_enabled') == false\n impact 0.0\n describe 'IPv6 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv6 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257971.rb" + }, + "title": "RHEL 8 must not accept router advertisements on all IPv6 interfaces.", + "desc": "Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nAn illicit router advertisement message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nAn illicit router advertisement message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not accept router advertisements on all IPv6 interfaces, unless the system is a router.\n\nNote: If IPv6 is disabled on the system, this requirement is not applicable.\n\nCheck to see if router advertisements are not accepted by using the following command:\n\n$ sudo sysctl net.ipv6.conf.all.accept_ra\n\nnet.ipv6.conf.all.accept_ra = 0\n\nIf the \"accept_ra\" value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.accept_ra /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_ra = 0\n\nIf \"net.ipv6.conf.all.accept_ra\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces unless the system is a router.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.accept_ra=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230541", + "rid": "SV-257971r858812_rule", + "stig_id": "RHEL-08-040261", + "fix_id": "F-33185r858811_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257972", + "code": "control 'SV-257972' do\n title 'RHEL 8 must ignore IPv6 Internet Control Message Protocol (ICMP)\nredirect messages.'\n desc \"ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\"\n desc 'check', 'Verify RHEL 8 ignores IPv6 ICMP redirect messages.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv6.conf.all.accept_redirects\n\nnet.ipv6.conf.all.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_redirects = 0\n\nIf \"net.ipv6.conf.all.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to ignore IPv6 ICMP redirect messages.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230544'\n tag rid: 'SV-257972r858820_rule'\n tag stig_id: 'RHEL-08-040280'\n tag fix_id: 'F-33188r858819_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv6.conf.all.accept_redirect'\n action = 'accepting IPv6 redirects'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv6_enabled') == false\n impact 0.0\n describe 'IPv6 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv6 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257972.rb" + }, + "title": "RHEL 8 must ignore IPv6 Internet Control Message Protocol (ICMP)\nredirect messages.", + "desc": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 ignores IPv6 ICMP redirect messages.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv6.conf.all.accept_redirects\n\nnet.ipv6.conf.all.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_redirects = 0\n\nIf \"net.ipv6.conf.all.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to ignore IPv6 ICMP redirect messages.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230544", + "rid": "SV-257972r858820_rule", + "stig_id": "RHEL-08-040280", + "fix_id": "F-33188r858819_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257973", + "code": "control 'SV-257973' do\n title 'RHEL 8 must not forward IPv6 source-routed packets.'\n desc 'Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 does not accept IPv6 source-routed packets.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv6.conf.all.accept_source_route\n\nnet.ipv6.conf.all.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_source_route = 0\n\nIf \"net.ipv6.conf.all.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not forward IPv6 source-routed packets.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230538'\n tag rid: 'SV-257973r858801_rule'\n tag stig_id: 'RHEL-08-040240'\n tag fix_id: 'F-33182r858800_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv6.conf.all.accept_source_route'\n action = 'accepting IPv6 source-routed packets'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv6_enabled') == false\n impact 0.0\n describe 'IPv6 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv6 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257973.rb" + }, + "title": "RHEL 8 must not forward IPv6 source-routed packets.", + "desc": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not accept IPv6 source-routed packets.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv6.conf.all.accept_source_route\n\nnet.ipv6.conf.all.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.accept_source_route = 0\n\nIf \"net.ipv6.conf.all.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not forward IPv6 source-routed packets.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230538", + "rid": "SV-257973r858801_rule", + "stig_id": "RHEL-08-040240", + "fix_id": "F-33182r858800_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257974", + "code": "control 'SV-257974' do\n title 'RHEL 8 must not enable IPv6 packet forwarding unless the system is a router.'\n desc 'Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 is not performing IPv6 packet forwarding, unless the system is a router.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck that IPv6 forwarding is disabled using the following commands:\n\n$ sudo sysctl net.ipv6.conf.all.forwarding\n\nnet.ipv6.conf.all.forwarding = 0\n\nIf the IPv6 forwarding value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.forwarding /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.forwarding = 0\n\nIf \"net.ipv6.conf.all.forwarding\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not allow IPv6 packet forwarding, unless the system is a router.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.forwarding=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230540'\n tag rid: 'SV-257974r858810_rule'\n tag stig_id: 'RHEL-08-040260'\n tag fix_id: 'F-33184r858809_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv6.conf.all.forwarding'\n action = 'IPv6 packet forwarding'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv6_enabled') == false\n impact 0.0\n describe 'IPv6 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv6 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257974.rb" + }, + "title": "RHEL 8 must not enable IPv6 packet forwarding unless the system is a router.", + "desc": "Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 is not performing IPv6 packet forwarding, unless the system is a router.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck that IPv6 forwarding is disabled using the following commands:\n\n$ sudo sysctl net.ipv6.conf.all.forwarding\n\nnet.ipv6.conf.all.forwarding = 0\n\nIf the IPv6 forwarding value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.all.forwarding /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.all.forwarding = 0\n\nIf \"net.ipv6.conf.all.forwarding\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not allow IPv6 packet forwarding, unless the system is a router.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.all.forwarding=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230540", + "rid": "SV-257974r858810_rule", + "stig_id": "RHEL-08-040260", + "fix_id": "F-33184r858809_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257975", + "code": "control 'SV-257975' do\n title 'RHEL 8 must not accept router advertisements on all IPv6 interfaces by\ndefault.'\n desc 'Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nAn illicit router advertisement message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 does not accept router advertisements on all IPv6 interfaces by default, unless the system is a router.\n\nNote: If IPv6 is disabled on the system, this requirement is not applicable.\n\nCheck to see if router advertisements are not accepted by default by using the following command:\n\n$ sudo sysctl net.ipv6.conf.default.accept_ra\n\nnet.ipv6.conf.default.accept_ra = 0\n\nIf the \"accept_ra\" value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.default.accept_ra /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_ra = 0\n\nIf \"net.ipv6.conf.default.accept_ra\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces by default unless the system is a router.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.default.accept_ra=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230542'\n tag rid: 'SV-257975r858814_rule'\n tag stig_id: 'RHEL-08-040262'\n tag fix_id: 'F-33186r858813_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv6.conf.default.accept_ra'\n action = 'IPv6 router advertisements (by default for all interfaces)'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv6_enabled') == false\n impact 0.0\n describe 'IPv6 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv6 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257975.rb" + }, + "title": "RHEL 8 must not accept router advertisements on all IPv6 interfaces by\ndefault.", + "desc": "Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nAn illicit router advertisement message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this software is used when not required, system network information may be unnecessarily transmitted across the network.\n\nAn illicit router advertisement message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not accept router advertisements on all IPv6 interfaces by default, unless the system is a router.\n\nNote: If IPv6 is disabled on the system, this requirement is not applicable.\n\nCheck to see if router advertisements are not accepted by default by using the following command:\n\n$ sudo sysctl net.ipv6.conf.default.accept_ra\n\nnet.ipv6.conf.default.accept_ra = 0\n\nIf the \"accept_ra\" value is not \"0\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.default.accept_ra /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_ra = 0\n\nIf \"net.ipv6.conf.default.accept_ra\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not accept router advertisements on all IPv6 interfaces by default unless the system is a router.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.default.accept_ra=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230542", + "rid": "SV-257975r858814_rule", + "stig_id": "RHEL-08-040262", + "fix_id": "F-33186r858813_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257976", + "code": "control 'SV-257976' do\n title 'RHEL 8 must prevent IPv6 Internet Control Message Protocol (ICMP)\nredirect messages from being accepted.'\n desc \"ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\"\n desc 'check', 'Verify RHEL 8 will not accept IPv6 ICMP redirect messages.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the default \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv6.conf.default.accept_redirects\n\nnet.ipv6.conf.default.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.default.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_redirects = 0\n\nIf \"net.ipv6.conf.default.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to prevent IPv6 ICMP redirect messages from being accepted.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.default.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230535'\n tag rid: 'SV-257976r858793_rule'\n tag stig_id: 'RHEL-08-040210'\n tag fix_id: 'F-33179r858792_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv6.conf.default.accept_redirects'\n action = 'accepting IPv6 redirects'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv6_enabled') == false\n impact 0.0\n describe 'IPv6 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv6 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257976.rb" + }, + "title": "RHEL 8 must prevent IPv6 Internet Control Message Protocol (ICMP)\nredirect messages from being accepted.", + "desc": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 will not accept IPv6 ICMP redirect messages.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the default \"accept_redirects\" variables with the following command:\n\n$ sudo sysctl net.ipv6.conf.default.accept_redirects\n\nnet.ipv6.conf.default.accept_redirects = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.default.accept_redirects /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_redirects = 0\n\nIf \"net.ipv6.conf.default.accept_redirects\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to prevent IPv6 ICMP redirect messages from being accepted.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.default.accept_redirects = 0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230535", + "rid": "SV-257976r858793_rule", + "stig_id": "RHEL-08-040210", + "fix_id": "F-33179r858792_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257977", + "code": "control 'SV-257977' do\n title 'RHEL 8 must not forward IPv6 source-routed packets by default.'\n desc 'Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf'\n desc 'check', 'Verify RHEL 8 does not accept IPv6 source-routed packets by default.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv6.conf.default.accept_source_route\n\nnet.ipv6.conf.default.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.default.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_source_route = 0\n\nIf \"net.ipv6.conf.default.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to not forward IPv6 source-routed packets by default.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.default.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230539'\n tag rid: 'SV-257977r861085_rule'\n tag stig_id: 'RHEL-08-040250'\n tag fix_id: 'F-33183r858805_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This system is acting as a router on the network, this control is Not Applicable', impact: 0.0) {\n !input('network_router')\n }\n\n # Define the kernel parameter to be checked\n parameter = 'net.ipv6.conf.default.accept_source_route'\n action = 'forwarding IPv6 source-routed packets'\n value = 0\n\n # Get the current value of the kernel parameter\n current_value = kernel_parameter(parameter)\n\n # Check if the system is a Docker container\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable within a container' do\n skip 'Control not applicable within a container'\n end\n elsif input('ipv6_enabled') == false\n impact 0.0\n describe 'IPv6 is disabled on the system, this requirement is Not Applicable.' do\n skip 'IPv6 is disabled on the system, this requirement is Not Applicable.'\n end\n else\n\n describe kernel_parameter(parameter) do\n it 'is disabled in sysctl -a' do\n expect(current_value.value).to cmp value\n expect(current_value.value).not_to be_nil\n end\n end\n\n # Get the list of sysctl configuration files\n sysctl_config_files = input('sysctl_conf_files').map(&:strip).join(' ')\n\n # Search for the kernel parameter in the configuration files\n search_results = command(\"grep -r #{parameter} #{sysctl_config_files} {} \\;\").stdout.split(\"\\n\")\n\n # Parse the search results into a hash\n config_values = search_results.each_with_object({}) do |item, results|\n file, setting = item.split(':')\n results[file] ||= []\n results[file] << setting.split('=').last\n end\n\n uniq_config_values = config_values.values.flatten.map(&:strip).map(&:to_i).uniq\n\n # Check the configuration files\n describe 'Configuration files' do\n if search_results.empty?\n it \"do not explicitly set the `#{parameter}` parameter\" do\n expect(config_values).not_to be_empty, \"Add the line `#{parameter}=#{value}` to a file in the `/etc/sysctl.d/` directory\"\n end\n else\n it \"do not have conflicting settings for #{action}\" do\n expect(uniq_config_values.count).to eq(1), \"Expected one unique configuration, but got #{config_values}\"\n end\n it \"set the parameter to the right value for #{action}\" do\n expect(config_values.values.flatten.all? { |v| v.to_i.eql?(value) }).to be true\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257977.rb" + }, + "title": "RHEL 8 must not forward IPv6 source-routed packets by default.", + "desc": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "descriptions": { + "default": "Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.\n\nThe sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.\n/etc/sysctl.d/*.conf\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf", + "check": "Verify RHEL 8 does not accept IPv6 source-routed packets by default.\n\nNote: If IPv6 is disabled on the system, this requirement is Not Applicable.\n\nCheck the value of the accept source route variable with the following command:\n\n$ sudo sysctl net.ipv6.conf.default.accept_source_route\n\nnet.ipv6.conf.default.accept_source_route = 0\n\nIf the returned line does not have a value of \"0\", a line is not returned, or the line is commented out, this is a finding.\n\nCheck that the configuration files are present to enable this network parameter.\n\n$ sudo grep -r net.ipv6.conf.default.accept_source_route /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf /etc/sysctl.d/*.conf\n\n/etc/sysctl.d/99-sysctl.conf: net.ipv6.conf.default.accept_source_route = 0\n\nIf \"net.ipv6.conf.default.accept_source_route\" is not set to \"0\", is missing or commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to not forward IPv6 source-routed packets by default.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nnet.ipv6.conf.default.accept_source_route=0\n\nRemove any configurations that conflict with the above from the following locations:\n/run/sysctl.d/*.conf\n/usr/local/lib/sysctl.d/*.conf\n/usr/lib/sysctl.d/*.conf\n/lib/sysctl.d/*.conf\n/etc/sysctl.conf\n/etc/sysctl.d/*.conf\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230539", + "rid": "SV-257977r861085_rule", + "stig_id": "RHEL-08-040250", + "fix_id": "F-33183r858805_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-257978", + "code": "control 'SV-257978' do\n title 'All RHEL 8 networked systems must have SSH installed.'\n desc 'Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.'\n desc 'check', 'Verify SSH is installed with the following command:\n\n$ sudo yum list installed openssh-server\n\nopenssh-server.x86_64 8.0p1-5.el8 @anaconda\n\nIf the \"SSH server\" package is not installed, this is a finding.'\n desc 'fix', 'Install SSH packages onto the host with the following command:\n\n$ sudo yum install openssh-server.x86_64'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000423-GPOS-00187'\n tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190']\n tag gid: 'V-244549'\n tag rid: 'SV-257978r916422_rule'\n tag stig_id: 'RHEL-08-040159'\n tag fix_id: 'F-47781r743895_fix'\n tag cci: ['CCI-002418']\n tag nist: ['SC-8']\n tag 'host'\n tag 'container-conditional'\n\n openssh_present = package('openssh-server').installed?\n\n only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !openssh_present)\n }\n\n if input('allow_container_openssh_server') == false\n describe 'In a container Environment' do\n it 'the OpenSSH Server should be installed only when allowed in a container environment' do\n expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment'\n end\n end\n else\n describe 'In a machine environment' do\n it 'the OpenSSH Server should be installed' do\n expect(package('openssh-server').installed?).to eq(true), 'the OpenSSH Server is not installed'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257978.rb" + }, + "title": "All RHEL 8 networked systems must have SSH installed.", + "desc": "Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.", + "descriptions": { + "default": "Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.", + "check": "Verify SSH is installed with the following command:\n\n$ sudo yum list installed openssh-server\n\nopenssh-server.x86_64 8.0p1-5.el8 @anaconda\n\nIf the \"SSH server\" package is not installed, this is a finding.", + "fix": "Install SSH packages onto the host with the following command:\n\n$ sudo yum install openssh-server.x86_64" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000423-GPOS-00187", + "satisfies": [ + "SRG-OS-000423-GPOS-00187", + "SRG-OS-000424-GPOS-00188", + "SRG-OS-000425-GPOS-00189", + "SRG-OS-000426-GPOS-00190" + ], + "gid": "V-244549", + "rid": "SV-257978r916422_rule", + "stig_id": "RHEL-08-040159", + "fix_id": "F-47781r743895_fix", + "cci": [ + "CCI-002418" + ], + "nist": [ + "SC-8" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257979", + "code": "control 'SV-257979' do\n title 'All RHEL 8 networked systems must have and implement SSH to protect\nthe confidentiality and integrity of transmitted and received information, as\nwell as information during preparation for transmission.'\n desc 'Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.'\n desc 'check', 'Verify SSH is loaded and active with the following command:\n\n $ sudo systemctl status sshd\n\n sshd.service - OpenSSH server daemon\n Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)\n Active: active (running) since Tue 2015-11-17 15:17:22 EST; 4 weeks 0 days\nago\n Main PID: 1348 (sshd)\n CGroup: /system.slice/sshd.service\n 1053 /usr/sbin/sshd -D\n\n If \"sshd\" does not show a status of \"active\" and \"running\", this is a\nfinding.'\n desc 'fix', 'Configure the SSH service to automatically start after reboot with the\nfollowing command:\n\n $ sudo systemctl enable sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000423-GPOS-00187'\n tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190']\n tag gid: 'V-230526'\n tag rid: 'SV-257979r916422_rule'\n tag stig_id: 'RHEL-08-040160'\n tag fix_id: 'F-33170r744031_fix'\n tag cci: ['CCI-002418']\n tag nist: ['SC-8']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe systemd_service('sshd.service') do\n it { should be_running }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257979.rb" + }, + "title": "All RHEL 8 networked systems must have and implement SSH to protect\nthe confidentiality and integrity of transmitted and received information, as\nwell as information during preparation for transmission.", + "desc": "Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.", + "descriptions": { + "default": "Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.", + "check": "Verify SSH is loaded and active with the following command:\n\n $ sudo systemctl status sshd\n\n sshd.service - OpenSSH server daemon\n Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)\n Active: active (running) since Tue 2015-11-17 15:17:22 EST; 4 weeks 0 days\nago\n Main PID: 1348 (sshd)\n CGroup: /system.slice/sshd.service\n 1053 /usr/sbin/sshd -D\n\n If \"sshd\" does not show a status of \"active\" and \"running\", this is a\nfinding.", + "fix": "Configure the SSH service to automatically start after reboot with the\nfollowing command:\n\n $ sudo systemctl enable sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000423-GPOS-00187", + "satisfies": [ + "SRG-OS-000423-GPOS-00187", + "SRG-OS-000424-GPOS-00188", + "SRG-OS-000425-GPOS-00189", + "SRG-OS-000426-GPOS-00190" + ], + "gid": "V-230526", + "rid": "SV-257979r916422_rule", + "stig_id": "RHEL-08-040160", + "fix_id": "F-33170r744031_fix", + "cci": [ + "CCI-002418" + ], + "nist": [ + "SC-8" + ], + "host": null + } + }, + { + "id": "SV-257980", + "code": "control 'SV-257980' do\n title 'RHEL 9 must have the openssh-clients package installed.'\n desc 'This package includes utilities to make encrypted connections and transfer files securely to SSH servers.'\n desc 'check', 'Verify that RHEL 9 has the openssh-clients package installed with the following command:\n\n$ sudo dnf list --installed openssh-clients\n\nExample output:\n\nopenssh-clients.x86_64 8.7p1-8.el9\n\nIf the \"openssh-clients\" package is not installed, this is a finding.'\n desc 'fix', 'The openssh-clients package can be installed with the following command:\n \n$ sudo dnf install openssh-clients'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61721r925925_chk'\n tag severity: 'medium'\n tag gid: 'V-257980'\n tag rid: 'SV-257980r928960_rule'\n tag stig_id: 'RHEL-09-255020'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61645r928960_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257980.rb" + }, + "title": "RHEL 9 must have the openssh-clients package installed.", + "desc": "This package includes utilities to make encrypted connections and transfer files securely to SSH servers.", + "descriptions": { + "default": "This package includes utilities to make encrypted connections and transfer files securely to SSH servers.", + "check": "Verify that RHEL 9 has the openssh-clients package installed with the following command:\n\n$ sudo dnf list --installed openssh-clients\n\nExample output:\n\nopenssh-clients.x86_64 8.7p1-8.el9\n\nIf the \"openssh-clients\" package is not installed, this is a finding.", + "fix": "The openssh-clients package can be installed with the following command:\n \n$ sudo dnf install openssh-clients" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61721r925925_chk", + "severity": "medium", + "gid": "V-257980", + "rid": "SV-257980r928960_rule", + "stig_id": "RHEL-09-255020", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61645r928960_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257981", + "code": "control 'SV-257981' do\n title 'RHEL 8 must display the Standard Mandatory DoD Notice and Consent\nBanner before granting local or remote access to the system via a ssh logon.'\n desc %q(Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.\n\nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist.\n\nThe banner must be formatted in accordance with applicable DoD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters:\n\n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\n\nBy using this IS (which includes any device attached to this IS), you consent to the following conditions:\n\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\n\n-At any time, the USG may inspect and seize data stored on this IS.\n\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\n\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\n\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\"\n\nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner:\n\n\"I've read & consent to terms in IS user agreem't.\")\n desc 'check', 'Verify any publicly accessible connection to the operating system displays the Standard Mandatory DoD Notice and Consent Banner before granting access to the system.\n\nCheck for the location of the banner file being used with the following command:\n\n$ sudo grep -ir banner /etc/ssh/sshd_config*\n\nbanner /etc/issue\n\nThis command will return the banner keyword and the name of the file that contains the ssh banner (in this case \"/etc/issue\").\n\nIf the line is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.\n\nView the file specified by the banner keyword to check that it matches the text of the Standard Mandatory DoD Notice and Consent Banner:\n\n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions:\n\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\n\n-At any time, the USG may inspect and seize data stored on this IS.\n\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\n\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\n\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\"\n\nIf the system does not display a graphical logon banner or the banner does not match the Standard Mandatory DoD Notice and Consent Banner, this is a finding.\n\nIf the text in the file does not match the Standard Mandatory DoD Notice and Consent Banner, this is a finding.'\n desc 'fix', 'Configure the operating system to display the Standard Mandatory DoD Notice\nand Consent Banner before granting access to the system via the ssh.\n\n Edit the \"/etc/ssh/sshd_config\" file to uncomment the banner keyword and\nconfigure it to point to a file that will contain the logon banner (this file\nmay be named differently or be in a different location if using a version of\nSSH that is provided by a third-party vendor). An example configuration line is:\n\n banner /etc/issue\n\n Either create the file containing the banner or replace the text in the\nfile with the Standard Mandatory DoD Notice and Consent Banner. The\nDoD-required text is:\n\n \"You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only. By using this IS (which includes any\ndevice attached to this IS), you consent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests--not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.\"\n\n The SSH service must be restarted for changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000023-GPOS-00006'\n tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088']\n tag gid: 'V-230225'\n tag rid: 'SV-257981r858694_rule'\n tag stig_id: 'RHEL-08-010040'\n tag fix_id: 'F-32869r567422_fix'\n tag cci: ['CCI-000048']\n tag nist: ['AC-8 a']\n tag 'host'\n tag 'container-conditional'\n\n only_if('Control not applicable - SSH is not installed within containerized RHEL', impact: 0.0) {\n !virtualization.system.eql?('docker') || file('/etc/ssh/sshd_config').exist?\n }\n\n # When Banner is commented, not found, disabled, or the specified file does not exist, this is a finding.\n banner_file = sshd_config.banner\n\n # Banner property is commented out.\n if banner_file.nil?\n describe 'The SSHD Banner is not set' do\n subject { banner_file.nil? }\n it { should be false }\n end\n end\n\n # Banner property is set to \"none\"\n if !banner_file.nil? && !banner_file.match(/none/i).nil?\n describe 'The SSHD Banner is disabled' do\n subject { banner_file.match(/none/i).nil? }\n it { should be true }\n end\n end\n\n # Banner property provides a path to a file, however, it does not exist.\n if !banner_file.nil? && banner_file.match(/none/i).nil? && !file(banner_file).exist?\n describe 'The SSHD Banner is set, but, the file does not exist' do\n subject { file(banner_file).exist? }\n it { should be true }\n end\n end\n\n # Banner property provides a path to a file and it exists.\n next unless !banner_file.nil? && banner_file.match(/none/i).nil? && file(banner_file).exist?\n\n banner = file(banner_file).content.gsub(/[\\r\\n\\s]/, '')\n expected_banner = input('banner_message_text_ral').gsub(/[\\r\\n\\s]/, '')\n\n describe 'The SSHD Banner' do\n it 'is set to the standard banner and has the correct text' do\n expect(banner).to eq(expected_banner), 'Banner does not match expected text'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257981.rb" + }, + "title": "RHEL 8 must display the Standard Mandatory DoD Notice and Consent\nBanner before granting local or remote access to the system via a ssh logon.", + "desc": "Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.\n\nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist.\n\nThe banner must be formatted in accordance with applicable DoD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters:\n\n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\n\nBy using this IS (which includes any device attached to this IS), you consent to the following conditions:\n\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\n\n-At any time, the USG may inspect and seize data stored on this IS.\n\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\n\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\n\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\"\n\nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner:\n\n\"I've read & consent to terms in IS user agreem't.\"", + "descriptions": { + "default": "Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.\n\nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist.\n\nThe banner must be formatted in accordance with applicable DoD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters:\n\n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\n\nBy using this IS (which includes any device attached to this IS), you consent to the following conditions:\n\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\n\n-At any time, the USG may inspect and seize data stored on this IS.\n\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\n\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\n\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\"\n\nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner:\n\n\"I've read & consent to terms in IS user agreem't.\"", + "check": "Verify any publicly accessible connection to the operating system displays the Standard Mandatory DoD Notice and Consent Banner before granting access to the system.\n\nCheck for the location of the banner file being used with the following command:\n\n$ sudo grep -ir banner /etc/ssh/sshd_config*\n\nbanner /etc/issue\n\nThis command will return the banner keyword and the name of the file that contains the ssh banner (in this case \"/etc/issue\").\n\nIf the line is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.\n\nView the file specified by the banner keyword to check that it matches the text of the Standard Mandatory DoD Notice and Consent Banner:\n\n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions:\n\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\n\n-At any time, the USG may inspect and seize data stored on this IS.\n\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\n\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\n\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\"\n\nIf the system does not display a graphical logon banner or the banner does not match the Standard Mandatory DoD Notice and Consent Banner, this is a finding.\n\nIf the text in the file does not match the Standard Mandatory DoD Notice and Consent Banner, this is a finding.", + "fix": "Configure the operating system to display the Standard Mandatory DoD Notice\nand Consent Banner before granting access to the system via the ssh.\n\n Edit the \"/etc/ssh/sshd_config\" file to uncomment the banner keyword and\nconfigure it to point to a file that will contain the logon banner (this file\nmay be named differently or be in a different location if using a version of\nSSH that is provided by a third-party vendor). An example configuration line is:\n\n banner /etc/issue\n\n Either create the file containing the banner or replace the text in the\nfile with the Standard Mandatory DoD Notice and Consent Banner. The\nDoD-required text is:\n\n \"You are accessing a U.S. Government (USG) Information System (IS) that is\nprovided for USG-authorized use only. By using this IS (which includes any\ndevice attached to this IS), you consent to the following conditions:\n\n -The USG routinely intercepts and monitors communications on this IS for\npurposes including, but not limited to, penetration testing, COMSEC monitoring,\nnetwork operations and defense, personnel misconduct (PM), law enforcement\n(LE), and counterintelligence (CI) investigations.\n\n -At any time, the USG may inspect and seize data stored on this IS.\n\n -Communications using, or data stored on, this IS are not private, are\nsubject to routine monitoring, interception, and search, and may be disclosed\nor used for any USG-authorized purpose.\n\n -This IS includes security measures (e.g., authentication and access\ncontrols) to protect USG interests--not for your personal benefit or privacy.\n\n -Notwithstanding the above, using this IS does not constitute consent to\nPM, LE or CI investigative searching or monitoring of the content of privileged\ncommunications, or work product, related to personal representation or services\nby attorneys, psychotherapists, or clergy, and their assistants. Such\ncommunications and work product are private and confidential. See User\nAgreement for details.\"\n\n The SSH service must be restarted for changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000023-GPOS-00006", + "satisfies": [ + "SRG-OS-000023-GPOS-00006", + "SRG-OS-000228-GPOS-00088" + ], + "gid": "V-230225", + "rid": "SV-257981r858694_rule", + "stig_id": "RHEL-08-010040", + "fix_id": "F-32869r567422_fix", + "cci": [ + "CCI-000048" + ], + "nist": [ + "AC-8 a" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257982", + "code": "control 'SV-257982' do\n title 'RHEL 9 must log SSH connection attempts and failures to the server.'\n desc 'SSH provides several logging levels with varying amounts of verbosity. \"DEBUG\" is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. \"INFO\" or \"VERBOSE\" level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.'\n desc 'check', %q(Verify RHEL 9 logs SSH connection attempts and failures to the server.\n\nCheck what the SSH daemon's \"LogLevel\" option is set to with the following command:\n\n$ sudo grep -i LogLevel /etc/ssh/sshd_config\n\nLogLevel VERBOSE\n\nIf a value of \"VERBOSE\" is not returned, the line is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to log connection attempts add or modify the following line in \"/etc/ssh/sshd_config\".\n\nLogLevel VERBOSE\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61723r925931_chk'\n tag severity: 'medium'\n tag gid: 'V-257982'\n tag rid: 'SV-257982r925933_rule'\n tag stig_id: 'RHEL-09-255030'\n tag gtitle: 'SRG-OS-000032-GPOS-00013'\n tag fix_id: 'F-61647r925932_fix'\n tag 'documentable'\n tag cci: ['CCI-000067']\n tag nist: ['AC-17 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257982.rb" + }, + "title": "RHEL 9 must log SSH connection attempts and failures to the server.", + "desc": "SSH provides several logging levels with varying amounts of verbosity. \"DEBUG\" is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. \"INFO\" or \"VERBOSE\" level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.", + "descriptions": { + "default": "SSH provides several logging levels with varying amounts of verbosity. \"DEBUG\" is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. \"INFO\" or \"VERBOSE\" level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.", + "check": "Verify RHEL 9 logs SSH connection attempts and failures to the server.\n\nCheck what the SSH daemon's \"LogLevel\" option is set to with the following command:\n\n$ sudo grep -i LogLevel /etc/ssh/sshd_config\n\nLogLevel VERBOSE\n\nIf a value of \"VERBOSE\" is not returned, the line is commented out, or is missing, this is a finding.", + "fix": "Configure RHEL 9 to log connection attempts add or modify the following line in \"/etc/ssh/sshd_config\".\n\nLogLevel VERBOSE\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61723r925931_chk", + "severity": "medium", + "gid": "V-257982", + "rid": "SV-257982r925933_rule", + "stig_id": "RHEL-09-255030", + "gtitle": "SRG-OS-000032-GPOS-00013", + "fix_id": "F-61647r925932_fix", + "documentable": null, + "cci": [ + "CCI-000067" + ], + "nist": [ + "AC-17 (1)" + ] + } + }, + { + "id": "SV-257983", + "code": "control 'SV-257983' do\n title 'RHEL 9 SSHD must accept public key authentication.'\n desc 'Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. A DOD CAC with DOD-approved PKI is an example of multifactor authentication.\n\n'\n desc 'check', 'Verify that RHEL 9 SSH daemon accepts public key encryption with the following command:\n \n$ sudo grep -i PubkeyAuthentication /etc/ssh/sshd_config\n\nPubkeyAuthentication yes\n \nIf \"PubkeyAuthentication\" is set to no, the line is commented out, or the line is missing, this is a finding.'\n desc 'fix', 'To configure the system add or modify the following line in \"/etc/ssh/sshd_config\".\n\nPubkeyAuthentication yes\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61724r925934_chk'\n tag severity: 'medium'\n tag gid: 'V-257983'\n tag rid: 'SV-257983r925936_rule'\n tag stig_id: 'RHEL-09-255035'\n tag gtitle: 'SRG-OS-000105-GPOS-00052'\n tag fix_id: 'F-61648r925935_fix'\n tag satisfies: ['SRG-OS-000105-GPOS-00052', 'SRG-OS-000106-GPOS-00053', 'SRG-OS-000107-GPOS-00054', 'SRG-OS-000108-GPOS-00055']\n tag 'documentable'\n tag cci: ['CCI-000765', 'CCI-000766', 'CCI-000767', 'CCI-000768']\n tag nist: ['IA-2 (1)', 'IA-2 (2)', 'IA-2 (3)', 'IA-2 (4)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257983.rb" + }, + "title": "RHEL 9 SSHD must accept public key authentication.", + "desc": "Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. A DOD CAC with DOD-approved PKI is an example of multifactor authentication.\n\n", + "descriptions": { + "default": "Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. A DOD CAC with DOD-approved PKI is an example of multifactor authentication.\n\n", + "check": "Verify that RHEL 9 SSH daemon accepts public key encryption with the following command:\n \n$ sudo grep -i PubkeyAuthentication /etc/ssh/sshd_config\n\nPubkeyAuthentication yes\n \nIf \"PubkeyAuthentication\" is set to no, the line is commented out, or the line is missing, this is a finding.", + "fix": "To configure the system add or modify the following line in \"/etc/ssh/sshd_config\".\n\nPubkeyAuthentication yes\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61724r925934_chk", + "severity": "medium", + "gid": "V-257983", + "rid": "SV-257983r925936_rule", + "stig_id": "RHEL-09-255035", + "gtitle": "SRG-OS-000105-GPOS-00052", + "fix_id": "F-61648r925935_fix", + "satisfies": [ + "SRG-OS-000105-GPOS-00052", + "SRG-OS-000106-GPOS-00053", + "SRG-OS-000107-GPOS-00054", + "SRG-OS-000108-GPOS-00055" + ], + "documentable": null, + "cci": [ + "CCI-000765", + "CCI-000766", + "CCI-000767", + "CCI-000768" + ], + "nist": [ + "IA-2 (1)", + "IA-2 (2)", + "IA-2 (3)", + "IA-2 (4)" + ] + } + }, + { + "id": "SV-257984", + "code": "control 'SV-257984' do\n title 'RHEL 9 SSHD must not allow blank passwords.'\n desc 'If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.\n\n'\n desc 'check', 'Verify RHEL 9 remote access using SSH prevents logging on with a blank password with the following command:\n\n$ sudo grep -i PermitEmptyPasswords /etc/ssh/sshd_config\n\nPermitEmptyPassword no\n\nIf the \"PermitEmptyPassword\" keyword is set to \"yes\", is missing, or is commented out, this is a finding.'\n desc 'fix', 'To configure the system to prevent SSH users from logging on with blank passwords edit the following line in \"etc/ssh/sshd_config\":\n\nPermitEmptyPasswords no\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61725r925937_chk'\n tag severity: 'high'\n tag gid: 'V-257984'\n tag rid: 'SV-257984r925939_rule'\n tag stig_id: 'RHEL-09-255040'\n tag gtitle: 'SRG-OS-000106-GPOS-00053'\n tag fix_id: 'F-61649r925938_fix'\n tag satisfies: ['SRG-OS-000106-GPOS-00053', 'SRG-OS-000480-GPOS-00229', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-000766']\n tag nist: ['CM-6 b', 'IA-2 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257984.rb" + }, + "title": "RHEL 9 SSHD must not allow blank passwords.", + "desc": "If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.\n\n", + "descriptions": { + "default": "If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.\n\n", + "check": "Verify RHEL 9 remote access using SSH prevents logging on with a blank password with the following command:\n\n$ sudo grep -i PermitEmptyPasswords /etc/ssh/sshd_config\n\nPermitEmptyPassword no\n\nIf the \"PermitEmptyPassword\" keyword is set to \"yes\", is missing, or is commented out, this is a finding.", + "fix": "To configure the system to prevent SSH users from logging on with blank passwords edit the following line in \"etc/ssh/sshd_config\":\n\nPermitEmptyPasswords no\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61725r925937_chk", + "severity": "high", + "gid": "V-257984", + "rid": "SV-257984r925939_rule", + "stig_id": "RHEL-09-255040", + "gtitle": "SRG-OS-000106-GPOS-00053", + "fix_id": "F-61649r925938_fix", + "satisfies": [ + "SRG-OS-000106-GPOS-00053", + "SRG-OS-000480-GPOS-00229", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-000766" + ], + "nist": [ + "CM-6 b", + "IA-2 (2)" + ] + } + }, + { + "id": "SV-257985", + "code": "control 'SV-257985' do\n title 'RHEL 8 must not permit direct logons to the root account using remote\naccess via SSH.'\n desc 'Even though the communications channel may be encrypted, an additional\nlayer of security is gained by extending the policy of not logging on directly\nas root. In addition, logging on with a user-specific account provides\nindividual accountability of actions performed on the system.'\n desc 'check', 'Verify remote access using SSH prevents users from logging on directly as \"root\".\n\nCheck that SSH prevents users from logging on directly as \"root\" with the following command:\n\n$ sudo grep -ir PermitRootLogin /etc/ssh/sshd_config*\n\nPermitRootLogin no\n\nIf the \"PermitRootLogin\" keyword is set to \"yes\", is missing, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to stop users from logging on remotely as the \"root\"\nuser via SSH.\n\n Edit the appropriate \"/etc/ssh/sshd_config\" file to uncomment or add the\nline for the \"PermitRootLogin\" keyword and set its value to \"no\":\n\n PermitRootLogin no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000109-GPOS-00056'\n tag gid: 'V-230296'\n tag rid: 'SV-257985r858711_rule'\n tag stig_id: 'RHEL-08-010550'\n tag fix_id: 'F-32940r567635_fix'\n tag cci: ['CCI-000770']\n tag nist: ['IA-2 (5)']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?)\n }\n\n describe sshd_config do\n its('PermitRootLogin') { should cmp input('permit_root_login') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257985.rb" + }, + "title": "RHEL 8 must not permit direct logons to the root account using remote\naccess via SSH.", + "desc": "Even though the communications channel may be encrypted, an additional\nlayer of security is gained by extending the policy of not logging on directly\nas root. In addition, logging on with a user-specific account provides\nindividual accountability of actions performed on the system.", + "descriptions": { + "default": "Even though the communications channel may be encrypted, an additional\nlayer of security is gained by extending the policy of not logging on directly\nas root. In addition, logging on with a user-specific account provides\nindividual accountability of actions performed on the system.", + "check": "Verify remote access using SSH prevents users from logging on directly as \"root\".\n\nCheck that SSH prevents users from logging on directly as \"root\" with the following command:\n\n$ sudo grep -ir PermitRootLogin /etc/ssh/sshd_config*\n\nPermitRootLogin no\n\nIf the \"PermitRootLogin\" keyword is set to \"yes\", is missing, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to stop users from logging on remotely as the \"root\"\nuser via SSH.\n\n Edit the appropriate \"/etc/ssh/sshd_config\" file to uncomment or add the\nline for the \"PermitRootLogin\" keyword and set its value to \"no\":\n\n PermitRootLogin no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000109-GPOS-00056", + "gid": "V-230296", + "rid": "SV-257985r858711_rule", + "stig_id": "RHEL-08-010550", + "fix_id": "F-32940r567635_fix", + "cci": [ + "CCI-000770" + ], + "nist": [ + "IA-2 (5)" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257986", + "code": "control 'SV-257986' do\n title 'RHEL 9 must enable the Pluggable Authentication Module (PAM) interface for SSHD.'\n desc 'When UsePAM is set to \"yes\", PAM runs through account and session types properly. This is important when restricted access to services based off of IP, time, or other factors of the account is needed. Additionally, this ensures users can inherit certain environment variables on login or disallow access to the server.'\n desc 'check', 'Verify the RHEL 9 SSHD is configured to allow for the UsePAM interface with the following command:\n\n$ sudo grep -i usepam /etc/ssh/sshd_config\n\nUsePAM yes\n\nIf the \"UsePAM\" keyword is set to \"no\", is missing, or is commented out, this is a finding.'\n desc 'fix', 'Configure the RHEL 9 SSHD to use the UsePAM interface add or modify the following line in \"/etc/ssh/sshd_config\".\n\nUsePAM yes\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61727r925943_chk'\n tag severity: 'high'\n tag gid: 'V-257986'\n tag rid: 'SV-257986r925945_rule'\n tag stig_id: 'RHEL-09-255050'\n tag gtitle: 'SRG-OS-000125-GPOS-00065'\n tag fix_id: 'F-61651r925944_fix'\n tag 'documentable'\n tag cci: ['CCI-000877']\n tag nist: ['MA-4 c']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257986.rb" + }, + "title": "RHEL 9 must enable the Pluggable Authentication Module (PAM) interface for SSHD.", + "desc": "When UsePAM is set to \"yes\", PAM runs through account and session types properly. This is important when restricted access to services based off of IP, time, or other factors of the account is needed. Additionally, this ensures users can inherit certain environment variables on login or disallow access to the server.", + "descriptions": { + "default": "When UsePAM is set to \"yes\", PAM runs through account and session types properly. This is important when restricted access to services based off of IP, time, or other factors of the account is needed. Additionally, this ensures users can inherit certain environment variables on login or disallow access to the server.", + "check": "Verify the RHEL 9 SSHD is configured to allow for the UsePAM interface with the following command:\n\n$ sudo grep -i usepam /etc/ssh/sshd_config\n\nUsePAM yes\n\nIf the \"UsePAM\" keyword is set to \"no\", is missing, or is commented out, this is a finding.", + "fix": "Configure the RHEL 9 SSHD to use the UsePAM interface add or modify the following line in \"/etc/ssh/sshd_config\".\n\nUsePAM yes\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61727r925943_chk", + "severity": "high", + "gid": "V-257986", + "rid": "SV-257986r925945_rule", + "stig_id": "RHEL-09-255050", + "gtitle": "SRG-OS-000125-GPOS-00065", + "fix_id": "F-61651r925944_fix", + "documentable": null, + "cci": [ + "CCI-000877" + ], + "nist": [ + "MA-4 c" + ] + } + }, + { + "id": "SV-257987", + "code": "control 'SV-257987' do\n title 'The RHEL 8 SSH daemon must be configured to use system-wide crypto policies.'\n desc 'Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The SSH\nconfiguration file has no effect on the ciphers, MACs, or algorithms unless\nspecifically defined in the /etc/sysconfig/sshd file. The employed algorithms\ncan be viewed in the /etc/crypto-policies/back-ends/ directory.'\n desc 'check', 'Verify that system-wide crypto policies are in effect:\n\n$ sudo grep CRYPTO_POLICY /etc/sysconfig/sshd\n\n# CRYPTO_POLICY=\n\nIf the \"CRYPTO_POLICY \" is uncommented, this is a finding.'\n desc 'fix', 'Configure the RHEL 8 SSH daemon to use system-wide crypto policies by adding the following line to /etc/sysconfig/sshd:\n\n# CRYPTO_POLICY=\n\nA reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065']\n tag gid: 'V-244526'\n tag rid: 'SV-257987r877394_rule'\n tag stig_id: 'RHEL-08-010287'\n tag fix_id: 'F-47758r809333_fix'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\n tag 'host'\n tag 'container-conditional'\n\n openssh_present = package('openssh-server').installed?\n\n only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !openssh_present)\n }\n\n if input('allow_container_openssh_server') == false\n describe 'In a container Environment' do\n it 'the OpenSSH Server should be installed only when allowed in a container environment' do\n expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment'\n end\n end\n else\n describe 'The system' do\n it 'does not have a CRYPTO_POLICY setting configured' do\n expect(parse_config_file('/etc/sysconfig/sshd').params['CRYPTO_POLICY']).to be_nil, 'The CRYPTO_POLICY setting in the /etc/sysconfig/sshd should not be present. Please ensure it is commented out.'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257987.rb" + }, + "title": "The RHEL 8 SSH daemon must be configured to use system-wide crypto policies.", + "desc": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The SSH\nconfiguration file has no effect on the ciphers, MACs, or algorithms unless\nspecifically defined in the /etc/sysconfig/sshd file. The employed algorithms\ncan be viewed in the /etc/crypto-policies/back-ends/ directory.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The SSH\nconfiguration file has no effect on the ciphers, MACs, or algorithms unless\nspecifically defined in the /etc/sysconfig/sshd file. The employed algorithms\ncan be viewed in the /etc/crypto-policies/back-ends/ directory.", + "check": "Verify that system-wide crypto policies are in effect:\n\n$ sudo grep CRYPTO_POLICY /etc/sysconfig/sshd\n\n# CRYPTO_POLICY=\n\nIf the \"CRYPTO_POLICY \" is uncommented, this is a finding.", + "fix": "Configure the RHEL 8 SSH daemon to use system-wide crypto policies by adding the following line to /etc/sysconfig/sshd:\n\n# CRYPTO_POLICY=\n\nA reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000250-GPOS-00093", + "satisfies": [ + "SRG-OS-000250-GPOS-00093", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174", + "SRG-OS-000125-GPOS-00065" + ], + "gid": "V-244526", + "rid": "SV-257987r877394_rule", + "stig_id": "RHEL-08-010287", + "fix_id": "F-47758r809333_fix", + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257988", + "code": "control 'SV-257988' do\n title 'RHEL 9 must implement DOD-approved encryption ciphers to protect the confidentiality of SSH client connections.'\n desc 'Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.'\n desc 'check', 'Verify that system-wide crypto policies are in effect with the following command:\n\n$ sudo grep Include /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\n/etc/ssh/sshd_config:Include /etc/ssh/sshd_config.d/*.conf\n/etc/ssh/sshd_config.d/50-redhat.conf:Include /etc/crypto-policies/back-ends/opensshserver.config\n\nIf \"Include /etc/ssh/sshd_config.d/*.conf\" or \"Include /etc/crypto-policies/back-ends/opensshserver.config\" are not included in the system sshd config or the file \"/etc/ssh/sshd_config.d/50-redhat.conf\" is missing, this is a finding.'\n desc 'fix', 'Configure the RHEL 9 SSH daemon to use system-wide crypto policies by running the following commands:\n\n$ sudo dnf reinstall openssh-clients'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61729r925949_chk'\n tag severity: 'medium'\n tag gid: 'V-257988'\n tag rid: 'SV-257988r925951_rule'\n tag stig_id: 'RHEL-09-255060'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag fix_id: 'F-61653r925950_fix'\n tag 'documentable'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257988.rb" + }, + "title": "RHEL 9 must implement DOD-approved encryption ciphers to protect the confidentiality of SSH client connections.", + "desc": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.", + "check": "Verify that system-wide crypto policies are in effect with the following command:\n\n$ sudo grep Include /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\n/etc/ssh/sshd_config:Include /etc/ssh/sshd_config.d/*.conf\n/etc/ssh/sshd_config.d/50-redhat.conf:Include /etc/crypto-policies/back-ends/opensshserver.config\n\nIf \"Include /etc/ssh/sshd_config.d/*.conf\" or \"Include /etc/crypto-policies/back-ends/opensshserver.config\" are not included in the system sshd config or the file \"/etc/ssh/sshd_config.d/50-redhat.conf\" is missing, this is a finding.", + "fix": "Configure the RHEL 9 SSH daemon to use system-wide crypto policies by running the following commands:\n\n$ sudo dnf reinstall openssh-clients" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61729r925949_chk", + "severity": "medium", + "gid": "V-257988", + "rid": "SV-257988r925951_rule", + "stig_id": "RHEL-09-255060", + "gtitle": "SRG-OS-000250-GPOS-00093", + "fix_id": "F-61653r925950_fix", + "documentable": null, + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ] + } + }, + { + "id": "SV-257989", + "code": "control 'SV-257989' do\n title 'The RHEL 8 operating system must implement DoD-approved encryption to\nprotect the confidentiality of SSH server connections.'\n desc 'Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The SSH\nconfiguration file has no effect on the ciphers, MACs, or algorithms unless\nspecifically defined in the /etc/sysconfig/sshd file. The employed algorithms\ncan be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.\n\n The system will attempt to use the first hash presented by the client that\nmatches the server list. Listing the values \"strongest to weakest\" is a\nmethod to ensure the use of the strongest hash available to secure the SSH\nconnection.'\n desc 'check', %q(Verify the SSH server is configured to use only ciphers employing FIPS 140-2-approved algorithms with the following command:\n\n $ sudo grep -i ciphers /etc/crypto-policies/back-ends/opensshserver.config\n\n CRYPTO_POLICY='-oCiphers=aes256-ctr,aes192-ctr,aes128-ctr,aes256-gcm@openssh.com,aes128-gcm@openssh.com'\n\nIf the cipher entries in the \"opensshserver.config\" file have any ciphers other than shown here, the order differs from the example above, or they are missing or commented out, this is a finding.)\n desc 'fix', 'Configure the RHEL 8 SSH server to use only ciphers employing FIPS 140-2-approved algorithms by updating the \"/etc/crypto-policies/back-ends/opensshserver.config\" file with the following line:\n\n-oCiphers=aes256-ctr,aes192-ctr,aes128-ctr,aes256-gcm@openssh.com,aes128-gcm@openssh.com\n\nA reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065']\n tag gid: 'V-230252'\n tag rid: 'SV-257989r917873_rule'\n tag stig_id: 'RHEL-08-010291'\n tag fix_id: 'F-32896r917872_fix'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\n tag 'host'\n tag 'container-conditional'\n\n only_if('Control not applicable - SSH is not installed within containerized RHEL', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/sysconfig/sshd').exist?)\n }\n\n describe parse_config_file('/etc/crypto-policies/back-ends/opensshserver.config') do\n its('CRYPTO_POLICY') { should_not be_nil }\n end\n\n crypto_policy = parse_config_file('/etc/crypto-policies/back-ends/opensshserver.config')['CRYPTO_POLICY']\n\n unless crypto_policy.nil?\n describe parse_config(crypto_policy.gsub(/\\s|'/, \"\\n\")) do\n its('-oCiphers') { should cmp 'aes256-ctr,aes192-ctr,aes128-ctr,aes256-gcm@openssh.com,aes128-gcm@openssh.com' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257989.rb" + }, + "title": "The RHEL 8 operating system must implement DoD-approved encryption to\nprotect the confidentiality of SSH server connections.", + "desc": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The SSH\nconfiguration file has no effect on the ciphers, MACs, or algorithms unless\nspecifically defined in the /etc/sysconfig/sshd file. The employed algorithms\ncan be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.\n\n The system will attempt to use the first hash presented by the client that\nmatches the server list. Listing the values \"strongest to weakest\" is a\nmethod to ensure the use of the strongest hash available to secure the SSH\nconnection.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The SSH\nconfiguration file has no effect on the ciphers, MACs, or algorithms unless\nspecifically defined in the /etc/sysconfig/sshd file. The employed algorithms\ncan be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.\n\n The system will attempt to use the first hash presented by the client that\nmatches the server list. Listing the values \"strongest to weakest\" is a\nmethod to ensure the use of the strongest hash available to secure the SSH\nconnection.", + "check": "Verify the SSH server is configured to use only ciphers employing FIPS 140-2-approved algorithms with the following command:\n\n $ sudo grep -i ciphers /etc/crypto-policies/back-ends/opensshserver.config\n\n CRYPTO_POLICY='-oCiphers=aes256-ctr,aes192-ctr,aes128-ctr,aes256-gcm@openssh.com,aes128-gcm@openssh.com'\n\nIf the cipher entries in the \"opensshserver.config\" file have any ciphers other than shown here, the order differs from the example above, or they are missing or commented out, this is a finding.", + "fix": "Configure the RHEL 8 SSH server to use only ciphers employing FIPS 140-2-approved algorithms by updating the \"/etc/crypto-policies/back-ends/opensshserver.config\" file with the following line:\n\n-oCiphers=aes256-ctr,aes192-ctr,aes128-ctr,aes256-gcm@openssh.com,aes128-gcm@openssh.com\n\nA reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000250-GPOS-00093", + "satisfies": [ + "SRG-OS-000250-GPOS-00093", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174", + "SRG-OS-000125-GPOS-00065" + ], + "gid": "V-230252", + "rid": "SV-257989r917873_rule", + "stig_id": "RHEL-08-010291", + "fix_id": "F-32896r917872_fix", + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257990", + "code": "control 'SV-257990' do\n title 'RHEL 9 SSH client must be configured to use only Message Authentication Codes (MACs) employing FIPS 140-3 validated cryptographic hash algorithms.'\n desc 'Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.'\n desc 'check', 'Verify SSH client is configured to use only ciphers employing FIPS 140-3 approved algorithms with the following command:\n\n$ sudo grep -i macs /etc/crypto-policies/back-ends/openssh.config\nMACs hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512\n\nIf the MACs entries in the \"openssh.config\" file have any hashes other than \"hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512\", the order differs from the example above, they are missing, or commented out, this is a finding.'\n desc 'fix', 'Configure the RHEL 9 SSH client to use only MACs employing FIPS 140-3 approved algorithms by updating the \"/etc/crypto-policies/back-ends/openssh.config\" file with the following line:\n\nMACs hmac-sha2-512-etm@openssh.com,hmac-sha2-512,hmac-sha2-256-etm@openssh.com,hmac-sha2-256\n\nA reboot is required for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61731r925955_chk'\n tag severity: 'medium'\n tag gid: 'V-257990'\n tag rid: 'SV-257990r925957_rule'\n tag stig_id: 'RHEL-09-255070'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag fix_id: 'F-61655r925956_fix'\n tag 'documentable'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257990.rb" + }, + "title": "RHEL 9 SSH client must be configured to use only Message Authentication Codes (MACs) employing FIPS 140-3 validated cryptographic hash algorithms.", + "desc": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.", + "check": "Verify SSH client is configured to use only ciphers employing FIPS 140-3 approved algorithms with the following command:\n\n$ sudo grep -i macs /etc/crypto-policies/back-ends/openssh.config\nMACs hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512\n\nIf the MACs entries in the \"openssh.config\" file have any hashes other than \"hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512\", the order differs from the example above, they are missing, or commented out, this is a finding.", + "fix": "Configure the RHEL 9 SSH client to use only MACs employing FIPS 140-3 approved algorithms by updating the \"/etc/crypto-policies/back-ends/openssh.config\" file with the following line:\n\nMACs hmac-sha2-512-etm@openssh.com,hmac-sha2-512,hmac-sha2-256-etm@openssh.com,hmac-sha2-256\n\nA reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61731r925955_chk", + "severity": "medium", + "gid": "V-257990", + "rid": "SV-257990r925957_rule", + "stig_id": "RHEL-09-255070", + "gtitle": "SRG-OS-000250-GPOS-00093", + "fix_id": "F-61655r925956_fix", + "documentable": null, + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ] + } + }, + { + "id": "SV-257991", + "code": "control 'SV-257991' do\n title 'The RHEL 8 SSH server must be configured to use only Message Authentication Codes (MACs) employing FIPS 140-2 validated cryptographic hash algorithms.'\n desc 'Without cryptographic integrity protections, information can be altered by unauthorized users without detection. Remote access (e.g., RDP) is access to DoD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. RHEL 8 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file. The system will attempt to use the first hash presented by the client that matches the server list. Listing the values \"strongest to weakest\" is a method to ensure the use of the strongest hash available to secure the SSH connection.'\n desc 'check', 'Verify the SSH server is configured to use only MACs employing FIPS 140-2-approved algorithms with the following command:\n\n $ sudo grep -i macs /etc/crypto-policies/back-ends/opensshserver.config\n\n -oMACS=hmac-sha2-512,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com\n\nIf the MACs entries in the \"opensshserver.config\" file have any hashes other than shown here, the order differs from the example above, or they are missing or commented out, this is a finding.'\n desc 'fix', 'Configure the RHEL 8 SSH server to use only MACs employing FIPS 140-2-approved algorithms by updating the \"/etc/crypto-policies/back-ends/opensshserver.config\" file with the following line:\n\n -oMACS=hmac-sha2-512,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com\n\n A reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065']\n tag gid: 'V-230251'\n tag rid: 'SV-25799r917870_rule'\n tag stig_id: 'RHEL-08-010290'\n tag fix_id: 'F-32895r917869_fix'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\n tag 'host'\n tag 'container-conditional'\n\n # Check if SSH is installed within containerized RHEL\n only_if('SSH is not installed within containerized RHEL. Therefore, this requirement is not applicable.', impact: 0.0) do\n !(virtualization.system.eql?('docker') && !file('/etc/sysconfig/sshd').exist?)\n end\n\n # Define the required algorithms\n required_algorithms = input('openssh_server_required_algorithms')\n\n # TODO: make a simple resource for this based off 'login_defs' or 'yum' as a model\n\n # Parse the configuration file to get the value of \"CRYPTO_POLICY\"\n crypto_policy = parse_config_file('/etc/crypto-policies/back-ends/opensshserver.config')['CRYPTO_POLICY']\n\n # Parse the CRYPTO_POLICY string into a hash of configuration options\n config_options = crypto_policy.scan(/-o(\\w+)=([\\w\\-,@]+.)/).to_h\n\n # Split each configuration option's values into an array\n config_options.transform_values! { |v| v.split(',') }\n\n # Define the path to the crypto policy file\n crypto_policy_file = '/etc/crypto-policies/back-ends/opensshserver.config'\n\n # Test that the crypto policy file is configured with the required algorithms\n describe \"The crypto policy file #{crypto_policy_file}\" do\n it 'is configured with the required algorithms' do\n expect(crypto_policy).not_to be_nil, \"The crypto policy file #{crypto_policy_file} \\ndoes not contain the required algorithms\\n\\n\\t#{required_algorithms}.\"\n end\n end\n\n # Test that the MACS option in the crypto policy file contains the required algorithms in the correct order\n describe 'The MACs option in the crypto policy file' do\n it 'contains the required algorithms in the correct order' do\n expect(config_options['MACS']).to eq(required_algorithms), \"The MACS option in the crypto policy file does not contain the required algorithms in the *exact order*:\\n\\n\\texpected: #{required_algorithms}\\n\\tgot:#{config_options['MACS']}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257991.rb" + }, + "title": "The RHEL 8 SSH server must be configured to use only Message Authentication Codes (MACs) employing FIPS 140-2 validated cryptographic hash algorithms.", + "desc": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection. Remote access (e.g., RDP) is access to DoD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. RHEL 8 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file. The system will attempt to use the first hash presented by the client that matches the server list. Listing the values \"strongest to weakest\" is a method to ensure the use of the strongest hash available to secure the SSH connection.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection. Remote access (e.g., RDP) is access to DoD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. RHEL 8 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file. The system will attempt to use the first hash presented by the client that matches the server list. Listing the values \"strongest to weakest\" is a method to ensure the use of the strongest hash available to secure the SSH connection.", + "check": "Verify the SSH server is configured to use only MACs employing FIPS 140-2-approved algorithms with the following command:\n\n $ sudo grep -i macs /etc/crypto-policies/back-ends/opensshserver.config\n\n -oMACS=hmac-sha2-512,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com\n\nIf the MACs entries in the \"opensshserver.config\" file have any hashes other than shown here, the order differs from the example above, or they are missing or commented out, this is a finding.", + "fix": "Configure the RHEL 8 SSH server to use only MACs employing FIPS 140-2-approved algorithms by updating the \"/etc/crypto-policies/back-ends/opensshserver.config\" file with the following line:\n\n -oMACS=hmac-sha2-512,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com\n\n A reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000250-GPOS-00093", + "satisfies": [ + "SRG-OS-000250-GPOS-00093", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174", + "SRG-OS-000125-GPOS-00065" + ], + "gid": "V-230251", + "rid": "SV-25799r917870_rule", + "stig_id": "RHEL-08-010290", + "fix_id": "F-32895r917869_fix", + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257992", + "code": "control 'SV-257992' do\n title 'RHEL 9 must not allow a noncertificate trusted host SSH logon to the system.'\n desc 'SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.'\n desc 'check', 'Verify the operating system does not allow a noncertificate trusted host SSH logon to the system with the following command:\n\n$ sudo grep -i hostbasedauthentication /etc/ssh/sshd_config\n\nHostbasedAuthentication no\n\nIf the \"HostbasedAuthentication\" keyword is not set to \"no\", is missing, or is commented out, this is a finding.\n\nIf the required value is not set, this is a finding.'\n desc 'fix', 'To configure RHEL 9 to not allow a noncertificate trusted host SSH logon to the system add or modify the following line in \"/etc/ssh/sshd_config\".\n\nHostbasedAuthentication no\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61733r925961_chk'\n tag severity: 'medium'\n tag gid: 'V-257992'\n tag rid: 'SV-257992r925963_rule'\n tag stig_id: 'RHEL-09-255080'\n tag gtitle: 'SRG-OS-000480-GPOS-00229'\n tag fix_id: 'F-61657r925962_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257992.rb" + }, + "title": "RHEL 9 must not allow a noncertificate trusted host SSH logon to the system.", + "desc": "SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.", + "descriptions": { + "default": "SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.", + "check": "Verify the operating system does not allow a noncertificate trusted host SSH logon to the system with the following command:\n\n$ sudo grep -i hostbasedauthentication /etc/ssh/sshd_config\n\nHostbasedAuthentication no\n\nIf the \"HostbasedAuthentication\" keyword is not set to \"no\", is missing, or is commented out, this is a finding.\n\nIf the required value is not set, this is a finding.", + "fix": "To configure RHEL 9 to not allow a noncertificate trusted host SSH logon to the system add or modify the following line in \"/etc/ssh/sshd_config\".\n\nHostbasedAuthentication no\n\nRestart the SSH daemon for the settings to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61733r925961_chk", + "severity": "medium", + "gid": "V-257992", + "rid": "SV-257992r925963_rule", + "stig_id": "RHEL-09-255080", + "gtitle": "SRG-OS-000480-GPOS-00229", + "fix_id": "F-61657r925962_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257993", + "code": "control 'SV-257993' do\n title 'RHEL 8 must not allow users to override SSH environment variables.'\n desc 'SSH environment options potentially allow users to bypass access\nrestriction in some configurations.'\n desc 'check', 'Verify that unattended or automatic logon via ssh is disabled with the following command:\n\n$ sudo grep -ir PermitUserEnvironment /etc/ssh/sshd_config*\n\nPermitUserEnvironment no\n\nIf \"PermitUserEnvironment\" is set to \"yes\", is missing completely, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to allow the SSH daemon to not allow unattended or\nautomatic logon to the system.\n\n Add or edit the following line in the \"/etc/ssh/sshd_config\" file:\n\n PermitUserEnvironment no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00229'\n tag gid: 'V-230330'\n tag rid: 'SV-257993r877377_rule'\n tag stig_id: 'RHEL-08-010830'\n tag fix_id: 'F-32974r567737_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This requirement is Not Applicable inside a container, the containers host manages the containers filesystems') {\n !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?)\n }\n\n describe sshd_config do\n its('PermitUserEnvironment') { should eq 'no' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257993.rb" + }, + "title": "RHEL 8 must not allow users to override SSH environment variables.", + "desc": "SSH environment options potentially allow users to bypass access\nrestriction in some configurations.", + "descriptions": { + "default": "SSH environment options potentially allow users to bypass access\nrestriction in some configurations.", + "check": "Verify that unattended or automatic logon via ssh is disabled with the following command:\n\n$ sudo grep -ir PermitUserEnvironment /etc/ssh/sshd_config*\n\nPermitUserEnvironment no\n\nIf \"PermitUserEnvironment\" is set to \"yes\", is missing completely, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to allow the SSH daemon to not allow unattended or\nautomatic logon to the system.\n\n Add or edit the following line in the \"/etc/ssh/sshd_config\" file:\n\n PermitUserEnvironment no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00229", + "gid": "V-230330", + "rid": "SV-257993r877377_rule", + "stig_id": "RHEL-08-010830", + "fix_id": "F-32974r567737_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257994", + "code": "control 'SV-257994' do\n title 'RHEL 8 must force a frequent session key renegotiation for SSH\nconnections to the server.'\n desc 'Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.\n\n Session key regeneration limits the chances of a session key becoming\ncompromised.'\n desc 'check', 'Verify the SSH server is configured to force frequent session key renegotiation with the following command:\n\n$ sudo grep -ir RekeyLimit /etc/ssh/sshd_config*\n\nRekeyLimit 1G 1h\n\nIf \"RekeyLimit\" does not have a maximum data amount and maximum time defined, is missing or commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the system to force a frequent session key renegotiation for SSH\nconnections to the server by add or modifying the following line in the\n\"/etc/ssh/sshd_config\" file:\n\n RekeyLimit 1G 1h\n\n Restart the SSH daemon for the settings to take effect.\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000033-GPOS-00014'\n tag satisfies: ['SRG-OS-000033-GPOS-00014', 'SRG-OS-000420-GPOS-00186', 'SRG-OS-000424-GPOS-00188']\n tag gid: 'V-230527'\n tag rid: 'SV-257994r877398_rule'\n tag stig_id: 'RHEL-08-040161'\n tag fix_id: 'F-33171r568328_fix'\n tag cci: ['CCI-000068']\n tag nist: ['AC-17 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers without SSH enabled', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?)\n }\n\n describe sshd_config do\n its('RekeyLimit') { should cmp '1G 1h' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257994.rb" + }, + "title": "RHEL 8 must force a frequent session key renegotiation for SSH\nconnections to the server.", + "desc": "Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.\n\n Session key regeneration limits the chances of a session key becoming\ncompromised.", + "descriptions": { + "default": "Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.\n\n Session key regeneration limits the chances of a session key becoming\ncompromised.", + "check": "Verify the SSH server is configured to force frequent session key renegotiation with the following command:\n\n$ sudo grep -ir RekeyLimit /etc/ssh/sshd_config*\n\nRekeyLimit 1G 1h\n\nIf \"RekeyLimit\" does not have a maximum data amount and maximum time defined, is missing or commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the system to force a frequent session key renegotiation for SSH\nconnections to the server by add or modifying the following line in the\n\"/etc/ssh/sshd_config\" file:\n\n RekeyLimit 1G 1h\n\n Restart the SSH daemon for the settings to take effect.\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000033-GPOS-00014", + "satisfies": [ + "SRG-OS-000033-GPOS-00014", + "SRG-OS-000420-GPOS-00186", + "SRG-OS-000424-GPOS-00188" + ], + "gid": "V-230527", + "rid": "SV-257994r877398_rule", + "stig_id": "RHEL-08-040161", + "fix_id": "F-33171r568328_fix", + "cci": [ + "CCI-000068" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null + } + }, + { + "id": "SV-257995", + "code": "control 'SV-257995' do\n title 'RHEL 8 must be configured so that all network connections associated with SSH traffic terminate after becoming unresponsive.'\n desc 'Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element.\n\n Terminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.\n\n RHEL 8 uses /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of \"ClientAliveInterval\" and \"ClientAliveCountMax\" is used to establish the inactivity threshold. The \"ClientAliveInterval\" is a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The \"ClientAliveCountMax\" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.'\n desc 'check', 'Verify the SSH server automatically terminates a user session after the SSH client has become unresponsive.\n\n Check that the \"ClientAliveCountMax\" is set to \"1\" by performing the following command:\n\n $ sudo grep -ir clientalivecountmax /etc/ssh/sshd_config*\n\n ClientAliveCountMax 1\n\n If \"ClientAliveCountMax\" do not exist, is not set to a value of \"1\" in \"/etc/ssh/sshd_config\", or is commented out, this is a finding.\n\n If conflicting results are returned, this is a finding.'\n desc 'fix', 'Note: This setting must be applied in conjunction with RHEL-08-010201 to function correctly.\n\n Configure the SSH server to terminate a user session automatically after the SSH client has become unresponsive.\n\n Modify or append the following lines in the \"/etc/ssh/sshd_config\" file:\n\n ClientAliveCountMax 1\n\n For the changes to take effect, the SSH daemon must be restarted:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000163-GPOS-00072'\n tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000126-GPOS-00066', 'SRG-OS-000279-GPOS-00109']\n tag gid: 'V-230244'\n tag rid: 'SV-257995r917867_rule'\n tag stig_id: 'RHEL-08-010200'\n tag fix_id: 'F-32888r917866_fix'\n tag cci: ['CCI-001133']\n tag nist: ['SC-10']\n tag 'host'\n tag 'container-conditional'\n\n only_if('SSH is not installed on the system this requirement is Not Applicable', impact: 0.0) {\n (service('sshd').enabled? || package('openssh-server').installed?)\n }\n\n client_alive_count = input('sshd_client_alive_count_max')\n\n if virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?\n impact 0.0\n describe 'skip' do\n skip 'SSH configuration does not apply inside containers. This control is Not Applicable.'\n end\n else\n describe 'SSH ClientAliveCountMax configuration' do\n it \"should be set to #{client_alive_count}\" do\n expect(sshd_config.ClientAliveCountMax).to(cmp(client_alive_count), \"SSH ClientAliveCountMax is commented out or not set to the expected value (#{client_alive_count})\")\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257995.rb" + }, + "title": "RHEL 8 must be configured so that all network connections associated with SSH traffic terminate after becoming unresponsive.", + "desc": "Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element.\n\n Terminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.\n\n RHEL 8 uses /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of \"ClientAliveInterval\" and \"ClientAliveCountMax\" is used to establish the inactivity threshold. The \"ClientAliveInterval\" is a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The \"ClientAliveCountMax\" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.", + "descriptions": { + "default": "Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element.\n\n Terminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.\n\n RHEL 8 uses /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of \"ClientAliveInterval\" and \"ClientAliveCountMax\" is used to establish the inactivity threshold. The \"ClientAliveInterval\" is a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The \"ClientAliveCountMax\" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.", + "check": "Verify the SSH server automatically terminates a user session after the SSH client has become unresponsive.\n\n Check that the \"ClientAliveCountMax\" is set to \"1\" by performing the following command:\n\n $ sudo grep -ir clientalivecountmax /etc/ssh/sshd_config*\n\n ClientAliveCountMax 1\n\n If \"ClientAliveCountMax\" do not exist, is not set to a value of \"1\" in \"/etc/ssh/sshd_config\", or is commented out, this is a finding.\n\n If conflicting results are returned, this is a finding.", + "fix": "Note: This setting must be applied in conjunction with RHEL-08-010201 to function correctly.\n\n Configure the SSH server to terminate a user session automatically after the SSH client has become unresponsive.\n\n Modify or append the following lines in the \"/etc/ssh/sshd_config\" file:\n\n ClientAliveCountMax 1\n\n For the changes to take effect, the SSH daemon must be restarted:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000163-GPOS-00072", + "satisfies": [ + "SRG-OS-000163-GPOS-00072", + "SRG-OS-000126-GPOS-00066", + "SRG-OS-000279-GPOS-00109" + ], + "gid": "V-230244", + "rid": "SV-257995r917867_rule", + "stig_id": "RHEL-08-010200", + "fix_id": "F-32888r917866_fix", + "cci": [ + "CCI-001133" + ], + "nist": [ + "SC-10" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257996", + "code": "control 'SV-257996' do\n title 'RHEL 8 must be configured so that all network connections associated with SSH traffic are terminated after 10 minutes of becoming unresponsive.'\n desc 'Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element.\n\nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.\n\nRHEL 8 uses /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of \"ClientAliveInterval\" and \"ClientAliveCountMax\" is used to establish the inactivity threshold. The \"ClientAliveInterval\" is a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The \"ClientAliveCountMax\" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.'\n desc 'check', 'Verify the SSH server automatically terminates a user session after the SSH client has been unresponsive for 10 minutes.\n\nCheck that the \"ClientAliveInterval\" variable is set to a value of \"600\" or less by performing the following command:\n\n $ sudo grep -ir clientaliveinterval /etc/ssh/sshd_config*\n\n ClientAliveInterval 600\n\nIf \"ClientAliveInterval\" does not exist, does not have a value of \"600\" or less in \"/etc/ssh/sshd_config\" or is commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Note: This setting must be applied in conjunction with RHEL-08-010200 to function correctly.\n\nConfigure the SSH server to terminate a user session automatically after the SSH client has been unresponsive for 10 minutes.\n\nModify or append the following lines in the \"/etc/ssh/sshd_config\" file:\n\n ClientAliveInterval 600\n\nFor the changes to take effect, the SSH daemon must be restarted.\n\n $ sudo systemctl restart sshd.service'\n impact 0.0\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000163-GPOS-00072'\n tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000126-GPOS-00066', 'SRG-OS-000279-GPOS-00109']\n tag gid: 'V-244525'\n tag rid: 'SV-257996r917886_rule'\n tag stig_id: 'RHEL-08-010201'\n tag fix_id: 'F-47757r917885_fix'\n tag cci: ['CCI-001133']\n tag nist: ['SC-10']\n tag 'host'\n tag 'container-conditional'\n\n setting = 'ClientAliveInterval'\n gssapi_authentication = input('sshd_config_values')\n value = gssapi_authentication[setting]\n openssh_present = package('openssh-server').installed?\n\n only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !openssh_present)\n }\n\n if input('allow_container_openssh_server') == false\n describe 'In a container Environment' do\n it 'the OpenSSH Server should be installed only when allowed in a container environment' do\n expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment'\n end\n end\n else\n describe 'The OpenSSH Server configuration' do\n it \"has the correct #{setting} configuration\" do\n expect(sshd_config.params[setting.downcase]).to cmp(value), \"The #{setting} setting in the SSHD config is not correct. Please ensure it set to '#{value}'.\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257996.rb" + }, + "title": "RHEL 8 must be configured so that all network connections associated with SSH traffic are terminated after 10 minutes of becoming unresponsive.", + "desc": "Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element.\n\nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.\n\nRHEL 8 uses /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of \"ClientAliveInterval\" and \"ClientAliveCountMax\" is used to establish the inactivity threshold. The \"ClientAliveInterval\" is a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The \"ClientAliveCountMax\" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.", + "descriptions": { + "default": "Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element.\n\nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.\n\nRHEL 8 uses /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of \"ClientAliveInterval\" and \"ClientAliveCountMax\" is used to establish the inactivity threshold. The \"ClientAliveInterval\" is a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The \"ClientAliveCountMax\" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages.", + "check": "Verify the SSH server automatically terminates a user session after the SSH client has been unresponsive for 10 minutes.\n\nCheck that the \"ClientAliveInterval\" variable is set to a value of \"600\" or less by performing the following command:\n\n $ sudo grep -ir clientaliveinterval /etc/ssh/sshd_config*\n\n ClientAliveInterval 600\n\nIf \"ClientAliveInterval\" does not exist, does not have a value of \"600\" or less in \"/etc/ssh/sshd_config\" or is commented out, this is a finding.\n\nIf conflicting results are returned, this is a finding.", + "fix": "Note: This setting must be applied in conjunction with RHEL-08-010200 to function correctly.\n\nConfigure the SSH server to terminate a user session automatically after the SSH client has been unresponsive for 10 minutes.\n\nModify or append the following lines in the \"/etc/ssh/sshd_config\" file:\n\n ClientAliveInterval 600\n\nFor the changes to take effect, the SSH daemon must be restarted.\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000163-GPOS-00072", + "satisfies": [ + "SRG-OS-000163-GPOS-00072", + "SRG-OS-000126-GPOS-00066", + "SRG-OS-000279-GPOS-00109" + ], + "gid": "V-244525", + "rid": "SV-257996r917886_rule", + "stig_id": "RHEL-08-010201", + "fix_id": "F-47757r917885_fix", + "cci": [ + "CCI-001133" + ], + "nist": [ + "SC-10" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-257997", + "code": "control 'SV-257997' do\n title 'RHEL 9 SSH server configuration file must be group-owned by root.'\n desc 'Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.'\n desc 'check', 'Verify the group ownership of the \"/etc/ssh/sshd_config\" file with the following command:\n\n$ ls -al /etc/ssh/sshd_config\n\nrw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config\n\nIf the \"/etc/ssh/sshd_config\" file does not have a group owner of \"root\", this is a finding.'\n desc 'fix', 'Configure the \"/etc/ssh/sshd_config\" file to be group-owned by root with the following command:\n\n$ sudo chgrp root /etc/ssh/sshd_config'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61738r925976_chk'\n tag severity: 'medium'\n tag gid: 'V-257997'\n tag rid: 'SV-257997r925978_rule'\n tag stig_id: 'RHEL-09-255105'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61662r925977_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257997.rb" + }, + "title": "RHEL 9 SSH server configuration file must be group-owned by root.", + "desc": "Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.", + "descriptions": { + "default": "Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.", + "check": "Verify the group ownership of the \"/etc/ssh/sshd_config\" file with the following command:\n\n$ ls -al /etc/ssh/sshd_config\n\nrw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config\n\nIf the \"/etc/ssh/sshd_config\" file does not have a group owner of \"root\", this is a finding.", + "fix": "Configure the \"/etc/ssh/sshd_config\" file to be group-owned by root with the following command:\n\n$ sudo chgrp root /etc/ssh/sshd_config" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61738r925976_chk", + "severity": "medium", + "gid": "V-257997", + "rid": "SV-257997r925978_rule", + "stig_id": "RHEL-09-255105", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61662r925977_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257998", + "code": "control 'SV-257998' do\n title 'RHEL 9 SSH server configuration file must be owned by root.'\n desc 'Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.'\n desc 'check', 'Verify the ownership of the \"/etc/ssh/sshd_config\" file with the following command:\n\n$ ls -al /etc/ssh/sshd_config\n\nrw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config\n\nIf the \"/etc/ssh/sshd_config\" file does not have an owner of \"root\", this is a finding.'\n desc 'fix', 'Configure the \"/etc/ssh/sshd_config\" file to be owned by root with the following command:\n\n$ sudo chown root /etc/ssh/sshd_config'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61739r925979_chk'\n tag severity: 'medium'\n tag gid: 'V-257998'\n tag rid: 'SV-257998r925981_rule'\n tag stig_id: 'RHEL-09-255110'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61663r925980_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257998.rb" + }, + "title": "RHEL 9 SSH server configuration file must be owned by root.", + "desc": "Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.", + "descriptions": { + "default": "Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.", + "check": "Verify the ownership of the \"/etc/ssh/sshd_config\" file with the following command:\n\n$ ls -al /etc/ssh/sshd_config\n\nrw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config\n\nIf the \"/etc/ssh/sshd_config\" file does not have an owner of \"root\", this is a finding.", + "fix": "Configure the \"/etc/ssh/sshd_config\" file to be owned by root with the following command:\n\n$ sudo chown root /etc/ssh/sshd_config" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61739r925979_chk", + "severity": "medium", + "gid": "V-257998", + "rid": "SV-257998r925981_rule", + "stig_id": "RHEL-09-255110", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61663r925980_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-257999", + "code": "control 'SV-257999' do\n title 'RHEL 9 SSH server configuration file must have mode 0600 or less permissive.'\n desc 'Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.'\n desc 'check', 'Verify the permissions of the \"/etc/ssh/sshd_config\" file with the following command:\n\n$ ls -al /etc/ssh/sshd_config\n\nrw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config\n\nIf the \"/etc/ssh/sshd_config\" permissions are not \"0600\", this is a finding.'\n desc 'fix', 'Configure the \"/etc/ssh/sshd_config\" permissions to be \"0600\" with the following command:\n\n$ sudo chmod 0600 /etc/ssh/sshd_config'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61740r925982_chk'\n tag severity: 'medium'\n tag gid: 'V-257999'\n tag rid: 'SV-257999r925984_rule'\n tag stig_id: 'RHEL-09-255115'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61664r925983_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-257999.rb" + }, + "title": "RHEL 9 SSH server configuration file must have mode 0600 or less permissive.", + "desc": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.", + "descriptions": { + "default": "Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.", + "check": "Verify the permissions of the \"/etc/ssh/sshd_config\" file with the following command:\n\n$ ls -al /etc/ssh/sshd_config\n\nrw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config\n\nIf the \"/etc/ssh/sshd_config\" permissions are not \"0600\", this is a finding.", + "fix": "Configure the \"/etc/ssh/sshd_config\" permissions to be \"0600\" with the following command:\n\n$ sudo chmod 0600 /etc/ssh/sshd_config" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61740r925982_chk", + "severity": "medium", + "gid": "V-257999", + "rid": "SV-257999r925984_rule", + "stig_id": "RHEL-09-255115", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61664r925983_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258000", + "code": "control 'SV-258000' do\n title 'The RHEL 8 SSH private host key files must have mode 0640 or less permissive.'\n desc 'If an unauthorized user obtains the private SSH host key file, the\nhost could be impersonated.'\n desc 'check', 'Verify the SSH private host key files have mode \"0640\" or less permissive with the following command:\n\n $ sudo ls -l /etc/ssh/ssh_host*key\n\n -rw-r----- 1 root ssh_keys 668 Nov 28 06:43 ssh_host_dsa_key\n -rw-r----- 1 root ssh_keys 582 Nov 28 06:43 ssh_host_key\n -rw-r----- 1 root ssh_keys 887 Nov 28 06:43 ssh_host_rsa_key\n\nIf any private host key file has a mode more permissive than \"0640\", this is a finding.'\n desc 'fix', 'Configure the mode of SSH private host key files under \"/etc/ssh\" to \"0640\" with the following command:\n\n $ sudo chmod 0640 /etc/ssh/ssh_host*key\n\nThe SSH daemon must be restarted for the changes to take effect. To restart the SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230287'\n tag rid: 'SV-258000r880714_rule'\n tag stig_id: 'RHEL-08-010490'\n tag fix_id: 'F-32931r880713_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?)\n }\n\n ssh_host_key_dirs = input('ssh_host_key_dirs').join(' ')\n priv_keys = command(\"find #{ssh_host_key_dirs} -xdev -name '*.pem'\").stdout.split(\"\\n\")\n mode = input('ssh_private_key_mode')\n failing_keys = priv_keys.select { |key| file(key).more_permissive_than?(mode) }\n\n describe 'All SSH private keys on the filesystem' do\n it \"should be less permissive than #{mode}\" do\n expect(failing_keys).to be_empty, \"Failing keyfiles:\\n\\t- #{failing_keys.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258000.rb" + }, + "title": "The RHEL 8 SSH private host key files must have mode 0640 or less permissive.", + "desc": "If an unauthorized user obtains the private SSH host key file, the\nhost could be impersonated.", + "descriptions": { + "default": "If an unauthorized user obtains the private SSH host key file, the\nhost could be impersonated.", + "check": "Verify the SSH private host key files have mode \"0640\" or less permissive with the following command:\n\n $ sudo ls -l /etc/ssh/ssh_host*key\n\n -rw-r----- 1 root ssh_keys 668 Nov 28 06:43 ssh_host_dsa_key\n -rw-r----- 1 root ssh_keys 582 Nov 28 06:43 ssh_host_key\n -rw-r----- 1 root ssh_keys 887 Nov 28 06:43 ssh_host_rsa_key\n\nIf any private host key file has a mode more permissive than \"0640\", this is a finding.", + "fix": "Configure the mode of SSH private host key files under \"/etc/ssh\" to \"0640\" with the following command:\n\n $ sudo chmod 0640 /etc/ssh/ssh_host*key\n\nThe SSH daemon must be restarted for the changes to take effect. To restart the SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230287", + "rid": "SV-258000r880714_rule", + "stig_id": "RHEL-08-010490", + "fix_id": "F-32931r880713_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258001", + "code": "control 'SV-258001' do\n title 'The RHEL 8 SSH public host key files must have mode 0644 or less\npermissive.'\n desc 'If a public host key file is modified by an unauthorized user, the SSH\nservice may be compromised.'\n desc 'check', 'Verify the SSH public host key files have mode \"0644\" or less permissive\nwith the following command:\n\n $ sudo ls -l /etc/ssh/*.pub\n\n -rw-r--r-- 1 root root 618 Nov 28 06:43 ssh_host_dsa_key.pub\n -rw-r--r-- 1 root root 347 Nov 28 06:43 ssh_host_key.pub\n -rw-r--r-- 1 root root 238 Nov 28 06:43 ssh_host_rsa_key.pub\n\n If any key.pub file has a mode more permissive than \"0644\", this is a\nfinding.\n\n Note: SSH public key files may be found in other directories on the system\ndepending on the installation.'\n desc 'fix', 'Change the mode of public host key files under \"/etc/ssh\" to \"0644\"\nwith the following command:\n\n $ sudo chmod 0644 /etc/ssh/*key.pub\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230286'\n tag rid: 'SV-258001r627750_rule'\n tag stig_id: 'RHEL-08-010480'\n tag fix_id: 'F-32930r567605_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?)\n }\n\n ssh_host_key_dirs = input('ssh_host_key_dirs').join(' ')\n pub_keys = command(\"find #{ssh_host_key_dirs} -xdev -name '*.pub'\").stdout.split(\"\\n\")\n mode = input('ssh_pub_key_mode')\n failing_keys = pub_keys.select { |key| file(key).more_permissive_than?(mode) }\n\n describe 'All SSH public keys on the filesystem' do\n it \"should be less permissive than #{mode}\" do\n expect(failing_keys).to be_empty, \"Failing keyfiles:\\n\\t- #{failing_keys.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258001.rb" + }, + "title": "The RHEL 8 SSH public host key files must have mode 0644 or less\npermissive.", + "desc": "If a public host key file is modified by an unauthorized user, the SSH\nservice may be compromised.", + "descriptions": { + "default": "If a public host key file is modified by an unauthorized user, the SSH\nservice may be compromised.", + "check": "Verify the SSH public host key files have mode \"0644\" or less permissive\nwith the following command:\n\n $ sudo ls -l /etc/ssh/*.pub\n\n -rw-r--r-- 1 root root 618 Nov 28 06:43 ssh_host_dsa_key.pub\n -rw-r--r-- 1 root root 347 Nov 28 06:43 ssh_host_key.pub\n -rw-r--r-- 1 root root 238 Nov 28 06:43 ssh_host_rsa_key.pub\n\n If any key.pub file has a mode more permissive than \"0644\", this is a\nfinding.\n\n Note: SSH public key files may be found in other directories on the system\ndepending on the installation.", + "fix": "Change the mode of public host key files under \"/etc/ssh\" to \"0644\"\nwith the following command:\n\n $ sudo chmod 0644 /etc/ssh/*key.pub\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230286", + "rid": "SV-258001r627750_rule", + "stig_id": "RHEL-08-010480", + "fix_id": "F-32930r567605_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258002", + "code": "control 'SV-258002' do\n title 'RHEL 9 SSH daemon must not allow compression or must only allow compression after successful authentication.'\n desc 'If compression is allowed in an SSH connection prior to authentication, vulnerabilities in the compression software could result in compromise of the system from an unauthenticated connection, potentially with root privileges.'\n desc 'check', 'Verify the SSH daemon performs compression after a user successfully authenticates with the following command:\n\n$ sudo grep -ir compression /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\nCompression delayed\n\nIf the \"Compression\" keyword is set to \"yes\", is missing, or the returned line is commented out, this is a finding.'\n desc 'fix', 'Configure the SSH daemon to not allow compression.\n\nUncomment the \"Compression\" keyword in \"/etc/ssh/sshd_config\" on the system and set the value to \"delayed\" or \"no\":\n\nCompression no\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61743r925991_chk'\n tag severity: 'medium'\n tag gid: 'V-258002'\n tag rid: 'SV-258002r925993_rule'\n tag stig_id: 'RHEL-09-255130'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61667r925992_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258002.rb" + }, + "title": "RHEL 9 SSH daemon must not allow compression or must only allow compression after successful authentication.", + "desc": "If compression is allowed in an SSH connection prior to authentication, vulnerabilities in the compression software could result in compromise of the system from an unauthenticated connection, potentially with root privileges.", + "descriptions": { + "default": "If compression is allowed in an SSH connection prior to authentication, vulnerabilities in the compression software could result in compromise of the system from an unauthenticated connection, potentially with root privileges.", + "check": "Verify the SSH daemon performs compression after a user successfully authenticates with the following command:\n\n$ sudo grep -ir compression /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\nCompression delayed\n\nIf the \"Compression\" keyword is set to \"yes\", is missing, or the returned line is commented out, this is a finding.", + "fix": "Configure the SSH daemon to not allow compression.\n\nUncomment the \"Compression\" keyword in \"/etc/ssh/sshd_config\" on the system and set the value to \"delayed\" or \"no\":\n\nCompression no\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61743r925991_chk", + "severity": "medium", + "gid": "V-258002", + "rid": "SV-258002r925993_rule", + "stig_id": "RHEL-09-255130", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61667r925992_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258003", + "code": "control 'SV-258003' do\n title 'The RHEL 8 SSH daemon must not allow GSSAPI authentication, except to fulfill documented and validated mission requirements.'\n desc 'Configuring this setting for the SSH daemon provides additional\nassurance that remote logon via SSH will require a password, even in the event\nof misconfiguration elsewhere.'\n desc 'check', 'Verify the SSH daemon does not allow GSSAPI authentication with the following command:\n\n$ sudo grep -ir GSSAPIAuthentication /etc/ssh/sshd_config*\n\nGSSAPIAuthentication no\n\nIf the value is returned as \"yes\", the returned line is commented out, no output is returned, or has not been documented with the ISSO, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the SSH daemon to not allow GSSAPI authentication.\n\n Add the following line in \"/etc/ssh/sshd_config\", or uncomment the line\nand set the value to \"no\":\n\n GSSAPIAuthentication no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.0\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244528'\n tag rid: 'SV-258003r858709_rule'\n tag stig_id: 'RHEL-08-010522'\n tag fix_id: 'F-47760r743832_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n setting = 'GSSAPIAuthentication'\n gssapi_authentication = input('sshd_config_values')\n value = gssapi_authentication[setting]\n\n if virtualization.system.eql?('docker')\n describe 'In a container Environment' do\n if package('openssh-server').installed?\n it 'the OpenSSH Server should be installed when allowed in Docker environment' do\n expect(input('allow_container_openssh_server')).to eq(true), 'OpenSSH Server is installed but not approved for the Docker environment'\n end\n else\n it 'the OpenSSH Server is not installed' do\n skip 'This requirement is not applicable as the OpenSSH Server is not installed in the Docker environment.'\n end\n end\n end\n else\n describe 'The OpenSSH Server configuration' do\n it \"has the correct #{setting} configuration\" do\n expect(sshd_config.params[setting.downcase]).to cmp(value), \"The #{setting} setting in the SSHD config is not correct. Please ensure it set to '#{value}'.\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258003.rb" + }, + "title": "The RHEL 8 SSH daemon must not allow GSSAPI authentication, except to fulfill documented and validated mission requirements.", + "desc": "Configuring this setting for the SSH daemon provides additional\nassurance that remote logon via SSH will require a password, even in the event\nof misconfiguration elsewhere.", + "descriptions": { + "default": "Configuring this setting for the SSH daemon provides additional\nassurance that remote logon via SSH will require a password, even in the event\nof misconfiguration elsewhere.", + "check": "Verify the SSH daemon does not allow GSSAPI authentication with the following command:\n\n$ sudo grep -ir GSSAPIAuthentication /etc/ssh/sshd_config*\n\nGSSAPIAuthentication no\n\nIf the value is returned as \"yes\", the returned line is commented out, no output is returned, or has not been documented with the ISSO, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the SSH daemon to not allow GSSAPI authentication.\n\n Add the following line in \"/etc/ssh/sshd_config\", or uncomment the line\nand set the value to \"no\":\n\n GSSAPIAuthentication no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244528", + "rid": "SV-258003r858709_rule", + "stig_id": "RHEL-08-010522", + "fix_id": "F-47760r743832_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258004", + "code": "control 'SV-258004' do\n title 'The RHEL 8 SSH daemon must not allow Kerberos authentication, except\nto fulfill documented and validated mission requirements.'\n desc 'Configuring these settings for the SSH daemon provides additional\nassurance that remote logon via SSH will not use unused methods of\nauthentication, even in the event of misconfiguration elsewhere.'\n desc 'check', 'Verify the SSH daemon does not allow Kerberos authentication with the following command:\n\n$ sudo grep -ir KerberosAuthentication /etc/ssh/sshd_config*\n\nKerberosAuthentication no\n\nIf the value is returned as \"yes\", the returned line is commented out, no output is returned, or has not been documented with the ISSO, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the SSH daemon to not allow Kerberos authentication.\n\n Add the following line in \"/etc/ssh/sshd_config\", or uncomment the line\nand set the value to \"no\":\n\n KerberosAuthentication no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230291'\n tag rid: 'SV-258004r858707_rule'\n tag stig_id: 'RHEL-08-010521'\n tag fix_id: 'F-32935r743956_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?)\n }\n\n describe sshd_config do\n its('KerberosAuthentication') { should cmp 'no' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258004.rb" + }, + "title": "The RHEL 8 SSH daemon must not allow Kerberos authentication, except\nto fulfill documented and validated mission requirements.", + "desc": "Configuring these settings for the SSH daemon provides additional\nassurance that remote logon via SSH will not use unused methods of\nauthentication, even in the event of misconfiguration elsewhere.", + "descriptions": { + "default": "Configuring these settings for the SSH daemon provides additional\nassurance that remote logon via SSH will not use unused methods of\nauthentication, even in the event of misconfiguration elsewhere.", + "check": "Verify the SSH daemon does not allow Kerberos authentication with the following command:\n\n$ sudo grep -ir KerberosAuthentication /etc/ssh/sshd_config*\n\nKerberosAuthentication no\n\nIf the value is returned as \"yes\", the returned line is commented out, no output is returned, or has not been documented with the ISSO, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the SSH daemon to not allow Kerberos authentication.\n\n Add the following line in \"/etc/ssh/sshd_config\", or uncomment the line\nand set the value to \"no\":\n\n KerberosAuthentication no\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230291", + "rid": "SV-258004r858707_rule", + "stig_id": "RHEL-08-010521", + "fix_id": "F-32935r743956_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258005", + "code": "control 'SV-258005' do\n title 'RHEL 9 SSH daemon must not allow rhosts authentication.'\n desc 'SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.'\n desc 'check', 'Verify the SSH daemon does not allow rhosts authentication with the following command:\n\n$ sudo grep -ir ignorerhosts /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\nIgnoreRhosts yes\n\nIf the value is returned as \"no\", the returned line is commented out, or no output is returned, this is a finding.'\n desc 'fix', 'Configure the SSH daemon to not allow rhosts authentication.\n\nAdd the following line in \"/etc/ssh/sshd_config\", or uncomment the line and set the value to \"yes\":\n\nIgnoreRhosts yes\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61746r926000_chk'\n tag severity: 'medium'\n tag gid: 'V-258005'\n tag rid: 'SV-258005r926002_rule'\n tag stig_id: 'RHEL-09-255145'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61670r926001_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258005.rb" + }, + "title": "RHEL 9 SSH daemon must not allow rhosts authentication.", + "desc": "SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.", + "descriptions": { + "default": "SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.", + "check": "Verify the SSH daemon does not allow rhosts authentication with the following command:\n\n$ sudo grep -ir ignorerhosts /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\nIgnoreRhosts yes\n\nIf the value is returned as \"no\", the returned line is commented out, or no output is returned, this is a finding.", + "fix": "Configure the SSH daemon to not allow rhosts authentication.\n\nAdd the following line in \"/etc/ssh/sshd_config\", or uncomment the line and set the value to \"yes\":\n\nIgnoreRhosts yes\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61746r926000_chk", + "severity": "medium", + "gid": "V-258005", + "rid": "SV-258005r926002_rule", + "stig_id": "RHEL-09-255145", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61670r926001_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258006", + "code": "control 'SV-258006' do\n title 'The RHEL 8 SSH daemon must not allow authentication using known host’s\nauthentication.'\n desc 'Configuring this setting for the SSH daemon provides additional\nassurance that remote logon via SSH will require a password, even in the event\nof misconfiguration elsewhere.'\n desc 'check', 'Verify the SSH daemon does not allow authentication using known host’s authentication with the following command:\n\n$ sudo grep -ir IgnoreUserKnownHosts /etc/ssh/sshd_config*\n\nIgnoreUserKnownHosts yes\n\nIf the value is returned as \"no\", the returned line is commented out, or no output is returned, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the SSH daemon to not allow authentication using known host’s\nauthentication.\n\n Add the following line in \"/etc/ssh/sshd_config\", or uncomment the line\nand set the value to \"yes\":\n\n IgnoreUserKnownHosts yes\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230290'\n tag rid: 'SV-258006r858705_rule'\n tag stig_id: 'RHEL-08-010520'\n tag fix_id: 'F-32934r567617_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?)\n }\n\n describe sshd_config do\n its('IgnoreUserKnownHosts') { should cmp 'yes' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258006.rb" + }, + "title": "The RHEL 8 SSH daemon must not allow authentication using known host’s\nauthentication.", + "desc": "Configuring this setting for the SSH daemon provides additional\nassurance that remote logon via SSH will require a password, even in the event\nof misconfiguration elsewhere.", + "descriptions": { + "default": "Configuring this setting for the SSH daemon provides additional\nassurance that remote logon via SSH will require a password, even in the event\nof misconfiguration elsewhere.", + "check": "Verify the SSH daemon does not allow authentication using known host’s authentication with the following command:\n\n$ sudo grep -ir IgnoreUserKnownHosts /etc/ssh/sshd_config*\n\nIgnoreUserKnownHosts yes\n\nIf the value is returned as \"no\", the returned line is commented out, or no output is returned, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the SSH daemon to not allow authentication using known host’s\nauthentication.\n\n Add the following line in \"/etc/ssh/sshd_config\", or uncomment the line\nand set the value to \"yes\":\n\n IgnoreUserKnownHosts yes\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230290", + "rid": "SV-258006r858705_rule", + "stig_id": "RHEL-08-010520", + "fix_id": "F-32934r567617_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258007", + "code": "control 'SV-258007' do\n title 'RHEL 8 remote X connections for interactive users must be disabled\nunless to fulfill documented and validated mission requirements.'\n desc %q(The security risk of using X11 forwarding is that the client's X11\ndisplay server may be exposed to attack when the SSH client requests\nforwarding. A system administrator may have a stance in which they want to\nprotect clients that may expose themselves to attack by unwittingly requesting\nX11 forwarding, which can warrant a \"no\" setting.\n\n X11 forwarding should be enabled with caution. Users with the ability to\nbypass file permissions on the remote host (for the user's X11 authorization\ndatabase) can access the local X11 display through the forwarded connection. An\nattacker may then be able to perform activities such as keystroke monitoring if\nthe ForwardX11Trusted option is also enabled.\n\n If X11 services are not required for the system's intended function, they\nshould be disabled or restricted as appropriate to the system’s needs.)\n desc 'check', 'Verify X11Forwarding is disabled with the following command:\n\n$ sudo grep -ir x11forwarding /etc/ssh/sshd_config* | grep -v \"^#\"\n\nX11Forwarding no\n\nIf the \"X11Forwarding\" keyword is set to \"yes\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement or is missing, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Edit the \"/etc/ssh/sshd_config\" file to uncomment or add the line for the\n\"X11Forwarding\" keyword and set its value to \"no\" (this file may be named\ndifferently or be in a different location if using a version of SSH that is\nprovided by a third-party vendor):\n\n X11Forwarding no\n\n The SSH service must be restarted for changes to take effect:\n\n $ sudo systemctl restart sshd'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230555'\n tag rid: 'SV-258007r858721_rule'\n tag stig_id: 'RHEL-08-040340'\n tag fix_id: 'F-33199r568412_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?)\n }\n\n describe sshd_config do\n its('X11Forwarding') { should cmp 'no' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258007.rb" + }, + "title": "RHEL 8 remote X connections for interactive users must be disabled\nunless to fulfill documented and validated mission requirements.", + "desc": "The security risk of using X11 forwarding is that the client's X11\ndisplay server may be exposed to attack when the SSH client requests\nforwarding. A system administrator may have a stance in which they want to\nprotect clients that may expose themselves to attack by unwittingly requesting\nX11 forwarding, which can warrant a \"no\" setting.\n\n X11 forwarding should be enabled with caution. Users with the ability to\nbypass file permissions on the remote host (for the user's X11 authorization\ndatabase) can access the local X11 display through the forwarded connection. An\nattacker may then be able to perform activities such as keystroke monitoring if\nthe ForwardX11Trusted option is also enabled.\n\n If X11 services are not required for the system's intended function, they\nshould be disabled or restricted as appropriate to the system’s needs.", + "descriptions": { + "default": "The security risk of using X11 forwarding is that the client's X11\ndisplay server may be exposed to attack when the SSH client requests\nforwarding. A system administrator may have a stance in which they want to\nprotect clients that may expose themselves to attack by unwittingly requesting\nX11 forwarding, which can warrant a \"no\" setting.\n\n X11 forwarding should be enabled with caution. Users with the ability to\nbypass file permissions on the remote host (for the user's X11 authorization\ndatabase) can access the local X11 display through the forwarded connection. An\nattacker may then be able to perform activities such as keystroke monitoring if\nthe ForwardX11Trusted option is also enabled.\n\n If X11 services are not required for the system's intended function, they\nshould be disabled or restricted as appropriate to the system’s needs.", + "check": "Verify X11Forwarding is disabled with the following command:\n\n$ sudo grep -ir x11forwarding /etc/ssh/sshd_config* | grep -v \"^#\"\n\nX11Forwarding no\n\nIf the \"X11Forwarding\" keyword is set to \"yes\" and is not documented with the Information System Security Officer (ISSO) as an operational requirement or is missing, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Edit the \"/etc/ssh/sshd_config\" file to uncomment or add the line for the\n\"X11Forwarding\" keyword and set its value to \"no\" (this file may be named\ndifferently or be in a different location if using a version of SSH that is\nprovided by a third-party vendor):\n\n X11Forwarding no\n\n The SSH service must be restarted for changes to take effect:\n\n $ sudo systemctl restart sshd" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230555", + "rid": "SV-258007r858721_rule", + "stig_id": "RHEL-08-040340", + "fix_id": "F-33199r568412_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258008", + "code": "control 'SV-258008' do\n title 'The RHEL 8 SSH daemon must perform strict mode checking of home\ndirectory configuration files.'\n desc 'If other users have access to modify user-specific SSH configuration\nfiles, they may be able to log on to the system as another user.'\n desc 'check', 'Verify the SSH daemon performs strict mode checking of home directory configuration files with the following command:\n\n$ sudo grep -ir strictmodes /etc/ssh/sshd_config*\n\nStrictModes yes\n\nIf \"StrictModes\" is set to \"no\", is missing, or the returned line is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure SSH to perform strict mode checking of home directory\nconfiguration files. Uncomment the \"StrictModes\" keyword in\n\"/etc/ssh/sshd_config\" and set the value to \"yes\":\n\n StrictModes yes\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230288'\n tag rid: 'SV-258008r858701_rule'\n tag stig_id: 'RHEL-08-010500'\n tag fix_id: 'F-32932r567611_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers without SSH installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !directory('/etc/ssh').exist?)\n }\n\n describe sshd_config do\n its('StrictModes') { should cmp 'yes' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258008.rb" + }, + "title": "The RHEL 8 SSH daemon must perform strict mode checking of home\ndirectory configuration files.", + "desc": "If other users have access to modify user-specific SSH configuration\nfiles, they may be able to log on to the system as another user.", + "descriptions": { + "default": "If other users have access to modify user-specific SSH configuration\nfiles, they may be able to log on to the system as another user.", + "check": "Verify the SSH daemon performs strict mode checking of home directory configuration files with the following command:\n\n$ sudo grep -ir strictmodes /etc/ssh/sshd_config*\n\nStrictModes yes\n\nIf \"StrictModes\" is set to \"no\", is missing, or the returned line is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure SSH to perform strict mode checking of home directory\nconfiguration files. Uncomment the \"StrictModes\" keyword in\n\"/etc/ssh/sshd_config\" and set the value to \"yes\":\n\n StrictModes yes\n\n The SSH daemon must be restarted for the changes to take effect. To restart\nthe SSH daemon, run the following command:\n\n $ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230288", + "rid": "SV-258008r858701_rule", + "stig_id": "RHEL-08-010500", + "fix_id": "F-32932r567611_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258009", + "code": "control 'SV-258009' do\n title 'RHEL 8 must display the date and time of the last successful account\nlogon upon an SSH logon.'\n desc 'Providing users with feedback on when account accesses via SSH last\noccurred facilitates user recognition and reporting of unauthorized account\nuse.'\n desc 'check', 'Verify SSH provides users with feedback on when account accesses last occurred with the following command:\n\n$ sudo grep -ir printlastlog /etc/ssh/sshd_config*\n\nPrintLastLog yes\n\nIf the \"PrintLastLog\" keyword is set to \"no\", is missing, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure SSH to provide users with feedback on when account accesses last\noccurred by setting the required configuration options in \"/etc/pam.d/sshd\"\nor in the \"sshd_config\" file used by the system (\"/etc/ssh/sshd_config\"\nwill be used in the example) (this file may be named differently or be in a\ndifferent location if using a version of SSH that is provided by a third-party\nvendor).\n\n Modify the \"PrintLastLog\" line in \"/etc/ssh/sshd_config\" to match the\nfollowing:\n\n PrintLastLog yes\n\n The SSH service must be restarted for changes to \"sshd_config\" to take\neffect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230382'\n tag rid: 'SV-258009r858717_rule'\n tag stig_id: 'RHEL-08-020350'\n tag fix_id: 'F-33026r567893_fix'\n tag cci: ['CCI-000366', 'CCI-000052']\n tag nist: ['CM-6 b', 'AC-9']\n tag 'host'\n tag 'container-conditional'\n\n if virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?\n impact 0.0\n describe 'Control not applicable - SSH is not installed within containerized RHEL' do\n skip 'Control not applicable - SSH is not installed within containerized RHEL'\n end\n else\n describe sshd_config do\n its('PrintLastLog') { should cmp 'yes' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258009.rb" + }, + "title": "RHEL 8 must display the date and time of the last successful account\nlogon upon an SSH logon.", + "desc": "Providing users with feedback on when account accesses via SSH last\noccurred facilitates user recognition and reporting of unauthorized account\nuse.", + "descriptions": { + "default": "Providing users with feedback on when account accesses via SSH last\noccurred facilitates user recognition and reporting of unauthorized account\nuse.", + "check": "Verify SSH provides users with feedback on when account accesses last occurred with the following command:\n\n$ sudo grep -ir printlastlog /etc/ssh/sshd_config*\n\nPrintLastLog yes\n\nIf the \"PrintLastLog\" keyword is set to \"no\", is missing, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure SSH to provide users with feedback on when account accesses last\noccurred by setting the required configuration options in \"/etc/pam.d/sshd\"\nor in the \"sshd_config\" file used by the system (\"/etc/ssh/sshd_config\"\nwill be used in the example) (this file may be named differently or be in a\ndifferent location if using a version of SSH that is provided by a third-party\nvendor).\n\n Modify the \"PrintLastLog\" line in \"/etc/ssh/sshd_config\" to match the\nfollowing:\n\n PrintLastLog yes\n\n The SSH service must be restarted for changes to \"sshd_config\" to take\neffect." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230382", + "rid": "SV-258009r858717_rule", + "stig_id": "RHEL-08-020350", + "fix_id": "F-33026r567893_fix", + "cci": [ + "CCI-000366", + "CCI-000052" + ], + "nist": [ + "CM-6 b", + "AC-9" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258010", + "code": "control 'SV-258010' do\n title 'RHEL 9 SSH daemon must be configured to use privilege separation.'\n desc 'SSH daemon privilege separation causes the SSH process to drop root privileges when not needed, which would decrease the impact of software vulnerabilities in the nonprivileged section.'\n desc 'check', 'Verify the SSH daemon performs privilege separation with the following command:\n\n$ sudo grep -ir usepriv /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\nUsePrivilegeSeparation sandbox\n\nIf the \"UsePrivilegeSeparation\" keyword is set to \"no\", the returned line is commented out, or no output is returned, this is a finding.'\n desc 'fix', 'Configure the SSH daemon to perform privilege separation.\n\nAdd the following line in \"/etc/ssh/sshd_config\", or uncomment the line and set the value to \"yes\" or \"sandbox\":\n\nUsePrivilegeSeparation sandbox\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61751r926015_chk'\n tag severity: 'medium'\n tag gid: 'V-258010'\n tag rid: 'SV-258010r926017_rule'\n tag stig_id: 'RHEL-09-255170'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61675r926016_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258010.rb" + }, + "title": "RHEL 9 SSH daemon must be configured to use privilege separation.", + "desc": "SSH daemon privilege separation causes the SSH process to drop root privileges when not needed, which would decrease the impact of software vulnerabilities in the nonprivileged section.", + "descriptions": { + "default": "SSH daemon privilege separation causes the SSH process to drop root privileges when not needed, which would decrease the impact of software vulnerabilities in the nonprivileged section.", + "check": "Verify the SSH daemon performs privilege separation with the following command:\n\n$ sudo grep -ir usepriv /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*\n\nUsePrivilegeSeparation sandbox\n\nIf the \"UsePrivilegeSeparation\" keyword is set to \"no\", the returned line is commented out, or no output is returned, this is a finding.", + "fix": "Configure the SSH daemon to perform privilege separation.\n\nAdd the following line in \"/etc/ssh/sshd_config\", or uncomment the line and set the value to \"yes\" or \"sandbox\":\n\nUsePrivilegeSeparation sandbox\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61751r926015_chk", + "severity": "medium", + "gid": "V-258010", + "rid": "SV-258010r926017_rule", + "stig_id": "RHEL-09-255170", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61675r926016_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258011", + "code": "control 'SV-258011' do\n title 'The RHEL 8 SSH daemon must prevent remote hosts from connecting to the\nproxy display.'\n desc 'When X11 forwarding is enabled, there may be additional exposure to\nthe server and client displays if the sshd proxy display is configured to\nlisten on the wildcard address. By default, sshd binds the forwarding server\nto the loopback address and sets the hostname part of the DIPSLAY environment\nvariable to localhost. This prevents remote hosts from connecting to the proxy\ndisplay.'\n desc 'check', 'Verify the SSH daemon prevents remote hosts from connecting to the proxy display.\n\nCheck the SSH X11UseLocalhost setting with the following command:\n\n# sudo grep -ir x11uselocalhost /etc/ssh/sshd_config*\nX11UseLocalhost yes\n\nIf the \"X11UseLocalhost\" keyword is set to \"no\", is missing, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the SSH daemon to prevent remote hosts from connecting to the\nproxy display.\n\n Edit the \"/etc/ssh/sshd_config\" file to uncomment or add the line for the\n\"X11UseLocalhost\" keyword and set its value to \"yes\" (this file may be\nnamed differently or be in a different location if using a version of SSH that\nis provided by a third-party vendor):\n\n X11UseLocalhost yes'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230556'\n tag rid: 'SV-258011r858723_rule'\n tag stig_id: 'RHEL-08-040341'\n tag fix_id: 'F-33200r568415_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?)\n }\n\n describe sshd_config do\n its('X11UseLocalhost') { should cmp 'yes' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258011.rb" + }, + "title": "The RHEL 8 SSH daemon must prevent remote hosts from connecting to the\nproxy display.", + "desc": "When X11 forwarding is enabled, there may be additional exposure to\nthe server and client displays if the sshd proxy display is configured to\nlisten on the wildcard address. By default, sshd binds the forwarding server\nto the loopback address and sets the hostname part of the DIPSLAY environment\nvariable to localhost. This prevents remote hosts from connecting to the proxy\ndisplay.", + "descriptions": { + "default": "When X11 forwarding is enabled, there may be additional exposure to\nthe server and client displays if the sshd proxy display is configured to\nlisten on the wildcard address. By default, sshd binds the forwarding server\nto the loopback address and sets the hostname part of the DIPSLAY environment\nvariable to localhost. This prevents remote hosts from connecting to the proxy\ndisplay.", + "check": "Verify the SSH daemon prevents remote hosts from connecting to the proxy display.\n\nCheck the SSH X11UseLocalhost setting with the following command:\n\n# sudo grep -ir x11uselocalhost /etc/ssh/sshd_config*\nX11UseLocalhost yes\n\nIf the \"X11UseLocalhost\" keyword is set to \"no\", is missing, or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the SSH daemon to prevent remote hosts from connecting to the\nproxy display.\n\n Edit the \"/etc/ssh/sshd_config\" file to uncomment or add the line for the\n\"X11UseLocalhost\" keyword and set its value to \"yes\" (this file may be\nnamed differently or be in a different location if using a version of SSH that\nis provided by a third-party vendor):\n\n X11UseLocalhost yes" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230556", + "rid": "SV-258011r858723_rule", + "stig_id": "RHEL-08-040341", + "fix_id": "F-33200r568415_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258012", + "code": "control 'SV-258012' do\n title 'RHEL 8 must display a banner before granting local or remote access to\nthe system via a graphical user logon.'\n desc 'Display of a standardized and approved use notification before\ngranting access to the operating system ensures privacy and security\nnotification verbiage used is consistent with applicable federal laws,\nExecutive Orders, directives, policies, regulations, standards, and guidance.\n\n System use notifications are required only for access via logon interfaces\nwith human users and are not required when such human interfaces do not exist.'\n desc 'check', 'Verify RHEL 8 displays a banner before granting access to the operating\nsystem via a graphical user logon.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Check to see if the operating system displays a banner at the logon screen\nwith the following command:\n\n $ sudo grep banner-message-enable /etc/dconf/db/local.d/*\n\n banner-message-enable=true\n\n If \"banner-message-enable\" is set to \"false\" or is missing, this is a\nfinding.'\n desc 'fix', 'Configure the operating system to display a banner before granting access\nto the system.\n\n Note: If the system does not have a graphical user interface installed,\nthis requirement is Not Applicable.\n\n Create a database to contain the system-wide graphical user logon settings\n(if it does not already exist) with the following command:\n\n $ sudo touch /etc/dconf/db/local.d/01-banner-message\n\n Add the following lines to the [org/gnome/login-screen] section of the\n\"/etc/dconf/db/local.d/01-banner-message\":\n\n [org/gnome/login-screen]\n\n banner-message-enable=true\n\n Run the following command to update the database:\n\n $ sudo dconf update'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000023-GPOS-00006'\n tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088']\n tag gid: 'V-244519'\n tag rid: 'SV-258012r743806_rule'\n tag stig_id: 'RHEL-08-010049'\n tag fix_id: 'F-47751r743805_fix'\n tag cci: ['CCI-000048']\n tag nist: ['AC-8 a']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/)\n\n if no_gui\n impact 0.0\n describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do\n skip 'A GUI desktop is not installed, this control is Not Applicable.'\n end\n else\n describe command('grep ^banner-message-enable /etc/dconf/db/local.d/*') do\n its('stdout.strip') { should cmp 'banner-message-enable=true' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258012.rb" + }, + "title": "RHEL 8 must display a banner before granting local or remote access to\nthe system via a graphical user logon.", + "desc": "Display of a standardized and approved use notification before\ngranting access to the operating system ensures privacy and security\nnotification verbiage used is consistent with applicable federal laws,\nExecutive Orders, directives, policies, regulations, standards, and guidance.\n\n System use notifications are required only for access via logon interfaces\nwith human users and are not required when such human interfaces do not exist.", + "descriptions": { + "default": "Display of a standardized and approved use notification before\ngranting access to the operating system ensures privacy and security\nnotification verbiage used is consistent with applicable federal laws,\nExecutive Orders, directives, policies, regulations, standards, and guidance.\n\n System use notifications are required only for access via logon interfaces\nwith human users and are not required when such human interfaces do not exist.", + "check": "Verify RHEL 8 displays a banner before granting access to the operating\nsystem via a graphical user logon.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Check to see if the operating system displays a banner at the logon screen\nwith the following command:\n\n $ sudo grep banner-message-enable /etc/dconf/db/local.d/*\n\n banner-message-enable=true\n\n If \"banner-message-enable\" is set to \"false\" or is missing, this is a\nfinding.", + "fix": "Configure the operating system to display a banner before granting access\nto the system.\n\n Note: If the system does not have a graphical user interface installed,\nthis requirement is Not Applicable.\n\n Create a database to contain the system-wide graphical user logon settings\n(if it does not already exist) with the following command:\n\n $ sudo touch /etc/dconf/db/local.d/01-banner-message\n\n Add the following lines to the [org/gnome/login-screen] section of the\n\"/etc/dconf/db/local.d/01-banner-message\":\n\n [org/gnome/login-screen]\n\n banner-message-enable=true\n\n Run the following command to update the database:\n\n $ sudo dconf update" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000023-GPOS-00006", + "satisfies": [ + "SRG-OS-000023-GPOS-00006", + "SRG-OS-000228-GPOS-00088" + ], + "gid": "V-244519", + "rid": "SV-258012r743806_rule", + "stig_id": "RHEL-08-010049", + "fix_id": "F-47751r743805_fix", + "cci": [ + "CCI-000048" + ], + "nist": [ + "AC-8 a" + ], + "host": null + } + }, + { + "id": "SV-258013", + "code": "control 'SV-258013' do\n title 'RHEL 9 must prevent a user from overriding the banner-message-enable setting for the graphical user interface.'\n desc 'Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.\n\nFor U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist.\n\n'\n desc 'check', 'Verify RHEL 9 prevents a user from overriding settings for graphical user interfaces. \n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that graphical settings are locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ sudo grep banner-message-enable /etc/dconf/db/local.d/* \n\n/org/gnome/login-screen/banner-message-enable\n\nIf the output is not \"/org/gnome/login-screen/banner-message-enable\", the line is commented out, or the line is missing, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to prevent a user from overriding the banner setting for graphical user interfaces. \n\nCreate a database to contain the system-wide graphical user logon settings (if it does not already exist) with the following command:\n\n$ sudo touch /etc/dconf/db/local.d/locks/session\n\nAdd the following setting to prevent nonprivileged users from modifying it:\n\nbanner-message-enable\n\nRun the following command to update the database:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61754r926024_chk'\n tag severity: 'medium'\n tag gid: 'V-258013'\n tag rid: 'SV-258013r926026_rule'\n tag stig_id: 'RHEL-09-271015'\n tag gtitle: 'SRG-OS-000023-GPOS-00006'\n tag fix_id: 'F-61678r926025_fix'\n tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088']\n tag 'documentable'\n tag cci: ['CCI-000048', 'CCI-001384', 'CCI-001385', 'CCI-001386', 'CCI-001387', 'CCI-001388']\n tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 2', 'AC-8 c 3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258013.rb" + }, + "title": "RHEL 9 must prevent a user from overriding the banner-message-enable setting for the graphical user interface.", + "desc": "Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.\n\nFor U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist.\n\n", + "descriptions": { + "default": "Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance.\n\nFor U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist.\n\n", + "check": "Verify RHEL 9 prevents a user from overriding settings for graphical user interfaces. \n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that graphical settings are locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ sudo grep banner-message-enable /etc/dconf/db/local.d/* \n\n/org/gnome/login-screen/banner-message-enable\n\nIf the output is not \"/org/gnome/login-screen/banner-message-enable\", the line is commented out, or the line is missing, this is a finding.", + "fix": "Configure RHEL 9 to prevent a user from overriding the banner setting for graphical user interfaces. \n\nCreate a database to contain the system-wide graphical user logon settings (if it does not already exist) with the following command:\n\n$ sudo touch /etc/dconf/db/local.d/locks/session\n\nAdd the following setting to prevent nonprivileged users from modifying it:\n\nbanner-message-enable\n\nRun the following command to update the database:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61754r926024_chk", + "severity": "medium", + "gid": "V-258013", + "rid": "SV-258013r926026_rule", + "stig_id": "RHEL-09-271015", + "gtitle": "SRG-OS-000023-GPOS-00006", + "fix_id": "F-61678r926025_fix", + "satisfies": [ + "SRG-OS-000023-GPOS-00006", + "SRG-OS-000228-GPOS-00088" + ], + "documentable": null, + "cci": [ + "CCI-000048", + "CCI-001384", + "CCI-001385", + "CCI-001386", + "CCI-001387", + "CCI-001388" + ], + "nist": [ + "AC-8 a", + "AC-8 c 1", + "AC-8 c 2", + "AC-8 c 2", + "AC-8 c 2", + "AC-8 c 3" + ] + } + }, + { + "id": "SV-258014", + "code": "control 'SV-258014' do\n title 'RHEL 9 must disable the graphical user interface automount function unless required.'\n desc 'Automatically mounting file systems permits easy introduction of unknown devices, thereby facilitating malicious activity.\n\n'\n desc 'check', 'Verify RHEL 9 disables the graphical user interface automount function with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.desktop.media-handling automount-open \n\nfalse\n\nIf \"automount-open\" is set to \"true\", and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the GNOME desktop to disable automated mounting of removable media.\n\nThe dconf settings can be edited in the /etc/dconf/db/* location.\n\nUpdate the [org/gnome/desktop/media-handling] section of the \"/etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/desktop/media-handling]\nautomount-open=false\n\nThen update the dconf system databases:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61755r926027_chk'\n tag severity: 'medium'\n tag gid: 'V-258014'\n tag rid: 'SV-258014r926029_rule'\n tag stig_id: 'RHEL-09-271020'\n tag gtitle: 'SRG-OS-000114-GPOS-00059'\n tag fix_id: 'F-61679r926028_fix'\n tag satisfies: ['SRG-OS-000114-GPOS-00059', 'SRG-OS-000378-GPOS-00163', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958']\n tag nist: ['CM-6 b', 'IA-3', 'IA-3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258014.rb" + }, + "title": "RHEL 9 must disable the graphical user interface automount function unless required.", + "desc": "Automatically mounting file systems permits easy introduction of unknown devices, thereby facilitating malicious activity.\n\n", + "descriptions": { + "default": "Automatically mounting file systems permits easy introduction of unknown devices, thereby facilitating malicious activity.\n\n", + "check": "Verify RHEL 9 disables the graphical user interface automount function with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.desktop.media-handling automount-open \n\nfalse\n\nIf \"automount-open\" is set to \"true\", and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.", + "fix": "Configure the GNOME desktop to disable automated mounting of removable media.\n\nThe dconf settings can be edited in the /etc/dconf/db/* location.\n\nUpdate the [org/gnome/desktop/media-handling] section of the \"/etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/desktop/media-handling]\nautomount-open=false\n\nThen update the dconf system databases:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61755r926027_chk", + "severity": "medium", + "gid": "V-258014", + "rid": "SV-258014r926029_rule", + "stig_id": "RHEL-09-271020", + "gtitle": "SRG-OS-000114-GPOS-00059", + "fix_id": "F-61679r926028_fix", + "satisfies": [ + "SRG-OS-000114-GPOS-00059", + "SRG-OS-000378-GPOS-00163", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-000778", + "CCI-001958" + ], + "nist": [ + "CM-6 b", + "IA-3", + "IA-3" + ] + } + }, + { + "id": "SV-258015", + "code": "control 'SV-258015' do\n title 'RHEL 9 must prevent a user from overriding the disabling of the graphical user interface automount function.'\n desc 'A nonprivileged account is any operating system account with authorizations of a nonprivileged user.\n\n'\n desc 'check', %q(Verify RHEL 9 disables ability of the user to override the graphical user interface automount setting.\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that the automount setting is locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep 'automount-open' /etc/dconf/db/local.d/locks/* \n\n/org/gnome/desktop/media-handling/automount-open\n\nIf the command does not return at least the example result, this is a finding.)\n desc 'fix', 'Configure the GNOME desktop to not allow a user to change the setting that disables automated mounting of removable media.\n\nAdd the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user modification:\n\n/org/gnome/desktop/media-handling/automount-open\n\nThen update the dconf system databases:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61756r926030_chk'\n tag severity: 'medium'\n tag gid: 'V-258015'\n tag rid: 'SV-258015r926032_rule'\n tag stig_id: 'RHEL-09-271025'\n tag gtitle: 'SRG-OS-000114-GPOS-00059'\n tag fix_id: 'F-61680r926031_fix'\n tag satisfies: ['SRG-OS-000114-GPOS-00059', 'SRG-OS-000378-GPOS-00163', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958']\n tag nist: ['CM-6 b', 'IA-3', 'IA-3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258015.rb" + }, + "title": "RHEL 9 must prevent a user from overriding the disabling of the graphical user interface automount function.", + "desc": "A nonprivileged account is any operating system account with authorizations of a nonprivileged user.\n\n", + "descriptions": { + "default": "A nonprivileged account is any operating system account with authorizations of a nonprivileged user.\n\n", + "check": "Verify RHEL 9 disables ability of the user to override the graphical user interface automount setting.\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that the automount setting is locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep 'automount-open' /etc/dconf/db/local.d/locks/* \n\n/org/gnome/desktop/media-handling/automount-open\n\nIf the command does not return at least the example result, this is a finding.", + "fix": "Configure the GNOME desktop to not allow a user to change the setting that disables automated mounting of removable media.\n\nAdd the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user modification:\n\n/org/gnome/desktop/media-handling/automount-open\n\nThen update the dconf system databases:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61756r926030_chk", + "severity": "medium", + "gid": "V-258015", + "rid": "SV-258015r926032_rule", + "stig_id": "RHEL-09-271025", + "gtitle": "SRG-OS-000114-GPOS-00059", + "fix_id": "F-61680r926031_fix", + "satisfies": [ + "SRG-OS-000114-GPOS-00059", + "SRG-OS-000378-GPOS-00163", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-000778", + "CCI-001958" + ], + "nist": [ + "CM-6 b", + "IA-3", + "IA-3" + ] + } + }, + { + "id": "SV-258016", + "code": "control 'SV-258016' do\n title 'RHEL 9 must disable the graphical user interface autorun function unless required.'\n desc 'Allowing autorun commands to execute may introduce malicious code to a system. Configuring this setting prevents autorun commands from executing.'\n desc 'check', 'Verify RHEL 9 disables the graphical user interface autorun function with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.desktop.media-handling autorun-never \n\ntrue\n\nIf \"autorun-never\" is set to \"false\", and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the GNOME desktop to disable the autorun function on removable media.\n\nThe dconf settings can be edited in the /etc/dconf/db/* location.\n\nUpdate the [org/gnome/desktop/media-handling] section of the \"/etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/desktop/media-handling]\nautorun-never=true\n\nThen update the dconf system databases:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61757r926033_chk'\n tag severity: 'medium'\n tag gid: 'V-258016'\n tag rid: 'SV-258016r926035_rule'\n tag stig_id: 'RHEL-09-271030'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag fix_id: 'F-61681r926034_fix'\n tag 'documentable'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258016.rb" + }, + "title": "RHEL 9 must disable the graphical user interface autorun function unless required.", + "desc": "Allowing autorun commands to execute may introduce malicious code to a system. Configuring this setting prevents autorun commands from executing.", + "descriptions": { + "default": "Allowing autorun commands to execute may introduce malicious code to a system. Configuring this setting prevents autorun commands from executing.", + "check": "Verify RHEL 9 disables the graphical user interface autorun function with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.desktop.media-handling autorun-never \n\ntrue\n\nIf \"autorun-never\" is set to \"false\", and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.", + "fix": "Configure the GNOME desktop to disable the autorun function on removable media.\n\nThe dconf settings can be edited in the /etc/dconf/db/* location.\n\nUpdate the [org/gnome/desktop/media-handling] section of the \"/etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/desktop/media-handling]\nautorun-never=true\n\nThen update the dconf system databases:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61757r926033_chk", + "severity": "medium", + "gid": "V-258016", + "rid": "SV-258016r926035_rule", + "stig_id": "RHEL-09-271030", + "gtitle": "SRG-OS-000368-GPOS-00154", + "fix_id": "F-61681r926034_fix", + "documentable": null, + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ] + } + }, + { + "id": "SV-258017", + "code": "control 'SV-258017' do\n title 'RHEL 9 must prevent a user from overriding the disabling of the graphical user interface autorun function.'\n desc 'Techniques used to address this include protocols using nonces (e.g., numbers generated for a specific one-time use) or challenges (e.g., TLS, WS_Security). Additional techniques include time-synchronous or challenge-response one-time authenticators.\n\n'\n desc 'check', %q(Verify RHEL 9 disables ability of the user to override the graphical user interface autorun setting.\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that the automount setting is locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep 'autorun-never' /etc/dconf/db/local.d/locks/* \n\n/org/gnome/desktop/media-handling/autorun-never\n\nIf the command does not return at least the example result, this is a finding.)\n desc 'fix', 'Configure the GNOME desktop to not allow a user to change the setting that disables autorun on removable media.\n\nAdd the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user modification:\n\n/org/gnome/desktop/media-handling/autorun-never\n\nThen update the dconf system databases:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61758r926036_chk'\n tag severity: 'medium'\n tag gid: 'V-258017'\n tag rid: 'SV-258017r926038_rule'\n tag stig_id: 'RHEL-09-271035'\n tag gtitle: 'SRG-OS-000114-GPOS-00059'\n tag fix_id: 'F-61682r926037_fix'\n tag satisfies: ['SRG-OS-000114-GPOS-00059', 'SRG-OS-000378-GPOS-00163', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-000778', 'CCI-001958']\n tag nist: ['CM-6 b', 'IA-3', 'IA-3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258017.rb" + }, + "title": "RHEL 9 must prevent a user from overriding the disabling of the graphical user interface autorun function.", + "desc": "Techniques used to address this include protocols using nonces (e.g., numbers generated for a specific one-time use) or challenges (e.g., TLS, WS_Security). Additional techniques include time-synchronous or challenge-response one-time authenticators.\n\n", + "descriptions": { + "default": "Techniques used to address this include protocols using nonces (e.g., numbers generated for a specific one-time use) or challenges (e.g., TLS, WS_Security). Additional techniques include time-synchronous or challenge-response one-time authenticators.\n\n", + "check": "Verify RHEL 9 disables ability of the user to override the graphical user interface autorun setting.\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that the automount setting is locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep 'autorun-never' /etc/dconf/db/local.d/locks/* \n\n/org/gnome/desktop/media-handling/autorun-never\n\nIf the command does not return at least the example result, this is a finding.", + "fix": "Configure the GNOME desktop to not allow a user to change the setting that disables autorun on removable media.\n\nAdd the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user modification:\n\n/org/gnome/desktop/media-handling/autorun-never\n\nThen update the dconf system databases:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61758r926036_chk", + "severity": "medium", + "gid": "V-258017", + "rid": "SV-258017r926038_rule", + "stig_id": "RHEL-09-271035", + "gtitle": "SRG-OS-000114-GPOS-00059", + "fix_id": "F-61682r926037_fix", + "satisfies": [ + "SRG-OS-000114-GPOS-00059", + "SRG-OS-000378-GPOS-00163", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366", + "CCI-000778", + "CCI-001958" + ], + "nist": [ + "CM-6 b", + "IA-3", + "IA-3" + ] + } + }, + { + "id": "SV-258018", + "code": "control 'SV-258018' do\n title 'Unattended or automatic logon via the RHEL 8 graphical user interface\nmust not be allowed.'\n desc 'Failure to restrict system access to authenticated users negatively\nimpacts operating system security.'\n desc 'check', 'Verify the operating system does not allow an unattended or automatic logon\nto the system via a graphical user interface.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Check for the value of the \"AutomaticLoginEnable\" in the\n\"/etc/gdm/custom.conf\" file with the following command:\n\n $ sudo grep -i automaticloginenable /etc/gdm/custom.conf\n\n AutomaticLoginEnable=false\n\n If the value of \"AutomaticLoginEnable\" is not set to \"false\", this is a\nfinding.'\n desc 'fix', 'Configure the operating system to not allow an unattended or automatic\nlogon to the system via a graphical user interface.\n\n Add or edit the line for the \"AutomaticLoginEnable\" parameter in the\n[daemon] section of the \"/etc/gdm/custom.conf\" file to \"false\":\n\n [daemon]\n AutomaticLoginEnable=false'\n impact 0.5\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00229'\n tag gid: 'V-230329'\n tag rid: 'SV-258018r877377_rule'\n tag stig_id: 'RHEL-08-010820'\n tag fix_id: 'F-32973r567734_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable inside a container, the containers host manages the containers filesystems') {\n !virtualization.system.eql?('docker')\n }\n\n custom_conf = '/etc/gdm/custom.conf'\n\n if package('gnome-desktop3').installed?\n if (f = file(custom_conf)).exist?\n describe parse_config_file(custom_conf) do\n its('daemon.AutomaticLoginEnable') { cmp false }\n end\n else\n describe f do\n it { should exist }\n end\n end\n else\n impact 0.0\n describe 'The system does not have GDM installed' do\n skip 'The system does not have GDM installed, this requirement is Not Applicable.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258018.rb" + }, + "title": "Unattended or automatic logon via the RHEL 8 graphical user interface\nmust not be allowed.", + "desc": "Failure to restrict system access to authenticated users negatively\nimpacts operating system security.", + "descriptions": { + "default": "Failure to restrict system access to authenticated users negatively\nimpacts operating system security.", + "check": "Verify the operating system does not allow an unattended or automatic logon\nto the system via a graphical user interface.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Check for the value of the \"AutomaticLoginEnable\" in the\n\"/etc/gdm/custom.conf\" file with the following command:\n\n $ sudo grep -i automaticloginenable /etc/gdm/custom.conf\n\n AutomaticLoginEnable=false\n\n If the value of \"AutomaticLoginEnable\" is not set to \"false\", this is a\nfinding.", + "fix": "Configure the operating system to not allow an unattended or automatic\nlogon to the system via a graphical user interface.\n\n Add or edit the line for the \"AutomaticLoginEnable\" parameter in the\n[daemon] section of the \"/etc/gdm/custom.conf\" file to \"false\":\n\n [daemon]\n AutomaticLoginEnable=false" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00229", + "gid": "V-230329", + "rid": "SV-258018r877377_rule", + "stig_id": "RHEL-08-010820", + "fix_id": "F-32973r567734_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258019", + "code": "control 'SV-258019' do\n title 'RHEL 8 must be able to initiate directly a session lock for all\n connection types using smartcard when the smartcard is removed.'\n desc 'A session lock is a temporary action taken when a user stops work and\n moves away from the immediate physical vicinity of the information system but\n does not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\n determined. Rather than be forced to wait for a period of time to expire before\n the user session can be locked, RHEL 8 needs to provide users with the ability\n to manually invoke a session lock so users can secure their session if it is\n necessary to temporarily vacate the immediate physical vicinity.'\n desc 'check', %q(Verify the operating system enables a user's session lock\n until that user re-establishes access using established identification and\n authentication procedures with the following command:\n\n This requirement assumes the use of the RHEL 8 default graphical user interface,\n Gnome Shell. If the system does not have any graphical user interface installed,\n this requirement is Not Applicable.\n\n $ sudo grep -R removal-action /etc/dconf/db/*\n\n /etc/dconf/db/distro.d/20-authselect:removal-action='lock-screen'\n\n If the \"removal-action='lock-screen'\" setting is missing or commented out from\n the dconf database files, this is a finding.)\n desc 'fix', %q(Configure the operating system to enable a user's session lock\n until that user re-establishes access using established identification and\n authentication procedures.\n\n Select/Create an authselect profile and incorporate the\n \"with-smartcard-lock-on-removal\" feature with the following example:\n\n $sudo authselect select sssd with-smartcard with-smartcard-lock-on-removal\n\n Alternatively, the dconf settings can be edited in the /etc/dconf/db/* location.\n\n Edit or add the \"[org/gnome/settings-daemon/peripherals/smartcard]\" section of\n the database file and add or update the following lines:\n\n removal-action='lock-screen'\n\n Update the system databases:\n\n $sudo dconf update)\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag gid: 'V-230351'\n tag rid: 'SV-258019r792899_rule'\n tag stig_id: 'RHEL-08-020050'\n tag fix_id: 'F-32995r792898_fix'\n tag cci: ['CCI-000056']\n tag nist: ['AC-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if !input('smart_card_enabled')\n impact 0.0\n describe \"The system is not smartcard enabled thus this control is Not\n Applicable\" do\n skip \"The system is not using Smartcards / PIVs to fulfil the MFA\n requirement, this control is Not Applicable.\"\n end\n elsif !package('gnome-desktop3').installed?\n impact 0.0\n describe 'The system does not have GNOME installed' do\n skip \"The system does not have GNOME installed, this requirement is Not\n Applicable.\"\n end\n else\n\n # we're going to do this with grep to avoid doing really complicated tree parsing logic\n dconf = command('grep -R removal-action /etc/dconf/db/*').stdout.strip\n\n describe 'The dconf database' do\n it 'should be set to initate a session lock when a smartcard is removed' do\n expect(dconf).to match(/removal-action\\s*=\\s*['\"]lock-screen['\"]/), 'lock-screen setting not found'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258019.rb" + }, + "title": "RHEL 8 must be able to initiate directly a session lock for all\n connection types using smartcard when the smartcard is removed.", + "desc": "A session lock is a temporary action taken when a user stops work and\n moves away from the immediate physical vicinity of the information system but\n does not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\n determined. Rather than be forced to wait for a period of time to expire before\n the user session can be locked, RHEL 8 needs to provide users with the ability\n to manually invoke a session lock so users can secure their session if it is\n necessary to temporarily vacate the immediate physical vicinity.", + "descriptions": { + "default": "A session lock is a temporary action taken when a user stops work and\n moves away from the immediate physical vicinity of the information system but\n does not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\n determined. Rather than be forced to wait for a period of time to expire before\n the user session can be locked, RHEL 8 needs to provide users with the ability\n to manually invoke a session lock so users can secure their session if it is\n necessary to temporarily vacate the immediate physical vicinity.", + "check": "Verify the operating system enables a user's session lock\n until that user re-establishes access using established identification and\n authentication procedures with the following command:\n\n This requirement assumes the use of the RHEL 8 default graphical user interface,\n Gnome Shell. If the system does not have any graphical user interface installed,\n this requirement is Not Applicable.\n\n $ sudo grep -R removal-action /etc/dconf/db/*\n\n /etc/dconf/db/distro.d/20-authselect:removal-action='lock-screen'\n\n If the \"removal-action='lock-screen'\" setting is missing or commented out from\n the dconf database files, this is a finding.", + "fix": "Configure the operating system to enable a user's session lock\n until that user re-establishes access using established identification and\n authentication procedures.\n\n Select/Create an authselect profile and incorporate the\n \"with-smartcard-lock-on-removal\" feature with the following example:\n\n $sudo authselect select sssd with-smartcard with-smartcard-lock-on-removal\n\n Alternatively, the dconf settings can be edited in the /etc/dconf/db/* location.\n\n Edit or add the \"[org/gnome/settings-daemon/peripherals/smartcard]\" section of\n the database file and add or update the following lines:\n\n removal-action='lock-screen'\n\n Update the system databases:\n\n $sudo dconf update" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000028-GPOS-00009", + "satisfies": [ + "SRG-OS-000028-GPOS-00009", + "SRG-OS-000030-GPOS-00011" + ], + "gid": "V-230351", + "rid": "SV-258019r792899_rule", + "stig_id": "RHEL-08-020050", + "fix_id": "F-32995r792898_fix", + "cci": [ + "CCI-000056" + ], + "nist": [ + "AC-11 b" + ], + "host": null + } + }, + { + "id": "SV-258020", + "code": "control 'SV-258020' do\n title 'RHEL 9 must prevent a user from overriding the disabling of the graphical user smart card removal action.'\n desc 'A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence.\n\nThe session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity.\n\n'\n desc 'check', %q(Verify RHEL 9 disables ability of the user to override the smart card removal action setting.\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that the removal action setting is locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep 'removal-action' /etc/dconf/db/local.d/locks/* \n\n/org/gnome/settings-daemon/peripherals/smartcard/removal-action\n\nIf the command does not return at least the example result, this is a finding.)\n desc 'fix', 'Add the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user override of the smart card removal action:\n\n/org/gnome/settings-daemon/peripherals/smartcard/removal-action\n\nThen update the dconf system databases:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61761r926045_chk'\n tag severity: 'medium'\n tag gid: 'V-258020'\n tag rid: 'SV-258020r926047_rule'\n tag stig_id: 'RHEL-09-271050'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag fix_id: 'F-61685r926046_fix'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag 'documentable'\n tag cci: ['CCI-000056', 'CCI-000058']\n tag nist: ['AC-11 b', 'AC-11 a']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258020.rb" + }, + "title": "RHEL 9 must prevent a user from overriding the disabling of the graphical user smart card removal action.", + "desc": "A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence.\n\nThe session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity.\n\n", + "descriptions": { + "default": "A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence.\n\nThe session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity.\n\n", + "check": "Verify RHEL 9 disables ability of the user to override the smart card removal action setting.\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that the removal action setting is locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep 'removal-action' /etc/dconf/db/local.d/locks/* \n\n/org/gnome/settings-daemon/peripherals/smartcard/removal-action\n\nIf the command does not return at least the example result, this is a finding.", + "fix": "Add the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user override of the smart card removal action:\n\n/org/gnome/settings-daemon/peripherals/smartcard/removal-action\n\nThen update the dconf system databases:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61761r926045_chk", + "severity": "medium", + "gid": "V-258020", + "rid": "SV-258020r926047_rule", + "stig_id": "RHEL-09-271050", + "gtitle": "SRG-OS-000028-GPOS-00009", + "fix_id": "F-61685r926046_fix", + "satisfies": [ + "SRG-OS-000028-GPOS-00009", + "SRG-OS-000030-GPOS-00011" + ], + "documentable": null, + "cci": [ + "CCI-000056", + "CCI-000058" + ], + "nist": [ + "AC-11 b", + "AC-11 a" + ] + } + }, + { + "id": "SV-258021", + "code": "control 'SV-258021' do\n title 'RHEL 8 must enable a user session lock until that user re-establishes\naccess using established identification and authentication procedures for\ngraphical user sessions.'\n desc 'A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined.\n\n Regardless of where the session lock is determined and implemented, once\ninvoked, the session lock must remain in place until the user reauthenticates.\nNo other activity aside from reauthentication must unlock the system.'\n desc 'check', %q(Verify the operating system enables a user's session lock until that user\nre-establishes access using established identification and authentication\nprocedures with the following command:\n\n $ sudo gsettings get org.gnome.desktop.screensaver lock-enabled\n\n true\n\n If the setting is \"false\", this is a finding.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.)\n desc 'fix', %q(Configure the operating system to enable a user's session lock until that\nuser re-establishes access using established identification and authentication\nprocedures.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following example:\n\n $ sudo vi /etc/dconf/db/local.d/00-screensaver\n\n Edit the \"[org/gnome/desktop/screensaver]\" section of the database file\nand add or update the following lines:\n\n # Set this to true to lock the screen when the screensaver activates\n lock-enabled=true\n\n Update the system databases:\n\n $ sudo dconf update)\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag gid: 'V-230347'\n tag rid: 'SV-258021r627750_rule'\n tag stig_id: 'RHEL-08-020030'\n tag fix_id: 'F-32991r567788_fix'\n tag cci: ['CCI-000056']\n tag nist: ['AC-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if package('gnome-desktop3').installed?\n describe command('gsettings get org.gnome.desktop.screensaver lock-enabled') do\n its('stdout.strip') { should cmp 'true' }\n end\n else\n impact 0.0\n describe 'The system does not have GNOME installed' do\n skip \"The system does not have GNOME installed, this requirement is Not\n Applicable.\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258021.rb" + }, + "title": "RHEL 8 must enable a user session lock until that user re-establishes\naccess using established identification and authentication procedures for\ngraphical user sessions.", + "desc": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined.\n\n Regardless of where the session lock is determined and implemented, once\ninvoked, the session lock must remain in place until the user reauthenticates.\nNo other activity aside from reauthentication must unlock the system.", + "descriptions": { + "default": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined.\n\n Regardless of where the session lock is determined and implemented, once\ninvoked, the session lock must remain in place until the user reauthenticates.\nNo other activity aside from reauthentication must unlock the system.", + "check": "Verify the operating system enables a user's session lock until that user\nre-establishes access using established identification and authentication\nprocedures with the following command:\n\n $ sudo gsettings get org.gnome.desktop.screensaver lock-enabled\n\n true\n\n If the setting is \"false\", this is a finding.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.", + "fix": "Configure the operating system to enable a user's session lock until that\nuser re-establishes access using established identification and authentication\nprocedures.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following example:\n\n $ sudo vi /etc/dconf/db/local.d/00-screensaver\n\n Edit the \"[org/gnome/desktop/screensaver]\" section of the database file\nand add or update the following lines:\n\n # Set this to true to lock the screen when the screensaver activates\n lock-enabled=true\n\n Update the system databases:\n\n $ sudo dconf update" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000028-GPOS-00009", + "satisfies": [ + "SRG-OS-000028-GPOS-00009", + "SRG-OS-000030-GPOS-00011" + ], + "gid": "V-230347", + "rid": "SV-258021r627750_rule", + "stig_id": "RHEL-08-020030", + "fix_id": "F-32991r567788_fix", + "cci": [ + "CCI-000056" + ], + "nist": [ + "AC-11 b" + ], + "host": null + } + }, + { + "id": "SV-258022", + "code": "control 'SV-258022' do\n title 'RHEL 8 must prevent a user from overriding the screensaver\nlock-enabled setting for the graphical user interface.'\n desc \"A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.\"\n desc 'check', 'Verify the operating system prevents a user from overriding settings for\ngraphical user interfaces.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Determine which profile the system database is using with the following\ncommand:\n\n $ sudo grep system-db /etc/dconf/profile/user\n\n system-db:local\n\n Check that graphical settings are locked from non-privileged user\nmodification with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nthe path is \"/etc/dconf/db/local.d\". This path must be modified if a database\nother than \"local\" is being used.\n\n $ sudo grep -i lock-enabled /etc/dconf/db/local.d/locks/*\n\n /org/gnome/desktop/screensaver/lock-enabled\n\n If the command does not return at least the example result, this is a\nfinding.'\n desc 'fix', 'Configure the operating system to prevent a user from overriding settings\nfor graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/locks/session\n\n Add the following setting to prevent non-privileged users from modifying it:\n\n /org/gnome/desktop/screensaver/lock-enabled'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000029-GPOS-00010'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227']\n tag gid: 'V-244539'\n tag rid: 'SV-258022r743866_rule'\n tag stig_id: 'RHEL-08-020082'\n tag fix_id: 'F-47771r743865_fix'\n tag cci: ['CCI-000057']\n tag nist: ['AC-11 a']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if !package('gnome-desktop3').installed?\n impact 0.0\n describe 'The GNOME desktop is not installed, this control is Not Applicable.' do\n skip 'The GNOME desktop is not installed, this control is Not Applicable.'\n end\n else\n describe command('grep -i lock-enabled /etc/dconf/db/local.d/locks/*') do\n its('stdout.split') { should include '/org/gnome/desktop/screensaver/lock-enabled' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258022.rb" + }, + "title": "RHEL 8 must prevent a user from overriding the screensaver\nlock-enabled setting for the graphical user interface.", + "desc": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.", + "descriptions": { + "default": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.", + "check": "Verify the operating system prevents a user from overriding settings for\ngraphical user interfaces.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Determine which profile the system database is using with the following\ncommand:\n\n $ sudo grep system-db /etc/dconf/profile/user\n\n system-db:local\n\n Check that graphical settings are locked from non-privileged user\nmodification with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nthe path is \"/etc/dconf/db/local.d\". This path must be modified if a database\nother than \"local\" is being used.\n\n $ sudo grep -i lock-enabled /etc/dconf/db/local.d/locks/*\n\n /org/gnome/desktop/screensaver/lock-enabled\n\n If the command does not return at least the example result, this is a\nfinding.", + "fix": "Configure the operating system to prevent a user from overriding settings\nfor graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/locks/session\n\n Add the following setting to prevent non-privileged users from modifying it:\n\n /org/gnome/desktop/screensaver/lock-enabled" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000029-GPOS-00010", + "satisfies": [ + "SRG-OS-000029-GPOS-00010", + "SRG-OS-000031-GPOS-00012", + "SRG-OS-000480-GPOS-00227" + ], + "gid": "V-244539", + "rid": "SV-258022r743866_rule", + "stig_id": "RHEL-08-020082", + "fix_id": "F-47771r743865_fix", + "cci": [ + "CCI-000057" + ], + "nist": [ + "AC-11 a" + ], + "host": null + } + }, + { + "id": "SV-258023", + "code": "control 'SV-258023' do\n title 'RHEL 8 must automatically lock graphical user sessions after 15\nminutes of inactivity.'\n desc 'A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.'\n desc 'check', 'Verify the operating system initiates a session lock after a 15-minute\nperiod of inactivity for graphical user interfaces with the following commands:\n\n This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n $ sudo gsettings get org.gnome.desktop.session idle-delay\n\n uint32 900\n\n If \"idle-delay\" is set to \"0\" or a value greater than \"900\", this is\na finding.'\n desc 'fix', 'Configure the operating system to initiate a screensaver after a 15-minute\nperiod of inactivity for graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n $ sudo touch /etc/dconf/db/local.d/00-screensaver\n\n Edit /etc/dconf/db/local.d/00-screensaver and add or update the following\nlines:\n\n [org/gnome/desktop/session]\n # Set the lock time out to 900 seconds before the session is considered idle\n idle-delay=uint32 900\n\n Update the system databases:\n\n $ sudo dconf update'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000029-GPOS-00010'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012']\n tag gid: 'V-230352'\n tag rid: 'SV-258023r646876_rule'\n tag stig_id: 'RHEL-08-020060'\n tag fix_id: 'F-32996r567803_fix'\n tag cci: ['CCI-000057']\n tag nist: ['AC-11 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if package('gnome-desktop3').installed?\n describe command(\"gsettings get org.gnome.desktop.session idle-delay | cut -d ' ' -f2\") do\n its('stdout.strip') { should cmp <= input('system_inactivity_timeout') }\n end\n else\n impact 0.0\n describe 'The system does not have GNOME installed' do\n skip \"The system does not have GNOME installed, this requirement is Not\n Applicable.\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258023.rb" + }, + "title": "RHEL 8 must automatically lock graphical user sessions after 15\nminutes of inactivity.", + "desc": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.", + "descriptions": { + "default": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.", + "check": "Verify the operating system initiates a session lock after a 15-minute\nperiod of inactivity for graphical user interfaces with the following commands:\n\n This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n $ sudo gsettings get org.gnome.desktop.session idle-delay\n\n uint32 900\n\n If \"idle-delay\" is set to \"0\" or a value greater than \"900\", this is\na finding.", + "fix": "Configure the operating system to initiate a screensaver after a 15-minute\nperiod of inactivity for graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n $ sudo touch /etc/dconf/db/local.d/00-screensaver\n\n Edit /etc/dconf/db/local.d/00-screensaver and add or update the following\nlines:\n\n [org/gnome/desktop/session]\n # Set the lock time out to 900 seconds before the session is considered idle\n idle-delay=uint32 900\n\n Update the system databases:\n\n $ sudo dconf update" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000029-GPOS-00010", + "satisfies": [ + "SRG-OS-000029-GPOS-00010", + "SRG-OS-000031-GPOS-00012" + ], + "gid": "V-230352", + "rid": "SV-258023r646876_rule", + "stig_id": "RHEL-08-020060", + "fix_id": "F-32996r567803_fix", + "cci": [ + "CCI-000057" + ], + "nist": [ + "AC-11 a" + ], + "host": null + } + }, + { + "id": "SV-258024", + "code": "control 'SV-258024' do\n title 'RHEL 8 must prevent a user from overriding the session idle-delay\nsetting for the graphical user interface.'\n desc \"A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.\"\n desc 'check', 'Verify the operating system prevents a user from overriding settings for\ngraphical user interfaces.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Determine which profile the system database is using with the following\ncommand:\n\n $ sudo grep system-db /etc/dconf/profile/user\n\n system-db:local\n\n Check that graphical settings are locked from non-privileged user\nmodification with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nthe path is \"/etc/dconf/db/local.d\". This path must be modified if a database\nother than \"local\" is being used.\n\n $ sudo grep -i idle /etc/dconf/db/local.d/locks/*\n\n /org/gnome/desktop/session/idle-delay\n\n If the command does not return at least the example result, this is a\nfinding.'\n desc 'fix', 'Configure the operating system to prevent a user from overriding settings\nfor graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/locks/session\n\n Add the following setting to prevent non-privileged users from modifying it:\n\n /org/gnome/desktop/session/idle-delay'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000029-GPOS-00010'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227']\n tag gid: 'V-244538'\n tag rid: 'SV-258024r743863_rule'\n tag stig_id: 'RHEL-08-020081'\n tag fix_id: 'F-47770r743862_fix'\n tag cci: ['CCI-000057']\n tag nist: ['AC-11 a']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/)\n\n if no_gui\n impact 0.0\n describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do\n skip 'A GUI desktop is not installed, this control is Not Applicable.'\n end\n else\n describe command('grep -i idle /etc/dconf/db/local.d/locks/*') do\n it 'checks if idle delay is set' do\n expect(subject.stdout.split).to include('/org/gnome/desktop/session/idle-delay'), 'The idle delay is not set. Please ensure it is set.'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258024.rb" + }, + "title": "RHEL 8 must prevent a user from overriding the session idle-delay\nsetting for the graphical user interface.", + "desc": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.", + "descriptions": { + "default": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.", + "check": "Verify the operating system prevents a user from overriding settings for\ngraphical user interfaces.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Determine which profile the system database is using with the following\ncommand:\n\n $ sudo grep system-db /etc/dconf/profile/user\n\n system-db:local\n\n Check that graphical settings are locked from non-privileged user\nmodification with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nthe path is \"/etc/dconf/db/local.d\". This path must be modified if a database\nother than \"local\" is being used.\n\n $ sudo grep -i idle /etc/dconf/db/local.d/locks/*\n\n /org/gnome/desktop/session/idle-delay\n\n If the command does not return at least the example result, this is a\nfinding.", + "fix": "Configure the operating system to prevent a user from overriding settings\nfor graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/locks/session\n\n Add the following setting to prevent non-privileged users from modifying it:\n\n /org/gnome/desktop/session/idle-delay" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000029-GPOS-00010", + "satisfies": [ + "SRG-OS-000029-GPOS-00010", + "SRG-OS-000031-GPOS-00012", + "SRG-OS-000480-GPOS-00227" + ], + "gid": "V-244538", + "rid": "SV-258024r743863_rule", + "stig_id": "RHEL-08-020081", + "fix_id": "F-47770r743862_fix", + "cci": [ + "CCI-000057" + ], + "nist": [ + "AC-11 a" + ], + "host": null + } + }, + { + "id": "SV-258025", + "code": "control 'SV-258025' do\n title 'RHEL 8 must initiate a session lock for graphical user interfaces when\nthe screensaver is activated.'\n desc \"A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\"\n desc 'check', 'Verify the operating system initiates a session lock a for graphical user\ninterfaces when the screensaver is activated with the following command:\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n $ sudo gsettings get org.gnome.desktop.screensaver lock-delay\n\n uint32 5\n\n If the \"uint32\" setting is missing, or is not set to \"5\" or less, this\nis a finding.'\n desc 'fix', 'Configure the operating system to initiate a session lock for graphical\nuser interfaces when a screensaver is activated.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/00-screensaver\n\n [org/gnome/desktop/screensaver]\n lock-delay=uint32 5\n\n The \"uint32\" must be included along with the integer key values as shown.\n\n Update the system databases:\n\n $ sudo dconf update'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000029-GPOS-00010'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227']\n tag gid: 'V-244535'\n tag rid: 'SV-258025r743854_rule'\n tag stig_id: 'RHEL-08-020031'\n tag fix_id: 'F-47767r743853_fix'\n tag cci: ['CCI-000057']\n tag nist: ['AC-11 a']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/)\n\n if no_gui\n impact 0.0\n describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do\n skip 'A GUI desktop is not installed, this control is Not Applicable.'\n end\n else\n describe command('gsettings get org.gnome.desktop.screensaver lock-delay') do\n its('stdout.strip') { should match(/uint32\\s[0-5]/) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258025.rb" + }, + "title": "RHEL 8 must initiate a session lock for graphical user interfaces when\nthe screensaver is activated.", + "desc": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.", + "descriptions": { + "default": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.", + "check": "Verify the operating system initiates a session lock a for graphical user\ninterfaces when the screensaver is activated with the following command:\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n $ sudo gsettings get org.gnome.desktop.screensaver lock-delay\n\n uint32 5\n\n If the \"uint32\" setting is missing, or is not set to \"5\" or less, this\nis a finding.", + "fix": "Configure the operating system to initiate a session lock for graphical\nuser interfaces when a screensaver is activated.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/00-screensaver\n\n [org/gnome/desktop/screensaver]\n lock-delay=uint32 5\n\n The \"uint32\" must be included along with the integer key values as shown.\n\n Update the system databases:\n\n $ sudo dconf update" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000029-GPOS-00010", + "satisfies": [ + "SRG-OS-000029-GPOS-00010", + "SRG-OS-000031-GPOS-00012", + "SRG-OS-000480-GPOS-00227" + ], + "gid": "V-244535", + "rid": "SV-258025r743854_rule", + "stig_id": "RHEL-08-020031", + "fix_id": "F-47767r743853_fix", + "cci": [ + "CCI-000057" + ], + "nist": [ + "AC-11 a" + ], + "host": null + } + }, + { + "id": "SV-258026", + "code": "control 'SV-258026' do\n title 'RHEL 8 must prevent a user from overriding the session lock-delay\nsetting for the graphical user interface.'\n desc \"A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.\"\n desc 'check', 'Verify the operating system prevents a user from overriding settings for\ngraphical user interfaces.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Determine which profile the system database is using with the following\ncommand:\n\n $ sudo grep system-db /etc/dconf/profile/user\n\n system-db:local\n\n Check that graphical settings are locked from non-privileged user\nmodification with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nthe path is \"/etc/dconf/db/local.d\". This path must be modified if a database\nother than \"local\" is being used.\n\n $ sudo grep -i lock-delay /etc/dconf/db/local.d/locks/*\n\n /org/gnome/desktop/screensaver/lock-delay\n\n If the command does not return at least the example result, this is a\nfinding.'\n desc 'fix', 'Configure the operating system to prevent a user from overriding settings\nfor graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/locks/session\n\n Add the following setting to prevent non-privileged users from modifying it:\n\n /org/gnome/desktop/screensaver/lock-delay'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000029-GPOS-00010'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012', 'SRG-OS-000480-GPOS-00227']\n tag gid: 'V-230354'\n tag rid: 'SV-258026r743990_rule'\n tag stig_id: 'RHEL-08-020080'\n tag fix_id: 'F-32998r743989_fix'\n tag cci: ['CCI-000057']\n tag nist: ['AC-11 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if package('gnome-desktop3').installed?\n describe command('grep -i lock-delay /etc/dconf/db/local.d/locks/*') do\n its('stdout.split') { should include '/org/gnome/desktop/screensaver/lock-delay' }\n end\n else\n impact 0.0\n describe 'The GNOME desktop is not installed' do\n skip 'The GNOME desktop is not installed, this control is Not Applicable.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258026.rb" + }, + "title": "RHEL 8 must prevent a user from overriding the session lock-delay\nsetting for the graphical user interface.", + "desc": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.", + "descriptions": { + "default": "A session time-out lock is a temporary action taken when a user stops\nwork and moves away from the immediate physical vicinity of the information\nsystem but does not log out because of the temporary nature of the absence.\nRather than relying on the user to manually lock their operating system session\nprior to vacating the vicinity, operating systems need to be able to identify\nwhen a user's session has idled and take action to initiate the session lock.\n\n The session lock is implemented at the point where session activity can be\ndetermined and/or controlled.\n\n Implementing session settings will have little value if a user is able to\nmanipulate these settings from the defaults prescribed in the other\nrequirements of this implementation guide.\n\n Locking these settings from non-privileged users is crucial to maintaining\na protected baseline.", + "check": "Verify the operating system prevents a user from overriding settings for\ngraphical user interfaces.\n\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n Determine which profile the system database is using with the following\ncommand:\n\n $ sudo grep system-db /etc/dconf/profile/user\n\n system-db:local\n\n Check that graphical settings are locked from non-privileged user\nmodification with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nthe path is \"/etc/dconf/db/local.d\". This path must be modified if a database\nother than \"local\" is being used.\n\n $ sudo grep -i lock-delay /etc/dconf/db/local.d/locks/*\n\n /org/gnome/desktop/screensaver/lock-delay\n\n If the command does not return at least the example result, this is a\nfinding.", + "fix": "Configure the operating system to prevent a user from overriding settings\nfor graphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/locks/session\n\n Add the following setting to prevent non-privileged users from modifying it:\n\n /org/gnome/desktop/screensaver/lock-delay" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000029-GPOS-00010", + "satisfies": [ + "SRG-OS-000029-GPOS-00010", + "SRG-OS-000031-GPOS-00012", + "SRG-OS-000480-GPOS-00227" + ], + "gid": "V-230354", + "rid": "SV-258026r743990_rule", + "stig_id": "RHEL-08-020080", + "fix_id": "F-32998r743989_fix", + "cci": [ + "CCI-000057" + ], + "nist": [ + "AC-11 a" + ], + "host": null + } + }, + { + "id": "SV-258027", + "code": "control 'SV-258027' do\n title 'RHEL 9 must conceal, via the session lock, information previously visible on the display with a publicly viewable image.'\n desc 'Setting the screensaver mode to blank-only conceals the contents of the display from passersby.'\n desc 'check', %q(To ensure the screensaver is configured to be blank, run the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.desktop.screensaver picture-uri \n\nIf properly configured, the output should be \"''\".\n\nTo ensure that users cannot set the screensaver background, run the following: \n\n$ grep picture-uri /etc/dconf/db/local.d/locks/* \n\nIf properly configured, the output should be \"/org/gnome/desktop/screensaver/picture-uri\".\n\nIf it is not set or configured properly, this is a finding.)\n desc 'fix', %q(The dconf settings can be edited in the /etc/dconf/db/* location.\n\nFirst, add or update the [org/gnome/desktop/screensaver] section of the \"/etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/desktop/screensaver]\npicture-uri=''\n\nThen, add the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user modification:\n\n/org/gnome/desktop/screensaver/picture-uri\n\nFinally, update the dconf system databases:\n\n$ sudo dconf update)\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61768r926066_chk'\n tag severity: 'medium'\n tag gid: 'V-258027'\n tag rid: 'SV-258027r926068_rule'\n tag stig_id: 'RHEL-09-271085'\n tag gtitle: 'SRG-OS-000031-GPOS-00012'\n tag fix_id: 'F-61692r926067_fix'\n tag 'documentable'\n tag cci: ['CCI-000060']\n tag nist: ['AC-11 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258027.rb" + }, + "title": "RHEL 9 must conceal, via the session lock, information previously visible on the display with a publicly viewable image.", + "desc": "Setting the screensaver mode to blank-only conceals the contents of the display from passersby.", + "descriptions": { + "default": "Setting the screensaver mode to blank-only conceals the contents of the display from passersby.", + "check": "To ensure the screensaver is configured to be blank, run the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.desktop.screensaver picture-uri \n\nIf properly configured, the output should be \"''\".\n\nTo ensure that users cannot set the screensaver background, run the following: \n\n$ grep picture-uri /etc/dconf/db/local.d/locks/* \n\nIf properly configured, the output should be \"/org/gnome/desktop/screensaver/picture-uri\".\n\nIf it is not set or configured properly, this is a finding.", + "fix": "The dconf settings can be edited in the /etc/dconf/db/* location.\n\nFirst, add or update the [org/gnome/desktop/screensaver] section of the \"/etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/desktop/screensaver]\npicture-uri=''\n\nThen, add the following line to \"/etc/dconf/db/local.d/locks/00-security-settings-lock\" to prevent user modification:\n\n/org/gnome/desktop/screensaver/picture-uri\n\nFinally, update the dconf system databases:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61768r926066_chk", + "severity": "medium", + "gid": "V-258027", + "rid": "SV-258027r926068_rule", + "stig_id": "RHEL-09-271085", + "gtitle": "SRG-OS-000031-GPOS-00012", + "fix_id": "F-61692r926067_fix", + "documentable": null, + "cci": [ + "CCI-000060" + ], + "nist": [ + "AC-11 (1)" + ] + } + }, + { + "id": "SV-258028", + "code": "control 'SV-258028' do\n title 'RHEL 9 effective dconf policy must match the policy keyfiles.'\n desc 'Unlike text-based keyfiles, the binary database is impossible to check through most automated and all manual means; therefore, in order to evaluate dconf configuration, both have to be true at the same time - configuration files have to be compliant, and the database needs to be more recent than those keyfiles, which gives confidence that it reflects them.'\n desc 'check', 'Check the last modification time of the local databases, comparing it to the last modification time of the related keyfiles. The following command will check every dconf database and compare its modification time to the related system keyfiles:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ function dconf_needs_update { for db in $(find /etc/dconf/db -maxdepth 1 -type f); do db_mtime=$(stat -c %Y \"$db\"); keyfile_mtime=$(stat -c %Y \"$db\".d/* | sort -n | tail -1); if [ -n \"$db_mtime\" ] && [ -n \"$keyfile_mtime\" ] && [ \"$db_mtime\" -lt \"$keyfile_mtime\" ]; then echo \"$db needs update\"; return 1; fi; done; }; dconf_needs_update\n\nIf the command has any output, then a dconf database needs to be updated, and this is a finding.'\n desc 'fix', 'Update the dconf databases by running the following command:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61769r926069_chk'\n tag severity: 'medium'\n tag gid: 'V-258028'\n tag rid: 'SV-258028r926071_rule'\n tag stig_id: 'RHEL-09-271090'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61693r926070_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258028.rb" + }, + "title": "RHEL 9 effective dconf policy must match the policy keyfiles.", + "desc": "Unlike text-based keyfiles, the binary database is impossible to check through most automated and all manual means; therefore, in order to evaluate dconf configuration, both have to be true at the same time - configuration files have to be compliant, and the database needs to be more recent than those keyfiles, which gives confidence that it reflects them.", + "descriptions": { + "default": "Unlike text-based keyfiles, the binary database is impossible to check through most automated and all manual means; therefore, in order to evaluate dconf configuration, both have to be true at the same time - configuration files have to be compliant, and the database needs to be more recent than those keyfiles, which gives confidence that it reflects them.", + "check": "Check the last modification time of the local databases, comparing it to the last modification time of the related keyfiles. The following command will check every dconf database and compare its modification time to the related system keyfiles:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ function dconf_needs_update { for db in $(find /etc/dconf/db -maxdepth 1 -type f); do db_mtime=$(stat -c %Y \"$db\"); keyfile_mtime=$(stat -c %Y \"$db\".d/* | sort -n | tail -1); if [ -n \"$db_mtime\" ] && [ -n \"$keyfile_mtime\" ] && [ \"$db_mtime\" -lt \"$keyfile_mtime\" ]; then echo \"$db needs update\"; return 1; fi; done; }; dconf_needs_update\n\nIf the command has any output, then a dconf database needs to be updated, and this is a finding.", + "fix": "Update the dconf databases by running the following command:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61769r926069_chk", + "severity": "medium", + "gid": "V-258028", + "rid": "SV-258028r926071_rule", + "stig_id": "RHEL-09-271090", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61693r926070_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258029", + "code": "control 'SV-258029' do\n title 'RHEL 9 must disable the ability of a user to restart the system from the login screen.'\n desc 'A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.'\n desc 'check', %q(Verify RHEL 9 disables a user's ability to restart the system with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, Gnome Shell. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ grep -R disable-restart-buttons /etc/dconf/db/*\n\n/etc/dconf/db/distro.d/20-authselect:disable-restart-buttons='true'\n\nIf the \"disable-restart-button\" setting is not set to \"true\", is missing or commented out from the dconf database files, this is a finding.)\n desc 'fix', %q(Configure RHEL 9 to disable a user's ability to restart the system.\n\nAdd or update the [org/gnome/settings-daemon/] section of the /etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/settings-daemon/peripherals/smartcard]\ndisable-restart-buttons='true'\n\nThen update the dconf system databases:\n\n$ sudo dconf update)\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61770r926072_chk'\n tag severity: 'medium'\n tag gid: 'V-258029'\n tag rid: 'SV-258029r926074_rule'\n tag stig_id: 'RHEL-09-271095'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61694r926073_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258029.rb" + }, + "title": "RHEL 9 must disable the ability of a user to restart the system from the login screen.", + "desc": "A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.", + "descriptions": { + "default": "A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.", + "check": "Verify RHEL 9 disables a user's ability to restart the system with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, Gnome Shell. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ grep -R disable-restart-buttons /etc/dconf/db/*\n\n/etc/dconf/db/distro.d/20-authselect:disable-restart-buttons='true'\n\nIf the \"disable-restart-button\" setting is not set to \"true\", is missing or commented out from the dconf database files, this is a finding.", + "fix": "Configure RHEL 9 to disable a user's ability to restart the system.\n\nAdd or update the [org/gnome/settings-daemon/] section of the /etc/dconf/db/local.d/00-security-settings\" database file and add or update the following lines:\n\n[org/gnome/settings-daemon/peripherals/smartcard]\ndisable-restart-buttons='true'\n\nThen update the dconf system databases:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61770r926072_chk", + "severity": "medium", + "gid": "V-258029", + "rid": "SV-258029r926074_rule", + "stig_id": "RHEL-09-271095", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61694r926073_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258030", + "code": "control 'SV-258030' do\n title 'RHEL 9 must prevent a user from overriding the disable-restart-buttons setting for the graphical user interface.'\n desc 'A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.'\n desc 'check', 'Verify RHEL 9 prevents a user from overriding the disable-restart-buttons setting for graphical user interfaces. \n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that graphical settings are locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep disable-restart-buttons /etc/dconf/db/local.d/locks/* \n\n/org/gnome/login-screen/disable-restart-buttons\n\nIf the command does not return at least the example result, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to prevent a user from overriding the disable-restart-buttons setting for graphical user interfaces. \n\nCreate a database to contain the system-wide graphical user logon settings (if it does not already exist) with the following command:\n\n$ sudo touch /etc/dconf/db/local.d/locks/session\n\nAdd the following line to prevent nonprivileged users from modifying it:\n\n/org/gnome/login-screen/disable-restart-buttons\n\nRun the following command to update the database:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61771r926075_chk'\n tag severity: 'medium'\n tag gid: 'V-258030'\n tag rid: 'SV-258030r926077_rule'\n tag stig_id: 'RHEL-09-271100'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61695r926076_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258030.rb" + }, + "title": "RHEL 9 must prevent a user from overriding the disable-restart-buttons setting for the graphical user interface.", + "desc": "A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.", + "descriptions": { + "default": "A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.", + "check": "Verify RHEL 9 prevents a user from overriding the disable-restart-buttons setting for graphical user interfaces. \n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\nDetermine which profile the system database is using with the following command:\n\n$ sudo grep system-db /etc/dconf/profile/user\n\nsystem-db:local\n\nCheck that graphical settings are locked from nonprivileged user modification with the following command:\n\nNote: The example below is using the database \"local\" for the system, so the path is \"/etc/dconf/db/local.d\". This path must be modified if a database other than \"local\" is being used.\n\n$ grep disable-restart-buttons /etc/dconf/db/local.d/locks/* \n\n/org/gnome/login-screen/disable-restart-buttons\n\nIf the command does not return at least the example result, this is a finding.", + "fix": "Configure RHEL 9 to prevent a user from overriding the disable-restart-buttons setting for graphical user interfaces. \n\nCreate a database to contain the system-wide graphical user logon settings (if it does not already exist) with the following command:\n\n$ sudo touch /etc/dconf/db/local.d/locks/session\n\nAdd the following line to prevent nonprivileged users from modifying it:\n\n/org/gnome/login-screen/disable-restart-buttons\n\nRun the following command to update the database:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61771r926075_chk", + "severity": "medium", + "gid": "V-258030", + "rid": "SV-258030r926077_rule", + "stig_id": "RHEL-09-271100", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61695r926076_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258031", + "code": "control 'SV-258031' do\n title 'RHEL 9 must disable the ability of a user to accidentally press Ctrl-Alt-Del and cause a system to shut down or reboot.'\n desc 'A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.'\n desc 'check', %q(Verify RHEL 9 is configured to ignore the Ctrl-Alt-Del sequence in the GNOME desktop with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.settings-daemon.plugins.media-keys logout \n\n\"['']\"\n\nIf the GNOME desktop is configured to shut down when Ctrl-Alt-Del is pressed, this is a finding.)\n desc 'fix', \"Configure RHEL 9 to ignore the Ctrl-Alt-Del sequence in the GNOME desktop.\n\nAdd or update the [org/gnome/settings-daemon/plugins/media-keys] section of the /etc/dconf/db/local.d/00-security-settings database file and add or update the following lines:\n\n[org/gnome/settings-daemon/plugins/media-keys]\nlogout=['']\n\nRun the following command to update the database:\n\n$ sudo dconf update\"\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61772r926078_chk'\n tag severity: 'medium'\n tag gid: 'V-258031'\n tag rid: 'SV-258031r926080_rule'\n tag stig_id: 'RHEL-09-271105'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61696r926079_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258031.rb" + }, + "title": "RHEL 9 must disable the ability of a user to accidentally press Ctrl-Alt-Del and cause a system to shut down or reboot.", + "desc": "A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.", + "descriptions": { + "default": "A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.", + "check": "Verify RHEL 9 is configured to ignore the Ctrl-Alt-Del sequence in the GNOME desktop with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ gsettings get org.gnome.settings-daemon.plugins.media-keys logout \n\n\"['']\"\n\nIf the GNOME desktop is configured to shut down when Ctrl-Alt-Del is pressed, this is a finding.", + "fix": "Configure RHEL 9 to ignore the Ctrl-Alt-Del sequence in the GNOME desktop.\n\nAdd or update the [org/gnome/settings-daemon/plugins/media-keys] section of the /etc/dconf/db/local.d/00-security-settings database file and add or update the following lines:\n\n[org/gnome/settings-daemon/plugins/media-keys]\nlogout=['']\n\nRun the following command to update the database:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61772r926078_chk", + "severity": "medium", + "gid": "V-258031", + "rid": "SV-258031r926080_rule", + "stig_id": "RHEL-09-271105", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61696r926079_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258032", + "code": "control 'SV-258032' do\n title 'RHEL 9 must prevent a user from overriding the Ctrl-Alt-Del sequence settings for the graphical user interface.'\n desc 'A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.'\n desc 'check', 'Verify that users cannot enable the Ctrl-Alt-Del sequence in the GNOME desktop with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ grep logout /etc/dconf/db/local.d/locks/* \n\n/org/gnome/settings-daemon/plugins/media-keys/logout\n\nIf the output is not \"/org/gnome/settings-daemon/plugins/media-keys/logout\", the line is commented out, or the line is missing, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to disallow the user changing the Ctrl-Alt-Del sequence in the GNOME desktop.\n\nCreate a database to container system-wide graphical user logon settings (if it does not already exist) with the following command:\n\n$ sudo touch /etc/dconf/db/local.d/locks/session\n\nAdd the following line to the session locks file to prevent nonprivileged users from modifying the Ctrl-Alt-Del setting:\n\n/org/gnome/settings-daemon/plugins/media-keys/logout\n\nRun the following command to update the database:\n\n$ sudo dconf update'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61773r926081_chk'\n tag severity: 'medium'\n tag gid: 'V-258032'\n tag rid: 'SV-258032r926083_rule'\n tag stig_id: 'RHEL-09-271110'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61697r926082_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258032.rb" + }, + "title": "RHEL 9 must prevent a user from overriding the Ctrl-Alt-Del sequence settings for the graphical user interface.", + "desc": "A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.", + "descriptions": { + "default": "A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.", + "check": "Verify that users cannot enable the Ctrl-Alt-Del sequence in the GNOME desktop with the following command:\n\nNote: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable.\n\n$ grep logout /etc/dconf/db/local.d/locks/* \n\n/org/gnome/settings-daemon/plugins/media-keys/logout\n\nIf the output is not \"/org/gnome/settings-daemon/plugins/media-keys/logout\", the line is commented out, or the line is missing, this is a finding.", + "fix": "Configure RHEL 9 to disallow the user changing the Ctrl-Alt-Del sequence in the GNOME desktop.\n\nCreate a database to container system-wide graphical user logon settings (if it does not already exist) with the following command:\n\n$ sudo touch /etc/dconf/db/local.d/locks/session\n\nAdd the following line to the session locks file to prevent nonprivileged users from modifying the Ctrl-Alt-Del setting:\n\n/org/gnome/settings-daemon/plugins/media-keys/logout\n\nRun the following command to update the database:\n\n$ sudo dconf update" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61773r926081_chk", + "severity": "medium", + "gid": "V-258032", + "rid": "SV-258032r926083_rule", + "stig_id": "RHEL-09-271110", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61697r926082_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258033", + "code": "control 'SV-258033' do\n title 'RHEL 8 must disable the user list at logon for graphical user\ninterfaces.'\n desc 'Leaving the user list enabled is a security risk since it allows\nanyone with physical access to the system to enumerate known user accounts\nwithout authenticated access to the system.'\n desc 'check', 'Verify the operating system disables the user logon list for graphical user\ninterfaces with the following command:\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n $ sudo gsettings get org.gnome.login-screen disable-user-list\n true\n\n If the setting is \"false\", this is a finding.'\n desc 'fix', 'Configure the operating system to disable the user list at logon for\ngraphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/02-login-screen\n\n [org/gnome/login-screen]\n disable-user-list=true\n\n Update the system databases:\n $ sudo dconf update'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-244536'\n tag rid: 'SV-258033r743857_rule'\n tag stig_id: 'RHEL-08-020032'\n tag fix_id: 'F-47768r743856_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/)\n\n if no_gui\n impact 0.0\n describe 'The system does not have a GUI installed, this requirement is Not Applicable.' do\n skip 'A GUI desktop is not installed, this control is Not Applicable.'\n end\n else\n describe command('gsettings get org.gnome.login-screen disable-user-list') do\n its('stdout.strip') { should cmp 'true' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258033.rb" + }, + "title": "RHEL 8 must disable the user list at logon for graphical user\ninterfaces.", + "desc": "Leaving the user list enabled is a security risk since it allows\nanyone with physical access to the system to enumerate known user accounts\nwithout authenticated access to the system.", + "descriptions": { + "default": "Leaving the user list enabled is a security risk since it allows\nanyone with physical access to the system to enumerate known user accounts\nwithout authenticated access to the system.", + "check": "Verify the operating system disables the user logon list for graphical user\ninterfaces with the following command:\n Note: This requirement assumes the use of the RHEL 8 default graphical user\ninterface, Gnome Shell. If the system does not have any graphical user\ninterface installed, this requirement is Not Applicable.\n\n $ sudo gsettings get org.gnome.login-screen disable-user-list\n true\n\n If the setting is \"false\", this is a finding.", + "fix": "Configure the operating system to disable the user list at logon for\ngraphical user interfaces.\n\n Create a database to contain the system-wide screensaver settings (if it\ndoes not already exist) with the following command:\n Note: The example below is using the database \"local\" for the system, so\nif the system is using another database in \"/etc/dconf/profile/user\", the\nfile should be created under the appropriate subdirectory.\n\n $ sudo touch /etc/dconf/db/local.d/02-login-screen\n\n [org/gnome/login-screen]\n disable-user-list=true\n\n Update the system databases:\n $ sudo dconf update" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-244536", + "rid": "SV-258033r743857_rule", + "stig_id": "RHEL-08-020032", + "fix_id": "F-47768r743856_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258034", + "code": "control 'SV-258034' do\n title 'RHEL 8 must be configured to disable USB mass storage.'\n desc 'USB mass storage permits easy introduction of unknown devices, thereby\nfacilitating malicious activity.'\n desc 'check', 'Verify the operating system disables the ability to load the USB Storage kernel module.\n\n $ sudo grep -r usb-storage /etc/modprobe.d/* | grep -i \"/bin/false\"\n install usb-storage /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of USB Storage is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use USB mass storage devices.\n\nCheck to see if USB mass storage is disabled with the following command:\n\n $ sudo grep usb-storage /etc/modprobe.d/* | grep -i \"blacklist\"\n blacklist usb-storage\n\nIf the command does not return any output or the output is not \"blacklist usb-storage\" and use of USB storage devices is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the ability to use the USB Storage kernel module and the ability to use USB mass storage devices.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install usb-storage /bin/false\n blacklist usb-storage\n\nReboot the system for the settings to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000114-GPOS-00059'\n tag satisfies: ['SRG-OS-000114-GPOS-00059', 'SRG-OS-000378-GPOS-00163']\n tag gid: 'V-230503'\n tag rid: 'SV-258034r942936_rule'\n tag stig_id: 'RHEL-08-040080'\n tag fix_id: 'F-33147r942935_fix'\n tag cci: ['CCI-000778']\n tag nist: ['IA-3']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n if input('usb_storage_required') == true\n describe kernel_module('usb_storage') do\n it { should_not be_disabled }\n it { should_not be_blacklisted }\n end\n else\n describe kernel_module('usb_storage') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258034.rb" + }, + "title": "RHEL 8 must be configured to disable USB mass storage.", + "desc": "USB mass storage permits easy introduction of unknown devices, thereby\nfacilitating malicious activity.", + "descriptions": { + "default": "USB mass storage permits easy introduction of unknown devices, thereby\nfacilitating malicious activity.", + "check": "Verify the operating system disables the ability to load the USB Storage kernel module.\n\n $ sudo grep -r usb-storage /etc/modprobe.d/* | grep -i \"/bin/false\"\n install usb-storage /bin/false\n\nIf the command does not return any output, or the line is commented out, and use of USB Storage is not documented with the Information System Security Officer (ISSO) as an operational requirement, this is a finding.\n\nVerify the operating system disables the ability to use USB mass storage devices.\n\nCheck to see if USB mass storage is disabled with the following command:\n\n $ sudo grep usb-storage /etc/modprobe.d/* | grep -i \"blacklist\"\n blacklist usb-storage\n\nIf the command does not return any output or the output is not \"blacklist usb-storage\" and use of USB storage devices is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the ability to use the USB Storage kernel module and the ability to use USB mass storage devices.\n\nAdd or update the following lines in the file \"/etc/modprobe.d/blacklist.conf\":\n\n install usb-storage /bin/false\n blacklist usb-storage\n\nReboot the system for the settings to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000114-GPOS-00059", + "satisfies": [ + "SRG-OS-000114-GPOS-00059", + "SRG-OS-000378-GPOS-00163" + ], + "gid": "V-230503", + "rid": "SV-258034r942936_rule", + "stig_id": "RHEL-08-040080", + "fix_id": "F-33147r942935_fix", + "cci": [ + "CCI-000778" + ], + "nist": [ + "IA-3" + ], + "host": null + } + }, + { + "id": "SV-258035", + "code": "control 'SV-258035' do\n title 'RHEL 8 must have the USBGuard installed.'\n desc 'Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.'\n desc 'check', 'Verify USBGuard is installed on the operating system with the following\ncommand:\n\n $ sudo yum list installed usbguard\n\n Installed Packages\n usbguard.x86_64 0.7.8-7.el8 @ol8_appstream\n\n If the USBGuard package is not installed, ask the SA to indicate how\nunauthorized peripherals are being blocked.\n If there is no evidence that unauthorized peripherals are being blocked\nbefore establishing a connection, this is a finding.'\n desc 'fix', 'Install the USBGuard package with the following command:\n\n$ sudo yum install usbguard.x86_64'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000378-GPOS-00163'\n tag gid: 'V-244547'\n tag rid: 'SV-258035r854076_rule'\n tag stig_id: 'RHEL-08-040139'\n tag fix_id: 'F-47779r743889_fix'\n tag cci: ['CCI-001958']\n tag nist: ['IA-3']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n peripherals_package = input('peripherals_package')\n\n describe package(peripherals_package) do\n it \"is expected to be installed. \\n\\tPlease ensure to configure the service to ensure your devices function as expected.\" do\n expect(subject.installed?).to be(true), \"The #{peripherals_package} package is not installed\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258035.rb" + }, + "title": "RHEL 8 must have the USBGuard installed.", + "desc": "Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.", + "descriptions": { + "default": "Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.", + "check": "Verify USBGuard is installed on the operating system with the following\ncommand:\n\n $ sudo yum list installed usbguard\n\n Installed Packages\n usbguard.x86_64 0.7.8-7.el8 @ol8_appstream\n\n If the USBGuard package is not installed, ask the SA to indicate how\nunauthorized peripherals are being blocked.\n If there is no evidence that unauthorized peripherals are being blocked\nbefore establishing a connection, this is a finding.", + "fix": "Install the USBGuard package with the following command:\n\n$ sudo yum install usbguard.x86_64" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000378-GPOS-00163", + "gid": "V-244547", + "rid": "SV-258035r854076_rule", + "stig_id": "RHEL-08-040139", + "fix_id": "F-47779r743889_fix", + "cci": [ + "CCI-001958" + ], + "nist": [ + "IA-3" + ], + "host": null + } + }, + { + "id": "SV-258036", + "code": "control 'SV-258036' do\n title 'RHEL 8 must enable the USBGuard.'\n desc 'Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.'\n desc 'check', 'Verify the operating system has enabled the use of the USBGuard with the\nfollowing command:\n\n $ sudo systemctl status usbguard.service\n\n usbguard.service - USBGuard daemon\n Loaded: loaded (/usr/lib/systemd/system/usbguard.service; enabled; vendor\npreset: disabled)\n Active: active (running)\n\n If the usbguard.service is not enabled and active, ask the SA to indicate\nhow unauthorized peripherals are being blocked.\n If there is no evidence that unauthorized peripherals are being blocked\nbefore establishing a connection, this is a finding.'\n desc 'fix', 'Configure the operating system to enable the blocking of unauthorized\nperipherals with the following commands:\n\n $ sudo systemctl enable usbguard.service\n\n $ sudo systemctl start usbguard.service\n\n Note: Enabling and starting usbguard without properly configuring it for an\nindividual system will immediately prevent any access over a usb device such as\na keyboard or mouse'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000378-GPOS-00163'\n tag gid: 'V-244548'\n tag rid: 'SV-258036r854077_rule'\n tag stig_id: 'RHEL-08-040141'\n tag fix_id: 'F-47780r743892_fix'\n tag cci: ['CCI-001958']\n tag nist: ['IA-3']\n tag 'host'\n\n only_if('This requirement does not apply to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n peripherals_service = input('peripherals_service')\n\n describe service(peripherals_service) do\n it \"is expected to be running. \\n\\tPlease ensure to configure the service to ensure your devices function as expected.\" do\n expect(subject.running?).to be(true), \"The #{peripherals_service} service is not running\"\n end\n it \"is expected to be enabled. \\n\\tPlease ensure to configure the service to ensure your devices function as expected.\" do\n expect(subject.enabled?).to be(true), \"The #{peripherals_service} service is not enabled\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258036.rb" + }, + "title": "RHEL 8 must enable the USBGuard.", + "desc": "Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.", + "descriptions": { + "default": "Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.", + "check": "Verify the operating system has enabled the use of the USBGuard with the\nfollowing command:\n\n $ sudo systemctl status usbguard.service\n\n usbguard.service - USBGuard daemon\n Loaded: loaded (/usr/lib/systemd/system/usbguard.service; enabled; vendor\npreset: disabled)\n Active: active (running)\n\n If the usbguard.service is not enabled and active, ask the SA to indicate\nhow unauthorized peripherals are being blocked.\n If there is no evidence that unauthorized peripherals are being blocked\nbefore establishing a connection, this is a finding.", + "fix": "Configure the operating system to enable the blocking of unauthorized\nperipherals with the following commands:\n\n $ sudo systemctl enable usbguard.service\n\n $ sudo systemctl start usbguard.service\n\n Note: Enabling and starting usbguard without properly configuring it for an\nindividual system will immediately prevent any access over a usb device such as\na keyboard or mouse" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000378-GPOS-00163", + "gid": "V-244548", + "rid": "SV-258036r854077_rule", + "stig_id": "RHEL-08-040141", + "fix_id": "F-47780r743892_fix", + "cci": [ + "CCI-001958" + ], + "nist": [ + "IA-3" + ], + "host": null + } + }, + { + "id": "SV-258037", + "code": "control 'SV-258037' do\n title 'RHEL 8 must enable Linux audit logging for the USBGuard daemon.'\n desc 'Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.'\n desc 'check', 'Verify RHEL 8 enables Linux audit logging of the USBGuard daemon with the\nfollowing commands:\n\n Note: If the USBGuard daemon is not installed and enabled, this requirement\nis not applicable.\n\n $ sudo grep -i auditbackend /etc/usbguard/usbguard-daemon.conf\n\n AuditBackend=LinuxAudit\n\n If the \"AuditBackend\" entry does not equal \"LinuxAudit\", is missing, or\nthe line is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to enable Linux audit logging of the USBGuard daemon by\nadding or modifying the following line in\n\"/etc/usbguard/usbguard-daemon.conf\":\n\n AuditBackend=LinuxAudit'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230470'\n tag rid: 'SV-258037r744006_rule'\n tag stig_id: 'RHEL-08-030603'\n tag fix_id: 'F-33114r744005_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe parse_config_file('/etc/usbguard/usbguard-daemon.conf') do\n its('AuditBackend') { should cmp 'LinuxAudit' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258037.rb" + }, + "title": "RHEL 8 must enable Linux audit logging for the USBGuard daemon.", + "desc": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "descriptions": { + "default": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "check": "Verify RHEL 8 enables Linux audit logging of the USBGuard daemon with the\nfollowing commands:\n\n Note: If the USBGuard daemon is not installed and enabled, this requirement\nis not applicable.\n\n $ sudo grep -i auditbackend /etc/usbguard/usbguard-daemon.conf\n\n AuditBackend=LinuxAudit\n\n If the \"AuditBackend\" entry does not equal \"LinuxAudit\", is missing, or\nthe line is commented out, this is a finding.", + "fix": "Configure RHEL 8 to enable Linux audit logging of the USBGuard daemon by\nadding or modifying the following line in\n\"/etc/usbguard/usbguard-daemon.conf\":\n\n AuditBackend=LinuxAudit" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230470", + "rid": "SV-258037r744006_rule", + "stig_id": "RHEL-08-030603", + "fix_id": "F-33114r744005_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258038", + "code": "control 'SV-258038' do\n title 'RHEL 8 must block unauthorized peripherals before establishing a\nconnection.'\n desc 'Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.'\n desc 'check', 'Verify the USBGuard has a policy configured with the following command:\n\n $ sudo usbguard list-rules\n\n If the command does not return results or an error is returned, ask the SA\nto indicate how unauthorized peripherals are being blocked.\n\n If there is no evidence that unauthorized peripherals are being blocked\nbefore establishing a connection, this is a finding.'\n desc 'fix', 'Configure the operating system to enable the blocking of unauthorized\nperipherals with the following command:\n This command must be run from a root shell and will create an allow list\nfor any usb devices currently connect to the system.\n\n # usbguard generate-policy > /etc/usbguard/rules.conf\n\n Note: Enabling and starting usbguard without properly configuring it for an\nindividual system will immediately prevent any access over a usb device such as\na keyboard or mouse'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000378-GPOS-00163'\n tag gid: 'V-230524'\n tag rid: 'SV-258038r854065_rule'\n tag stig_id: 'RHEL-08-040140'\n tag fix_id: 'F-33168r744025_fix'\n tag cci: ['CCI-001958']\n tag nist: ['IA-3']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n peripherals_package = input('peripherals_package')\n\n if peripherals_package != 'usbguard'\n describe 'Non-standard package' do\n it 'is handling peripherals' do\n expect(peripherals_package).to exist\n end\n end\n else\n describe command('usbguard list-rules') do\n its('stdout') { should_not be_empty }\n its('exit_status') { should eq 0 }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258038.rb" + }, + "title": "RHEL 8 must block unauthorized peripherals before establishing a\nconnection.", + "desc": "Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.", + "descriptions": { + "default": "Without authenticating devices, unidentified or unknown devices may be\nintroduced, thereby facilitating malicious activity.\n\n Peripherals include, but are not limited to, such devices as flash drives,\nexternal storage, and printers.\n\n A new feature that RHEL 8 provides is the USBGuard software framework. The\nUSBguard-daemon is the main component of the USBGuard software framework. It\nruns as a service in the background and enforces the USB device authorization\npolicy for all USB devices. The policy is defined by a set of rules using a\nrule language described in the usbguard-rules.conf file. The policy and the\nauthorization state of USB devices can be modified during runtime using the\nusbguard tool.\n\n The System Administrator (SA) must work with the site Information System\nSecurity Officer (ISSO) to determine a list of authorized peripherals and\nestablish rules within the USBGuard software framework to allow only authorized\ndevices.", + "check": "Verify the USBGuard has a policy configured with the following command:\n\n $ sudo usbguard list-rules\n\n If the command does not return results or an error is returned, ask the SA\nto indicate how unauthorized peripherals are being blocked.\n\n If there is no evidence that unauthorized peripherals are being blocked\nbefore establishing a connection, this is a finding.", + "fix": "Configure the operating system to enable the blocking of unauthorized\nperipherals with the following command:\n This command must be run from a root shell and will create an allow list\nfor any usb devices currently connect to the system.\n\n # usbguard generate-policy > /etc/usbguard/rules.conf\n\n Note: Enabling and starting usbguard without properly configuring it for an\nindividual system will immediately prevent any access over a usb device such as\na keyboard or mouse" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000378-GPOS-00163", + "gid": "V-230524", + "rid": "SV-258038r854065_rule", + "stig_id": "RHEL-08-040140", + "fix_id": "F-33168r744025_fix", + "cci": [ + "CCI-001958" + ], + "nist": [ + "IA-3" + ], + "host": null + } + }, + { + "id": "SV-258039", + "code": "control 'SV-258039' do\n title 'RHEL 8 Bluetooth must be disabled.'\n desc 'Without protection of communications with wireless peripherals,\nconfidentiality and integrity may be compromised because unprotected\ncommunications can be intercepted and either read, altered, or used to\ncompromise the RHEL 8 operating system.\n\n This requirement applies to wireless peripheral technologies (e.g.,\nwireless mice, keyboards, displays, etc.) used with RHEL 8 systems. Wireless\nperipherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and\nNear Field Communications [NFC]) present a unique challenge by creating an\nopen, unsecured port on a computer. Wireless peripherals must meet DoD\nrequirements for wireless data transmission and be approved for use by the\nAuthorizing Official (AO). Even though some wireless peripherals, such as mice\nand pointing devices, do not ordinarily carry information that need to be\nprotected, modification of communications with these wireless peripherals may\nbe used to compromise the RHEL 8 operating system. Communication paths outside\nthe physical protection of a controlled boundary are exposed to the possibility\nof interception and modification.\n\n Protecting the confidentiality and integrity of communications with\nwireless peripherals can be accomplished by physical means (e.g., employing\nphysical barriers to wireless radio frequencies) or by logical means (e.g.,\nemploying cryptographic techniques). If physical means of protection are\nemployed, then logical means (cryptography) do not have to be employed, and\nvice versa. If the wireless peripheral is only passing telemetry data,\nencryption of the data may not be required.'\n desc 'check', 'If the device or operating system does not have a Bluetooth adapter installed, this requirement is not applicable.\n\nThis requirement is not applicable to mobile devices (smartphones and tablets), where the use of Bluetooth is a local AO decision.\n\nDetermine if Bluetooth is disabled with the following command:\n\n $ sudo grep bluetooth /etc/modprobe.d/*\n /etc/modprobe.d/bluetooth.conf:install bluetooth /bin/false\n\nIf the Bluetooth driver blacklist entry is missing, a Bluetooth driver is determined to be in use, and the collaborative computing device has not been authorized for use, this is a finding.\n\nVerify the operating system disables the ability to use Bluetooth with the following command:\n\n $ sudo grep -r bluetooth /etc/modprobe.d | grep -i \"blacklist\" | grep -v \"^#\"\n blacklist bluetooth\n\nIf the command does not return any output or the output is not \"blacklist bluetooth\", and use of Bluetooth is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Configure the operating system to disable the Bluetooth adapter when not in use.\n\nBuild or modify the \"/etc/modprobe.d/bluetooth.conf\" file with the following line:\n\n install bluetooth /bin/false\n\nDisable the ability to use the Bluetooth kernel module.\n\n $ sudo vi /etc/modprobe.d/blacklist.conf\n\nAdd or update the line:\n\n blacklist bluetooth\n\nReboot the system for the settings to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000300-GPOS-00118'\n tag gid: 'V-230507'\n tag rid: 'SV-258039r942939_rule'\n tag stig_id: 'RHEL-08-040111'\n tag fix_id: 'F-33151r942938_fix'\n tag cci: ['CCI-001443']\n tag nist: ['AC-18 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('bluetooth_installed')\n describe kernel_module('bluetooth') do\n it { should be_disabled }\n it { should be_blacklisted }\n end\n else\n impact 0.0\n describe 'Device or operating system does not have a Bluetooth adapter installed' do\n skip 'If the device or operating system does not have a Bluetooth adapter installed, this requirement is not applicable.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258039.rb" + }, + "title": "RHEL 8 Bluetooth must be disabled.", + "desc": "Without protection of communications with wireless peripherals,\nconfidentiality and integrity may be compromised because unprotected\ncommunications can be intercepted and either read, altered, or used to\ncompromise the RHEL 8 operating system.\n\n This requirement applies to wireless peripheral technologies (e.g.,\nwireless mice, keyboards, displays, etc.) used with RHEL 8 systems. Wireless\nperipherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and\nNear Field Communications [NFC]) present a unique challenge by creating an\nopen, unsecured port on a computer. Wireless peripherals must meet DoD\nrequirements for wireless data transmission and be approved for use by the\nAuthorizing Official (AO). Even though some wireless peripherals, such as mice\nand pointing devices, do not ordinarily carry information that need to be\nprotected, modification of communications with these wireless peripherals may\nbe used to compromise the RHEL 8 operating system. Communication paths outside\nthe physical protection of a controlled boundary are exposed to the possibility\nof interception and modification.\n\n Protecting the confidentiality and integrity of communications with\nwireless peripherals can be accomplished by physical means (e.g., employing\nphysical barriers to wireless radio frequencies) or by logical means (e.g.,\nemploying cryptographic techniques). If physical means of protection are\nemployed, then logical means (cryptography) do not have to be employed, and\nvice versa. If the wireless peripheral is only passing telemetry data,\nencryption of the data may not be required.", + "descriptions": { + "default": "Without protection of communications with wireless peripherals,\nconfidentiality and integrity may be compromised because unprotected\ncommunications can be intercepted and either read, altered, or used to\ncompromise the RHEL 8 operating system.\n\n This requirement applies to wireless peripheral technologies (e.g.,\nwireless mice, keyboards, displays, etc.) used with RHEL 8 systems. Wireless\nperipherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and\nNear Field Communications [NFC]) present a unique challenge by creating an\nopen, unsecured port on a computer. Wireless peripherals must meet DoD\nrequirements for wireless data transmission and be approved for use by the\nAuthorizing Official (AO). Even though some wireless peripherals, such as mice\nand pointing devices, do not ordinarily carry information that need to be\nprotected, modification of communications with these wireless peripherals may\nbe used to compromise the RHEL 8 operating system. Communication paths outside\nthe physical protection of a controlled boundary are exposed to the possibility\nof interception and modification.\n\n Protecting the confidentiality and integrity of communications with\nwireless peripherals can be accomplished by physical means (e.g., employing\nphysical barriers to wireless radio frequencies) or by logical means (e.g.,\nemploying cryptographic techniques). If physical means of protection are\nemployed, then logical means (cryptography) do not have to be employed, and\nvice versa. If the wireless peripheral is only passing telemetry data,\nencryption of the data may not be required.", + "check": "If the device or operating system does not have a Bluetooth adapter installed, this requirement is not applicable.\n\nThis requirement is not applicable to mobile devices (smartphones and tablets), where the use of Bluetooth is a local AO decision.\n\nDetermine if Bluetooth is disabled with the following command:\n\n $ sudo grep bluetooth /etc/modprobe.d/*\n /etc/modprobe.d/bluetooth.conf:install bluetooth /bin/false\n\nIf the Bluetooth driver blacklist entry is missing, a Bluetooth driver is determined to be in use, and the collaborative computing device has not been authorized for use, this is a finding.\n\nVerify the operating system disables the ability to use Bluetooth with the following command:\n\n $ sudo grep -r bluetooth /etc/modprobe.d | grep -i \"blacklist\" | grep -v \"^#\"\n blacklist bluetooth\n\nIf the command does not return any output or the output is not \"blacklist bluetooth\", and use of Bluetooth is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Configure the operating system to disable the Bluetooth adapter when not in use.\n\nBuild or modify the \"/etc/modprobe.d/bluetooth.conf\" file with the following line:\n\n install bluetooth /bin/false\n\nDisable the ability to use the Bluetooth kernel module.\n\n $ sudo vi /etc/modprobe.d/blacklist.conf\n\nAdd or update the line:\n\n blacklist bluetooth\n\nReboot the system for the settings to take effect." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000300-GPOS-00118", + "gid": "V-230507", + "rid": "SV-258039r942939_rule", + "stig_id": "RHEL-08-040111", + "fix_id": "F-33151r942938_fix", + "cci": [ + "CCI-001443" + ], + "nist": [ + "AC-18 (1)" + ], + "host": null + } + }, + { + "id": "SV-258040", + "code": "control 'SV-258040' do\n title 'RHEL 8 wireless network adapters must be disabled.'\n desc 'Without protection of communications with wireless peripherals,\nconfidentiality and integrity may be compromised because unprotected\ncommunications can be intercepted and either read, altered, or used to\ncompromise the RHEL 8 operating system.\n\n This requirement applies to wireless peripheral technologies (e.g.,\nwireless mice, keyboards, displays, etc.) used with RHEL 8 systems. Wireless\nperipherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and\nNear Field Communications [NFC]) present a unique challenge by creating an\nopen, unsecured port on a computer. Wireless peripherals must meet DoD\nrequirements for wireless data transmission and be approved for use by the\nAuthorizing Official (AO). Even though some wireless peripherals, such as mice\nand pointing devices, do not ordinarily carry information that need to be\nprotected, modification of communications with these wireless peripherals may\nbe used to compromise the RHEL 8 operating system. Communication paths outside\nthe physical protection of a controlled boundary are exposed to the possibility\nof interception and modification.\n\n Protecting the confidentiality and integrity of communications with\nwireless peripherals can be accomplished by physical means (e.g., employing\nphysical barriers to wireless radio frequencies) or by logical means (e.g.,\nemploying cryptographic techniques). If physical means of protection are\nemployed, then logical means (cryptography) do not have to be employed, and\nvice versa. If the wireless peripheral is only passing telemetry data,\nencryption of the data may not be required.'\n desc 'check', 'Verify there are no wireless interfaces configured on the system with the\nfollowing command:\n\n Note: This requirement is Not Applicable for systems that do not have\nphysical wireless network radios.\n\n $ sudo nmcli device status\n\n DEVICE TYPE STATE\nCONNECTION\n virbr0 bridge connected virbr0\n wlp7s0 wifi connected wifiSSID\n enp6s0 ethernet disconnected --\n p2p-dev-wlp7s0 wifi-p2p disconnected --\n lo loopback unmanaged --\n virbr0-nic tun unmanaged --\n\n If a wireless interface is configured and has not been documented and\napproved by the Information System Security Officer (ISSO), this is a finding.'\n desc 'fix', 'Configure the system to disable all wireless network interfaces with the\nfollowing command:\n\n $ sudo nmcli radio all off'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000299-GPOS-00117'\n tag satisfies: ['SRG-OS-000299-GPOS-00117', 'SRG-OS-000300-GPOS-00118', 'SRG-OS-000481-GPOS-000481']\n tag gid: 'V-230506'\n tag rid: 'SV-258040r627750_rule'\n tag stig_id: 'RHEL-08-040110'\n tag fix_id: 'F-33150r568265_fix'\n tag cci: ['CCI-001444']\n tag nist: ['AC-18 (1)']\n tag 'host'\n tag 'container'\n\n if input('wifi_hardware')\n describe command('nmcli device') do\n its('stdout.strip') { should_not match(/wifi\\s*connected/) }\n end\n else\n impact 0.0\n describe 'Skip' do\n skip 'The system does not have a wireless network adapter, this control is Not Applicable.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258040.rb" + }, + "title": "RHEL 8 wireless network adapters must be disabled.", + "desc": "Without protection of communications with wireless peripherals,\nconfidentiality and integrity may be compromised because unprotected\ncommunications can be intercepted and either read, altered, or used to\ncompromise the RHEL 8 operating system.\n\n This requirement applies to wireless peripheral technologies (e.g.,\nwireless mice, keyboards, displays, etc.) used with RHEL 8 systems. Wireless\nperipherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and\nNear Field Communications [NFC]) present a unique challenge by creating an\nopen, unsecured port on a computer. Wireless peripherals must meet DoD\nrequirements for wireless data transmission and be approved for use by the\nAuthorizing Official (AO). Even though some wireless peripherals, such as mice\nand pointing devices, do not ordinarily carry information that need to be\nprotected, modification of communications with these wireless peripherals may\nbe used to compromise the RHEL 8 operating system. Communication paths outside\nthe physical protection of a controlled boundary are exposed to the possibility\nof interception and modification.\n\n Protecting the confidentiality and integrity of communications with\nwireless peripherals can be accomplished by physical means (e.g., employing\nphysical barriers to wireless radio frequencies) or by logical means (e.g.,\nemploying cryptographic techniques). If physical means of protection are\nemployed, then logical means (cryptography) do not have to be employed, and\nvice versa. If the wireless peripheral is only passing telemetry data,\nencryption of the data may not be required.", + "descriptions": { + "default": "Without protection of communications with wireless peripherals,\nconfidentiality and integrity may be compromised because unprotected\ncommunications can be intercepted and either read, altered, or used to\ncompromise the RHEL 8 operating system.\n\n This requirement applies to wireless peripheral technologies (e.g.,\nwireless mice, keyboards, displays, etc.) used with RHEL 8 systems. Wireless\nperipherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and\nNear Field Communications [NFC]) present a unique challenge by creating an\nopen, unsecured port on a computer. Wireless peripherals must meet DoD\nrequirements for wireless data transmission and be approved for use by the\nAuthorizing Official (AO). Even though some wireless peripherals, such as mice\nand pointing devices, do not ordinarily carry information that need to be\nprotected, modification of communications with these wireless peripherals may\nbe used to compromise the RHEL 8 operating system. Communication paths outside\nthe physical protection of a controlled boundary are exposed to the possibility\nof interception and modification.\n\n Protecting the confidentiality and integrity of communications with\nwireless peripherals can be accomplished by physical means (e.g., employing\nphysical barriers to wireless radio frequencies) or by logical means (e.g.,\nemploying cryptographic techniques). If physical means of protection are\nemployed, then logical means (cryptography) do not have to be employed, and\nvice versa. If the wireless peripheral is only passing telemetry data,\nencryption of the data may not be required.", + "check": "Verify there are no wireless interfaces configured on the system with the\nfollowing command:\n\n Note: This requirement is Not Applicable for systems that do not have\nphysical wireless network radios.\n\n $ sudo nmcli device status\n\n DEVICE TYPE STATE\nCONNECTION\n virbr0 bridge connected virbr0\n wlp7s0 wifi connected wifiSSID\n enp6s0 ethernet disconnected --\n p2p-dev-wlp7s0 wifi-p2p disconnected --\n lo loopback unmanaged --\n virbr0-nic tun unmanaged --\n\n If a wireless interface is configured and has not been documented and\napproved by the Information System Security Officer (ISSO), this is a finding.", + "fix": "Configure the system to disable all wireless network interfaces with the\nfollowing command:\n\n $ sudo nmcli radio all off" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000299-GPOS-00117", + "satisfies": [ + "SRG-OS-000299-GPOS-00117", + "SRG-OS-000300-GPOS-00118", + "SRG-OS-000481-GPOS-000481" + ], + "gid": "V-230506", + "rid": "SV-258040r627750_rule", + "stig_id": "RHEL-08-040110", + "fix_id": "F-33150r568265_fix", + "cci": [ + "CCI-001444" + ], + "nist": [ + "AC-18 (1)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258041", + "code": "control 'SV-258041' do\n title 'RHEL 8 user account passwords must have a 60-day maximum password\nlifetime restriction.'\n desc 'Any password, no matter how complex, can eventually be cracked.\nTherefore, passwords need to be changed periodically. If RHEL 8 does not limit\nthe lifetime of passwords and force users to change their passwords, there is\nthe risk that RHEL 8 passwords could be compromised.'\n desc 'check', 'Verify that RHEL 8 enforces a 60-day maximum password lifetime for new user\naccounts by running the following command:\n\n $ sudo grep -i pass_max_days /etc/login.defs\n PASS_MAX_DAYS 60\n\n If the \"PASS_MAX_DAYS\" parameter value is greater than \"60\", or\ncommented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to enforce a 60-day maximum password lifetime.\n\nAdd, or modify the following line in the \"/etc/login.defs\" file:\n\nPASS_MAX_DAYS 60'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000076-GPOS-00044'\n tag gid: 'V-230366'\n tag rid: 'SV-258041r646878_rule'\n tag stig_id: 'RHEL-08-020200'\n tag fix_id: 'F-33010r567845_fix'\n tag cci: ['CCI-000199']\n tag nist: ['IA-5 (1) (d)']\n tag 'host'\n tag 'container'\n\n value = input('pass_max_days')\n setting = input_object('pass_max_days').name.upcase\n\n describe \"/etc/login.defs does not have `#{setting}` configured\" do\n let(:config) { login_defs.read_params[setting] }\n it \"greater than #{value} day\" do\n expect(config).to cmp <= value\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258041.rb" + }, + "title": "RHEL 8 user account passwords must have a 60-day maximum password\nlifetime restriction.", + "desc": "Any password, no matter how complex, can eventually be cracked.\nTherefore, passwords need to be changed periodically. If RHEL 8 does not limit\nthe lifetime of passwords and force users to change their passwords, there is\nthe risk that RHEL 8 passwords could be compromised.", + "descriptions": { + "default": "Any password, no matter how complex, can eventually be cracked.\nTherefore, passwords need to be changed periodically. If RHEL 8 does not limit\nthe lifetime of passwords and force users to change their passwords, there is\nthe risk that RHEL 8 passwords could be compromised.", + "check": "Verify that RHEL 8 enforces a 60-day maximum password lifetime for new user\naccounts by running the following command:\n\n $ sudo grep -i pass_max_days /etc/login.defs\n PASS_MAX_DAYS 60\n\n If the \"PASS_MAX_DAYS\" parameter value is greater than \"60\", or\ncommented out, this is a finding.", + "fix": "Configure RHEL 8 to enforce a 60-day maximum password lifetime.\n\nAdd, or modify the following line in the \"/etc/login.defs\" file:\n\nPASS_MAX_DAYS 60" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000076-GPOS-00044", + "gid": "V-230366", + "rid": "SV-258041r646878_rule", + "stig_id": "RHEL-08-020200", + "fix_id": "F-33010r567845_fix", + "cci": [ + "CCI-000199" + ], + "nist": [ + "IA-5 (1) (d)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258042", + "code": "control 'SV-258042' do\n title 'RHEL 8 user account passwords must be configured so that existing\npasswords are restricted to a 60-day maximum lifetime.'\n desc 'Any password, no matter how complex, can eventually be cracked.\nTherefore, passwords need to be changed periodically. If RHEL 8 does not limit\nthe lifetime of passwords and force users to change their passwords, there is\nthe risk that RHEL 8 passwords could be compromised.'\n desc 'check', %q(Check whether the maximum time period for existing passwords is restricted\nto 60 days with the following commands:\n\n $ sudo awk -F: '$5 > 60 {print $1 \" \" $5}' /etc/shadow\n\n $ sudo awk -F: '$5 <= 0 {print $1 \" \" $5}' /etc/shadow\n\n If any results are returned that are not associated with a system account,\nthis is a finding.)\n desc 'fix', 'Configure non-compliant accounts to enforce a 60-day maximum password\nlifetime restriction.\n\n $ sudo chage -M 60 [user]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000076-GPOS-00044'\n tag gid: 'V-230367'\n tag rid: 'SV-258042r627750_rule'\n tag stig_id: 'RHEL-08-020210'\n tag fix_id: 'F-33011r567848_fix'\n tag cci: ['CCI-000199']\n tag nist: ['IA-5 (1) (d)']\n tag 'host'\n tag 'container'\n\n value = input('pass_max_days')\n\n bad_users = users.where { uid >= 1000 }.where { value > 60 or maxdays.negative? }.usernames\n in_scope_users = bad_users - input('exempt_home_users')\n\n describe 'Users are not be able' do\n it \"to retain passwords for more then #{value} day(s)\" do\n failure_message = \"The following users can update their password more then every #{value} day(s): #{in_scope_users.join(', ')}\"\n expect(in_scope_users).to be_empty, failure_message\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258042.rb" + }, + "title": "RHEL 8 user account passwords must be configured so that existing\npasswords are restricted to a 60-day maximum lifetime.", + "desc": "Any password, no matter how complex, can eventually be cracked.\nTherefore, passwords need to be changed periodically. If RHEL 8 does not limit\nthe lifetime of passwords and force users to change their passwords, there is\nthe risk that RHEL 8 passwords could be compromised.", + "descriptions": { + "default": "Any password, no matter how complex, can eventually be cracked.\nTherefore, passwords need to be changed periodically. If RHEL 8 does not limit\nthe lifetime of passwords and force users to change their passwords, there is\nthe risk that RHEL 8 passwords could be compromised.", + "check": "Check whether the maximum time period for existing passwords is restricted\nto 60 days with the following commands:\n\n $ sudo awk -F: '$5 > 60 {print $1 \" \" $5}' /etc/shadow\n\n $ sudo awk -F: '$5 <= 0 {print $1 \" \" $5}' /etc/shadow\n\n If any results are returned that are not associated with a system account,\nthis is a finding.", + "fix": "Configure non-compliant accounts to enforce a 60-day maximum password\nlifetime restriction.\n\n $ sudo chage -M 60 [user]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000076-GPOS-00044", + "gid": "V-230367", + "rid": "SV-258042r627750_rule", + "stig_id": "RHEL-08-020210", + "fix_id": "F-33011r567848_fix", + "cci": [ + "CCI-000199" + ], + "nist": [ + "IA-5 (1) (d)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258043", + "code": "control 'SV-258043' do\n title 'All RHEL 8 local interactive user accounts must be assigned a home\ndirectory upon creation.'\n desc 'If local interactive users are not assigned a valid home directory,\nthere is no place for the storage and control of files they should own.'\n desc 'check', 'Verify all local interactive users on RHEL 8 are assigned a home directory\nupon creation with the following command:\n\n $ sudo grep -i create_home /etc/login.defs\n\n CREATE_HOME yes\n\n If the value for \"CREATE_HOME\" parameter is not set to \"yes\", the line\nis missing, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to assign home directories to all new local interactive\nusers by setting the \"CREATE_HOME\" parameter in \"/etc/login.defs\" to\n\"yes\" as follows.\n\n CREATE_HOME yes'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230324'\n tag rid: 'SV-258043r627750_rule'\n tag stig_id: 'RHEL-08-010760'\n tag fix_id: 'F-32968r567719_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n describe login_defs do\n its('CREATE_HOME') { should eq 'yes' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258043.rb" + }, + "title": "All RHEL 8 local interactive user accounts must be assigned a home\ndirectory upon creation.", + "desc": "If local interactive users are not assigned a valid home directory,\nthere is no place for the storage and control of files they should own.", + "descriptions": { + "default": "If local interactive users are not assigned a valid home directory,\nthere is no place for the storage and control of files they should own.", + "check": "Verify all local interactive users on RHEL 8 are assigned a home directory\nupon creation with the following command:\n\n $ sudo grep -i create_home /etc/login.defs\n\n CREATE_HOME yes\n\n If the value for \"CREATE_HOME\" parameter is not set to \"yes\", the line\nis missing, or the line is commented out, this is a finding.", + "fix": "Configure RHEL 8 to assign home directories to all new local interactive\nusers by setting the \"CREATE_HOME\" parameter in \"/etc/login.defs\" to\n\"yes\" as follows.\n\n CREATE_HOME yes" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230324", + "rid": "SV-258043r627750_rule", + "stig_id": "RHEL-08-010760", + "fix_id": "F-32968r567719_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258044", + "code": "control 'SV-258044' do\n title 'RHEL 8 must set the umask value to 077 for all local interactive user\naccounts.'\n desc 'The umask controls the default access mode assigned to newly created\nfiles. A umask of 077 limits new files to mode 600 or less permissive. Although\numask can be represented as a four-digit number, the first digit representing\nspecial access modes is typically ignored or required to be \"0\". This\nrequirement applies to the globally configured system defaults and the local\ninteractive user defaults for each account on the system.'\n desc 'check', %q(Verify that the default umask for all local interactive users is \"077\".\n\nIdentify the locations of all local interactive user home directories by looking at the \"/etc/passwd\" file.\n\nCheck all local interactive user initialization files for interactive users with the following command:\n\nNote: The example is for a system that is configured to create users home directories in the \"/home\" directory.\n\n$ sudo grep -ir ^umask /home | grep -v '.bash_history'\n\nIf any local interactive user initialization files are found to have a umask statement that has a value less restrictive than \"077\", this is a finding.)\n desc 'fix', %q(Remove the umask statement from all local interactive user's initialization\nfiles.\n\n If the account is for an application, the requirement for a umask less\nrestrictive than \"077\" can be documented with the Information System Security\nOfficer, but the user agreement for access to the account must specify that the\nlocal interactive user must log on to their account first and then switch the\nuser to the application account with the correct option to gain the account's\nenvironment variables.)\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00228'\n tag gid: 'V-230384'\n tag rid: 'SV-258044r858732_rule'\n tag stig_id: 'RHEL-08-020352'\n tag fix_id: 'F-33028r567899_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n exempt_home_users = input('exempt_home_users')\n expected_mode = input('permissions_for_shells')['default_umask']\n uid_min = login_defs.read_params['UID_MIN'].to_i\n uid_min = 1000 if uid_min.nil?\n\n iusers = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) }\n\n if !iusers.users.nil? && !iusers.users.empty?\n\n # run the check text's grep against all interactive users, compare any hits to the expected mode\n failing_users = iusers.entries.select { |u|\n umask_set = command(\"grep -ir ^umask #{u.home} | grep -v '.bash_history'\").stdout.strip\n umask_set.nil? && umask_set.match(/(?\\d{3,4})/)['umask'].to_i > expected_mode.to_i\n }.map(&:user)\n\n describe 'All non-exempt interactive users on the system' do\n it \"should not set the UMASK more permissive than '#{expected_mode}' in any init files\" do\n expect(failing_users).to be_empty, \"Failing users:\\n\\t- #{failing_users.join(\"\\n\\t- \")}\"\n end\n end\n else\n describe 'No non-exempt interactive user accounts' do\n it 'were detected on the system' do\n expect(true).to eq(true)\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258044.rb" + }, + "title": "RHEL 8 must set the umask value to 077 for all local interactive user\naccounts.", + "desc": "The umask controls the default access mode assigned to newly created\nfiles. A umask of 077 limits new files to mode 600 or less permissive. Although\numask can be represented as a four-digit number, the first digit representing\nspecial access modes is typically ignored or required to be \"0\". This\nrequirement applies to the globally configured system defaults and the local\ninteractive user defaults for each account on the system.", + "descriptions": { + "default": "The umask controls the default access mode assigned to newly created\nfiles. A umask of 077 limits new files to mode 600 or less permissive. Although\numask can be represented as a four-digit number, the first digit representing\nspecial access modes is typically ignored or required to be \"0\". This\nrequirement applies to the globally configured system defaults and the local\ninteractive user defaults for each account on the system.", + "check": "Verify that the default umask for all local interactive users is \"077\".\n\nIdentify the locations of all local interactive user home directories by looking at the \"/etc/passwd\" file.\n\nCheck all local interactive user initialization files for interactive users with the following command:\n\nNote: The example is for a system that is configured to create users home directories in the \"/home\" directory.\n\n$ sudo grep -ir ^umask /home | grep -v '.bash_history'\n\nIf any local interactive user initialization files are found to have a umask statement that has a value less restrictive than \"077\", this is a finding.", + "fix": "Remove the umask statement from all local interactive user's initialization\nfiles.\n\n If the account is for an application, the requirement for a umask less\nrestrictive than \"077\" can be documented with the Information System Security\nOfficer, but the user agreement for access to the account must specify that the\nlocal interactive user must log on to their account first and then switch the\nuser to the application account with the correct option to gain the account's\nenvironment variables." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00228", + "gid": "V-230384", + "rid": "SV-258044r858732_rule", + "stig_id": "RHEL-08-020352", + "fix_id": "F-33028r567899_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258045", + "code": "control 'SV-258045' do\n title 'RHEL 8 duplicate User IDs (UIDs) must not exist for interactive users.'\n desc 'To ensure accountability and prevent unauthenticated access,\ninteractive users must be identified and authenticated to prevent potential\nmisuse and compromise of the system.\n\n Interactive users include organizational employees or individuals the\norganization deems to have equivalent status of employees (e.g., contractors).\nInteractive users (and processes acting on behalf of users) must be uniquely\nidentified and authenticated to all accesses, except for the following:\n\n 1) Accesses explicitly identified and documented by the organization.\nOrganizations document specific user actions that can be performed on the\ninformation system without identification or authentication; and\n\n 2) Accesses that occur through authorized use of group authenticators\nwithout individual authentication. Organizations may require unique\nidentification of individuals in group accounts (e.g., shared privilege\naccounts) or for detailed accountability of individual activity.'\n desc 'check', %q(Verify that RHEL 8 contains no duplicate User IDs (UIDs) for interactive\nusers.\n\n Check that the operating system contains no duplicate UIDs for interactive\nusers with the following command:\n\n $ sudo awk -F \":\" 'list[$3]++{print $1, $3}' /etc/passwd\n\n If output is produced, and the accounts listed are interactive user\naccounts, this is a finding.)\n desc 'fix', 'Edit the file \"/etc/passwd\" and provide each interactive user\naccount that has a duplicate User ID (UID) with a unique UID.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000104-GPOS-00051'\n tag satisfies: ['SRG-OS-000104-GPOS-00051', 'SRG-OS-000121-GPOS-00062', 'SRG-OS-000042-GPOS-00020']\n tag gid: 'V-230371'\n tag rid: 'SV-258045r627750_rule'\n tag stig_id: 'RHEL-08-020240'\n tag fix_id: 'F-33015r567860_fix'\n tag cci: ['CCI-000764']\n tag nist: ['IA-2']\n tag 'host'\n tag 'container'\n\n user_count = passwd.where { uid.to_i >= 1000 }.entries.length\n\n describe \"Count of interactive unique user IDs should match interactive user count (#{user_count}): UID count\" do\n subject { passwd.where { uid.to_i >= 1000 }.uids.uniq.length }\n it { should eq user_count }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258045.rb" + }, + "title": "RHEL 8 duplicate User IDs (UIDs) must not exist for interactive users.", + "desc": "To ensure accountability and prevent unauthenticated access,\ninteractive users must be identified and authenticated to prevent potential\nmisuse and compromise of the system.\n\n Interactive users include organizational employees or individuals the\norganization deems to have equivalent status of employees (e.g., contractors).\nInteractive users (and processes acting on behalf of users) must be uniquely\nidentified and authenticated to all accesses, except for the following:\n\n 1) Accesses explicitly identified and documented by the organization.\nOrganizations document specific user actions that can be performed on the\ninformation system without identification or authentication; and\n\n 2) Accesses that occur through authorized use of group authenticators\nwithout individual authentication. Organizations may require unique\nidentification of individuals in group accounts (e.g., shared privilege\naccounts) or for detailed accountability of individual activity.", + "descriptions": { + "default": "To ensure accountability and prevent unauthenticated access,\ninteractive users must be identified and authenticated to prevent potential\nmisuse and compromise of the system.\n\n Interactive users include organizational employees or individuals the\norganization deems to have equivalent status of employees (e.g., contractors).\nInteractive users (and processes acting on behalf of users) must be uniquely\nidentified and authenticated to all accesses, except for the following:\n\n 1) Accesses explicitly identified and documented by the organization.\nOrganizations document specific user actions that can be performed on the\ninformation system without identification or authentication; and\n\n 2) Accesses that occur through authorized use of group authenticators\nwithout individual authentication. Organizations may require unique\nidentification of individuals in group accounts (e.g., shared privilege\naccounts) or for detailed accountability of individual activity.", + "check": "Verify that RHEL 8 contains no duplicate User IDs (UIDs) for interactive\nusers.\n\n Check that the operating system contains no duplicate UIDs for interactive\nusers with the following command:\n\n $ sudo awk -F \":\" 'list[$3]++{print $1, $3}' /etc/passwd\n\n If output is produced, and the accounts listed are interactive user\naccounts, this is a finding.", + "fix": "Edit the file \"/etc/passwd\" and provide each interactive user\naccount that has a duplicate User ID (UID) with a unique UID." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000104-GPOS-00051", + "satisfies": [ + "SRG-OS-000104-GPOS-00051", + "SRG-OS-000121-GPOS-00062", + "SRG-OS-000042-GPOS-00020" + ], + "gid": "V-230371", + "rid": "SV-258045r627750_rule", + "stig_id": "RHEL-08-020240", + "fix_id": "F-33015r567860_fix", + "cci": [ + "CCI-000764" + ], + "nist": [ + "IA-2" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258046", + "code": "control 'SV-258046' do\n title 'RHEL 9 system accounts must not have an interactive login shell.'\n desc 'Ensuring shells are not given to system accounts upon login makes it more difficult for attackers to make use of system accounts.'\n desc 'check', %q(Verify that system accounts must not have an interactive login shell with the following command:\n\n$ awk -F: '($3<1000){print $1 \":\" $3 \":\" $7}' /etc/passwd\n\nroot:0:/bin/bash\nbin:1:/sbin/nologin\ndaemon:2:/sbin/nologin\nadm:3:/sbin/nologin\nlp:4:/sbin/nologin\n\nIdentify the system accounts from this listing that do not have a nologin shell.\n\nIf any system account (other than the root account) has a login shell and it is not documented with the information system security officer (ISSO), this is a finding.)\n desc 'fix', 'Configure RHEL 9 so that all noninteractive accounts on the system do not have an interactive shell assigned to them.\n\nIf the system account needs a shell assigned for mission operations, document the need with the information system security officer (ISSO).\n\nRun the following command to disable the interactive shell for a specific noninteractive user account:\n\nReplace with the user that has a login shell.\n\n$ sudo usermod --shell /sbin/nologin \n\nDo not perform the steps in this section on the root account. Doing so will cause the system to become inaccessible.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61787r926123_chk'\n tag severity: 'medium'\n tag gid: 'V-258046'\n tag rid: 'SV-258046r926125_rule'\n tag stig_id: 'RHEL-09-411035'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61711r926124_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258046.rb" + }, + "title": "RHEL 9 system accounts must not have an interactive login shell.", + "desc": "Ensuring shells are not given to system accounts upon login makes it more difficult for attackers to make use of system accounts.", + "descriptions": { + "default": "Ensuring shells are not given to system accounts upon login makes it more difficult for attackers to make use of system accounts.", + "check": "Verify that system accounts must not have an interactive login shell with the following command:\n\n$ awk -F: '($3<1000){print $1 \":\" $3 \":\" $7}' /etc/passwd\n\nroot:0:/bin/bash\nbin:1:/sbin/nologin\ndaemon:2:/sbin/nologin\nadm:3:/sbin/nologin\nlp:4:/sbin/nologin\n\nIdentify the system accounts from this listing that do not have a nologin shell.\n\nIf any system account (other than the root account) has a login shell and it is not documented with the information system security officer (ISSO), this is a finding.", + "fix": "Configure RHEL 9 so that all noninteractive accounts on the system do not have an interactive shell assigned to them.\n\nIf the system account needs a shell assigned for mission operations, document the need with the information system security officer (ISSO).\n\nRun the following command to disable the interactive shell for a specific noninteractive user account:\n\nReplace with the user that has a login shell.\n\n$ sudo usermod --shell /sbin/nologin \n\nDo not perform the steps in this section on the root account. Doing so will cause the system to become inaccessible." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61787r926123_chk", + "severity": "medium", + "gid": "V-258046", + "rid": "SV-258046r926125_rule", + "stig_id": "RHEL-09-411035", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61711r926124_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258047", + "code": "control 'SV-258047' do\n title 'RHEL 8 must automatically expire temporary accounts within 72 hours.'\n desc 'Temporary accounts are privileged or nonprivileged accounts that are\n established during pressing circumstances, such as new software or hardware\n configuration or an incident response, where the need for prompt account\n activation requires bypassing normal account authorization procedures.\n\n If any inactive temporary accounts are left enabled on the system and are\n not either manually removed or automatically expired within 72 hours, the\n security posture of the system will be degraded and exposed to exploitation\n by unauthorized users or insider threat actors.\n\n Temporary accounts are different from emergency accounts. Emergency accounts,\n also known as \"last resort\" or \"break glass\" accounts, are local logon accounts\n enabled on the system for emergency use by authorized system administrators\n to manage a system when standard logon methods are failing or not available.\n\n Emergency accounts are not subject to manual removal or scheduled expiration\n requirements.\n\n The automatic expiration of temporary accounts may be extended as needed by\n the circumstances but it must not be extended indefinitely. A documented\n permanent account should be established for privileged users who need long-term\n maintenance accounts.'\n desc 'check', 'Verify temporary accounts have been provisioned with an\n expiration date of 72 hours.\n\n For every existing temporary account, run the following command to obtain its\n account expiration information:\n\n $ sudo chage -l | grep -i \"account expires\"\n\n Verify each of these accounts has an expiration date set within 72 hours.\n\n If any temporary accounts have no expiration date set or do not expire within\n 72 hours, this is a finding.'\n desc 'fix', 'Configure the operating system to expire temporary accounts after\n 72 hours with the following command:\n\n $ sudo chage -E $(date -d +3days +%Y-%m-%d) '\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000123-GPOS-00064'\n tag gid: 'V-230374'\n tag rid: 'SV-258047r903129_rule'\n tag stig_id: 'RHEL-08-020270'\n tag fix_id: 'F-33018r902730_fix'\n tag cci: ['CCI-001682']\n tag nist: ['AC-2 (2)']\n tag 'host'\n tag 'container'\n\n tmp_users = input('temporary_accounts')\n\n # NOTE: that 230331 is extremely similar to this req, to the point where this input seems\n # appropriate to use for both of them\n tmp_max_days = input('temporary_account_max_days')\n\n if tmp_users.empty?\n describe 'Temporary accounts' do\n subject { tmp_users }\n it { should be_empty }\n end\n else\n # user has to specify what the tmp accounts are, so we will print a different pass message\n # if none of those tmp accounts even exist on the system for clarity\n tmp_users_existing = tmp_users.select { |u| user(u).exists? }\n failing_users = tmp_users_existing.select { |u| user(u).warndays > tmp_max_days }\n\n describe 'Temporary accounts' do\n if tmp_users_existing.nil?\n it \"should have expiration times less than or equal to '#{tmp_max_days}' days\" do\n expect(failing_users).to be_empty, \"Failing users:\\n\\t- #{failing_users.join(\"\\n\\t- \")}\"\n end\n else\n it \"(input as '#{tmp_users.join(\"', '\")}') were not found on this system\" do\n expect(tmp_users_existing).to be_empty\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258047.rb" + }, + "title": "RHEL 8 must automatically expire temporary accounts within 72 hours.", + "desc": "Temporary accounts are privileged or nonprivileged accounts that are\n established during pressing circumstances, such as new software or hardware\n configuration or an incident response, where the need for prompt account\n activation requires bypassing normal account authorization procedures.\n\n If any inactive temporary accounts are left enabled on the system and are\n not either manually removed or automatically expired within 72 hours, the\n security posture of the system will be degraded and exposed to exploitation\n by unauthorized users or insider threat actors.\n\n Temporary accounts are different from emergency accounts. Emergency accounts,\n also known as \"last resort\" or \"break glass\" accounts, are local logon accounts\n enabled on the system for emergency use by authorized system administrators\n to manage a system when standard logon methods are failing or not available.\n\n Emergency accounts are not subject to manual removal or scheduled expiration\n requirements.\n\n The automatic expiration of temporary accounts may be extended as needed by\n the circumstances but it must not be extended indefinitely. A documented\n permanent account should be established for privileged users who need long-term\n maintenance accounts.", + "descriptions": { + "default": "Temporary accounts are privileged or nonprivileged accounts that are\n established during pressing circumstances, such as new software or hardware\n configuration or an incident response, where the need for prompt account\n activation requires bypassing normal account authorization procedures.\n\n If any inactive temporary accounts are left enabled on the system and are\n not either manually removed or automatically expired within 72 hours, the\n security posture of the system will be degraded and exposed to exploitation\n by unauthorized users or insider threat actors.\n\n Temporary accounts are different from emergency accounts. Emergency accounts,\n also known as \"last resort\" or \"break glass\" accounts, are local logon accounts\n enabled on the system for emergency use by authorized system administrators\n to manage a system when standard logon methods are failing or not available.\n\n Emergency accounts are not subject to manual removal or scheduled expiration\n requirements.\n\n The automatic expiration of temporary accounts may be extended as needed by\n the circumstances but it must not be extended indefinitely. A documented\n permanent account should be established for privileged users who need long-term\n maintenance accounts.", + "check": "Verify temporary accounts have been provisioned with an\n expiration date of 72 hours.\n\n For every existing temporary account, run the following command to obtain its\n account expiration information:\n\n $ sudo chage -l | grep -i \"account expires\"\n\n Verify each of these accounts has an expiration date set within 72 hours.\n\n If any temporary accounts have no expiration date set or do not expire within\n 72 hours, this is a finding.", + "fix": "Configure the operating system to expire temporary accounts after\n 72 hours with the following command:\n\n $ sudo chage -E $(date -d +3days +%Y-%m-%d) " + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000123-GPOS-00064", + "gid": "V-230374", + "rid": "SV-258047r903129_rule", + "stig_id": "RHEL-08-020270", + "fix_id": "F-33018r902730_fix", + "cci": [ + "CCI-001682" + ], + "nist": [ + "AC-2 (2)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258048", + "code": "control 'SV-258048' do\n title 'All RHEL 9 interactive users must have a primary group that exists.'\n desc 'If a user is assigned the Group Identifier (GID) of a group that does not exist on the system, and a group with the GID is subsequently created, the user may have unintended rights to any files associated with the group.'\n desc 'check', 'Verify that all RHEL 9 interactive users have a valid GID.\n\nCheck that the interactive users have a valid GID with the following command:\n \n$ sudo pwck -qr \n \nIf the system has any interactive users with duplicate GIDs, this is a finding.'\n desc 'fix', %q(Configure the system so that all GIDs are referenced in \"/etc/passwd\" are defined in \"/etc/group\".\n\nEdit the file \"/etc/passwd\" and ensure that every user's GID is a valid GID.)\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61789r926129_chk'\n tag severity: 'medium'\n tag gid: 'V-258048'\n tag rid: 'SV-258048r926131_rule'\n tag stig_id: 'RHEL-09-411045'\n tag gtitle: 'SRG-OS-000104-GPOS-00051'\n tag fix_id: 'F-61713r926130_fix'\n tag 'documentable'\n tag cci: ['CCI-000764']\n tag nist: ['IA-2']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258048.rb" + }, + "title": "All RHEL 9 interactive users must have a primary group that exists.", + "desc": "If a user is assigned the Group Identifier (GID) of a group that does not exist on the system, and a group with the GID is subsequently created, the user may have unintended rights to any files associated with the group.", + "descriptions": { + "default": "If a user is assigned the Group Identifier (GID) of a group that does not exist on the system, and a group with the GID is subsequently created, the user may have unintended rights to any files associated with the group.", + "check": "Verify that all RHEL 9 interactive users have a valid GID.\n\nCheck that the interactive users have a valid GID with the following command:\n \n$ sudo pwck -qr \n \nIf the system has any interactive users with duplicate GIDs, this is a finding.", + "fix": "Configure the system so that all GIDs are referenced in \"/etc/passwd\" are defined in \"/etc/group\".\n\nEdit the file \"/etc/passwd\" and ensure that every user's GID is a valid GID." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61789r926129_chk", + "severity": "medium", + "gid": "V-258048", + "rid": "SV-258048r926131_rule", + "stig_id": "RHEL-09-411045", + "gtitle": "SRG-OS-000104-GPOS-00051", + "fix_id": "F-61713r926130_fix", + "documentable": null, + "cci": [ + "CCI-000764" + ], + "nist": [ + "IA-2" + ] + } + }, + { + "id": "SV-258049", + "code": "control 'SV-258049' do\n title 'RHEL 8 account identifiers (individuals, groups, roles, and devices)\n must be disabled after 35 days of inactivity.'\n desc 'Inactive identifiers pose a risk to systems and applications because\n attackers may exploit an inactive identifier and potentially obtain undetected\n access to the system. Owners of inactive accounts will not notice if\n unauthorized access to their user account has been obtained.\n\n RHEL 8 needs to track periods of inactivity and disable application\n identifiers after 35 days of inactivity.'\n desc 'check', 'Verify the account identifiers (individuals, groups, roles, and devices)\n are disabled after 35 days of inactivity with the following command:\n\n Check the account inactivity value by performing the following command:\n\n $ sudo grep -i inactive /etc/default/useradd\n\n INACTIVE=35\n\n If \"INACTIVE\" is set to \"-1\", a value greater than \"35\", or is\n commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to disable account identifiers after 35 days of inactivity\n after the password expiration.\n\n Run the following command to change the configuration for useradd:\n\n $ sudo useradd -D -f 35\n\n DoD recommendation is 35 days, but a lower value is acceptable. The value \"-1\" will\n disable this feature, and \"0\" will disable the account immediately after the\n password expires.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000118-GPOS-00060'\n tag gid: 'V-230373'\n tag rid: 'SV-258049r627750_rule'\n tag stig_id: 'RHEL-08-020260'\n tag fix_id: 'F-33017r567866_fix'\n tag cci: ['CCI-000795']\n tag nist: ['IA-4 e']\n tag 'host'\n tag 'container'\n\n days_of_inactivity = input('days_of_inactivity')\n\n describe 'Useradd configuration' do\n useradd_config = parse_config_file('/etc/default/useradd')\n\n context 'when INACTIVE is set' do\n it 'should exist' do\n expect(useradd_config.params).to include('INACTIVE')\n end\n\n it 'should not be nil' do\n expect(useradd_config.params['INACTIVE']).not_to be_nil\n end\n\n it 'should have INACTIVE greater than or equal to 0' do\n expect(useradd_config.params['INACTIVE'].to_i).to be >= 0\n end\n\n it 'should have INACTIVE less than or equal to days_of_inactivity' do\n expect(useradd_config.params['INACTIVE'].to_i).to be <= days_of_inactivity\n end\n\n it 'should not have INACTIVE equal to -1' do\n expect(useradd_config.params['INACTIVE']).not_to eq '-1'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258049.rb" + }, + "title": "RHEL 8 account identifiers (individuals, groups, roles, and devices)\n must be disabled after 35 days of inactivity.", + "desc": "Inactive identifiers pose a risk to systems and applications because\n attackers may exploit an inactive identifier and potentially obtain undetected\n access to the system. Owners of inactive accounts will not notice if\n unauthorized access to their user account has been obtained.\n\n RHEL 8 needs to track periods of inactivity and disable application\n identifiers after 35 days of inactivity.", + "descriptions": { + "default": "Inactive identifiers pose a risk to systems and applications because\n attackers may exploit an inactive identifier and potentially obtain undetected\n access to the system. Owners of inactive accounts will not notice if\n unauthorized access to their user account has been obtained.\n\n RHEL 8 needs to track periods of inactivity and disable application\n identifiers after 35 days of inactivity.", + "check": "Verify the account identifiers (individuals, groups, roles, and devices)\n are disabled after 35 days of inactivity with the following command:\n\n Check the account inactivity value by performing the following command:\n\n $ sudo grep -i inactive /etc/default/useradd\n\n INACTIVE=35\n\n If \"INACTIVE\" is set to \"-1\", a value greater than \"35\", or is\n commented out, this is a finding.", + "fix": "Configure RHEL 8 to disable account identifiers after 35 days of inactivity\n after the password expiration.\n\n Run the following command to change the configuration for useradd:\n\n $ sudo useradd -D -f 35\n\n DoD recommendation is 35 days, but a lower value is acceptable. The value \"-1\" will\n disable this feature, and \"0\" will disable the account immediately after the\n password expires." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000118-GPOS-00060", + "gid": "V-230373", + "rid": "SV-258049r627750_rule", + "stig_id": "RHEL-08-020260", + "fix_id": "F-33017r567866_fix", + "cci": [ + "CCI-000795" + ], + "nist": [ + "IA-4 e" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258050", + "code": "control 'SV-258050' do\n title 'Executable search paths within the initialization files of all local\ninteractive RHEL 8 users must only contain paths that resolve to the system\ndefault or the users home directory.'\n desc \"The executable search path (typically the PATH environment variable)\ncontains a list of directories for the shell to search to find executables. If\nthis path includes the current working directory (other than the user's home\ndirectory), executables in these directories may be executed instead of system\ncommands. This variable is formatted as a colon-separated list of directories.\nIf there is an empty entry, such as a leading or trailing colon or two\nconsecutive colons, this is interpreted as the current working directory. If\ndeviations from the default system search path for the local interactive user\nare required, they must be documented with the Information System Security\nOfficer (ISSO).\"\n desc 'check', 'Verify that all local interactive user initialization file executable search path statements do not contain statements that will reference a working directory other than user home directories with the following commands:\n\n$ sudo grep -i path= /home/*/.*\n\n/home/[localinteractiveuser]/.bash_profile:PATH=$PATH:$HOME/.local/bin:$HOME/bin\n\nIf any local interactive user initialization files have executable search path statements that include directories outside of their home directory and is not documented with the ISSO as an operational requirement, this is a finding.'\n desc 'fix', 'Edit the local interactive user initialization files to change any PATH\nvariable statements that reference directories other than their home directory.\n\n If a local interactive user requires path variables to reference a\ndirectory owned by the application, it must be documented with the ISSO.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230317'\n tag rid: 'SV-258050r792896_rule'\n tag stig_id: 'RHEL-08-010690'\n tag fix_id: 'F-32961r567698_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n ignore_shells = input('non_interactive_shells').join('|')\n\n findings = {}\n users.where { !shell.match(ignore_shells) && (uid >= 1000 || uid.zero?) }.entries.each do |user_info|\n next if input('exempt_home_users').include?(user_info.username.to_s)\n\n grep_results = command(\"grep -i path= --exclude=\\\".bash_history\\\" #{user_info.home}/.*\").stdout.split(\"\\n\")\n grep_results.each do |result|\n result.slice! 'PATH='\n # Case when last value in exec search path is :\n result += ' ' if result[-1] == ':'\n result.slice! '$PATH:'\n result.gsub! '=\"', '=' # account for cases where path is set to equal a quote-wrapped statement\n result.gsub! '$HOME', user_info.home.to_s\n result.gsub! '~', user_info.home.to_s\n result.gsub! ':$PATH', '' # remove $PATH if it shows up at the end of line\n line_arr = result.split(':')\n line_arr.delete_at(0)\n line_arr.each do |line|\n line = line.strip\n\n # Don't run test on line that exports PATH and is not commented out\n next unless !line.start_with?('export') && !line.start_with?('#')\n\n # Case when :: found in exec search path or : found at beginning\n if line.strip.empty?\n curr_work_dir = command('pwd').stdout.delete(\"\\n\")\n line = curr_work_dir if curr_work_dir.start_with?(user_info.home.to_s) || curr_work_dir[]\n end\n\n # catch a leading '\"'\n line = line[1..line.length] if line.start_with?('\"')\n\n # This will fail if non-home directory found in path\n next if line.start_with?(user_info.home)\n\n # we want a hash of usernames as the keys and arrays of failing lines as values\n findings[user_info.username] = if findings[user_info.username]\n findings[user_info.username] << line\n else\n [line]\n end\n end\n end\n end\n\n describe 'Initialization files' do\n it \"should not include executable search paths that include directories outside the respective user's home directory\" do\n expect(findings).to be_empty, \"Users with non-homedir paths assigned to their PATH environment variable:\\n\\t#{findings}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258050.rb" + }, + "title": "Executable search paths within the initialization files of all local\ninteractive RHEL 8 users must only contain paths that resolve to the system\ndefault or the users home directory.", + "desc": "The executable search path (typically the PATH environment variable)\ncontains a list of directories for the shell to search to find executables. If\nthis path includes the current working directory (other than the user's home\ndirectory), executables in these directories may be executed instead of system\ncommands. This variable is formatted as a colon-separated list of directories.\nIf there is an empty entry, such as a leading or trailing colon or two\nconsecutive colons, this is interpreted as the current working directory. If\ndeviations from the default system search path for the local interactive user\nare required, they must be documented with the Information System Security\nOfficer (ISSO).", + "descriptions": { + "default": "The executable search path (typically the PATH environment variable)\ncontains a list of directories for the shell to search to find executables. If\nthis path includes the current working directory (other than the user's home\ndirectory), executables in these directories may be executed instead of system\ncommands. This variable is formatted as a colon-separated list of directories.\nIf there is an empty entry, such as a leading or trailing colon or two\nconsecutive colons, this is interpreted as the current working directory. If\ndeviations from the default system search path for the local interactive user\nare required, they must be documented with the Information System Security\nOfficer (ISSO).", + "check": "Verify that all local interactive user initialization file executable search path statements do not contain statements that will reference a working directory other than user home directories with the following commands:\n\n$ sudo grep -i path= /home/*/.*\n\n/home/[localinteractiveuser]/.bash_profile:PATH=$PATH:$HOME/.local/bin:$HOME/bin\n\nIf any local interactive user initialization files have executable search path statements that include directories outside of their home directory and is not documented with the ISSO as an operational requirement, this is a finding.", + "fix": "Edit the local interactive user initialization files to change any PATH\nvariable statements that reference directories other than their home directory.\n\n If a local interactive user requires path variables to reference a\ndirectory owned by the application, it must be documented with the ISSO." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230317", + "rid": "SV-258050r792896_rule", + "stig_id": "RHEL-08-010690", + "fix_id": "F-32961r567698_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258051", + "code": "control 'SV-258051' do\n title 'All RHEL 8 local interactive users must have a home directory assigned\nin the /etc/passwd file.'\n desc 'If local interactive users are not assigned a valid home directory,\nthere is no place for the storage and control of files they should own.'\n desc 'check', \"Verify local interactive users on RHEL 8 have a home directory assigned\nwith the following command:\n\n $ sudo pwck -r\n\n user 'lp': directory '/var/spool/lpd' does not exist\n user 'news': directory '/var/spool/news' does not exist\n user 'uucp': directory '/var/spool/uucp' does not exist\n user 'www-data': directory '/var/www' does not exist\n\n Ask the System Administrator (SA) if any users found without home\ndirectories are local interactive users. If the SA is unable to provide a\nresponse, check for users with a User Identifier (UID) of 1000 or greater with\nthe following command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1, $3, $6}' /etc/passwd\n\n If any interactive users do not have a home directory assigned, this is a\nfinding.\"\n desc 'fix', 'Assign home directories to all local interactive users on RHEL\n8 that currently do not have a home directory assigned.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230320'\n tag rid: 'SV-258051r627750_rule'\n tag stig_id: 'RHEL-08-010720'\n tag fix_id: 'F-32964r567707_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n exempt_users = input('exempt_home_users')\n ignore_shells = input('non_interactive_shells').join('|')\n actvite_users_without_homedir = users.where { !shell.match(ignore_shells) && home.nil? }.entries\n\n # only_if(\"This control is Not Applicable since no 'non-exempt' users were found\", impact: 0.0) { !active_home.empty? }\n\n describe 'All non-exempt users' do\n it 'have an assinded home directory that exists' do\n failure_message = \"The following users do not have an assigned home directory: #{actvite_users_without_homedir.join(', ')}\"\n expect(actvite_users_without_homedir).to be_empty, failure_message\n end\n end\n describe 'Note: `exempt_home_users` skipped user' do\n exempt_users.each do |u|\n next if exempt_users.empty?\n\n it u.to_s do\n expect(user(u).username).to be_truthy.or be_nil\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258051.rb" + }, + "title": "All RHEL 8 local interactive users must have a home directory assigned\nin the /etc/passwd file.", + "desc": "If local interactive users are not assigned a valid home directory,\nthere is no place for the storage and control of files they should own.", + "descriptions": { + "default": "If local interactive users are not assigned a valid home directory,\nthere is no place for the storage and control of files they should own.", + "check": "Verify local interactive users on RHEL 8 have a home directory assigned\nwith the following command:\n\n $ sudo pwck -r\n\n user 'lp': directory '/var/spool/lpd' does not exist\n user 'news': directory '/var/spool/news' does not exist\n user 'uucp': directory '/var/spool/uucp' does not exist\n user 'www-data': directory '/var/www' does not exist\n\n Ask the System Administrator (SA) if any users found without home\ndirectories are local interactive users. If the SA is unable to provide a\nresponse, check for users with a User Identifier (UID) of 1000 or greater with\nthe following command:\n\n $ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1, $3, $6}' /etc/passwd\n\n If any interactive users do not have a home directory assigned, this is a\nfinding.", + "fix": "Assign home directories to all local interactive users on RHEL\n8 that currently do not have a home directory assigned." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230320", + "rid": "SV-258051r627750_rule", + "stig_id": "RHEL-08-010720", + "fix_id": "F-32964r567707_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258052", + "code": "control 'SV-258052' do\n title 'All RHEL 8 local interactive user home directories defined in the\n/etc/passwd file must exist.'\n desc 'If a local interactive user has a home directory defined that does not\nexist, the user may be given access to the \"/\" directory as the current\nworking directory upon logon. This could create a denial of service because the\nuser would not be able to access their logon configuration files, and it may\ngive them visibility to system files they normally would not be able to access.'\n desc 'check', %q(Verify the assigned home directory of all local interactive users on RHEL 8\nexists with the following command:\n\n $ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}'\n/etc/passwd)\n\n drwxr-xr-x 2 smithj admin 4096 Jun 5 12:41 smithj\n\n Note: This may miss interactive users that have been assigned a privileged\nUser ID (UID). Evidence of interactive use may be obtained from a number of log\nfiles containing system logon information.\n\n Check that all referenced home directories exist with the following command:\n\n $ sudo pwck -r\n\n user 'smithj': directory '/home/smithj' does not exist\n\n If any home directories referenced in \"/etc/passwd\" are returned as not\ndefined, this is a finding.)\n desc 'fix', 'Create home directories to all local interactive users that currently do\nnot have a home directory assigned. Use the following commands to create the\nuser home directory assigned in \"/etc/ passwd\":\n\n Note: The example will be for the user smithj, who has a home directory of\n\"/home/smithj\", a UID of \"smithj\", and a Group Identifier (GID) of \"users\nassigned\" in \"/etc/passwd\".\n\n $ sudo mkdir /home/smithj\n $ sudo chown smithj /home/smithj\n $ sudo chgrp users /home/smithj\n $ sudo chmod 0750 /home/smithj'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230323'\n tag rid: 'SV-258052r627750_rule'\n tag stig_id: 'RHEL-08-010750'\n tag fix_id: 'F-32967r567716_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n exempt_home_users = input('exempt_home_users')\n uid_min = login_defs.read_params['UID_MIN'].to_i\n uid_min = 1000 if uid_min.nil?\n\n iuser_entries = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) }\n\n if !iuser_entries.users.nil? && !iuser_entries.users.empty?\n failing_homedirs = iuser_entries.homes.reject { |home|\n file(home).exist?\n }\n describe 'All non-exempt interactive user account home directories on the system' do\n it 'should exist' do\n expect(failing_homedirs).to be_empty, \"Failing home directories:\\n\\t- #{failing_homedirs.join(\"\\n\\t- \")}\"\n end\n end\n else\n describe 'No non-exempt interactive user accounts' do\n it 'were detected on the system' do\n expect(true).to eq(true)\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258052.rb" + }, + "title": "All RHEL 8 local interactive user home directories defined in the\n/etc/passwd file must exist.", + "desc": "If a local interactive user has a home directory defined that does not\nexist, the user may be given access to the \"/\" directory as the current\nworking directory upon logon. This could create a denial of service because the\nuser would not be able to access their logon configuration files, and it may\ngive them visibility to system files they normally would not be able to access.", + "descriptions": { + "default": "If a local interactive user has a home directory defined that does not\nexist, the user may be given access to the \"/\" directory as the current\nworking directory upon logon. This could create a denial of service because the\nuser would not be able to access their logon configuration files, and it may\ngive them visibility to system files they normally would not be able to access.", + "check": "Verify the assigned home directory of all local interactive users on RHEL 8\nexists with the following command:\n\n $ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}'\n/etc/passwd)\n\n drwxr-xr-x 2 smithj admin 4096 Jun 5 12:41 smithj\n\n Note: This may miss interactive users that have been assigned a privileged\nUser ID (UID). Evidence of interactive use may be obtained from a number of log\nfiles containing system logon information.\n\n Check that all referenced home directories exist with the following command:\n\n $ sudo pwck -r\n\n user 'smithj': directory '/home/smithj' does not exist\n\n If any home directories referenced in \"/etc/passwd\" are returned as not\ndefined, this is a finding.", + "fix": "Create home directories to all local interactive users that currently do\nnot have a home directory assigned. Use the following commands to create the\nuser home directory assigned in \"/etc/ passwd\":\n\n Note: The example will be for the user smithj, who has a home directory of\n\"/home/smithj\", a UID of \"smithj\", and a Group Identifier (GID) of \"users\nassigned\" in \"/etc/passwd\".\n\n $ sudo mkdir /home/smithj\n $ sudo chown smithj /home/smithj\n $ sudo chgrp users /home/smithj\n $ sudo chmod 0750 /home/smithj" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230323", + "rid": "SV-258052r627750_rule", + "stig_id": "RHEL-08-010750", + "fix_id": "F-32967r567716_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258053", + "code": "control 'SV-258053' do\n title 'All RHEL 8 local interactive user home directories must be group-owned\nby the home directory owner’s primary group.'\n desc 'If the Group Identifier (GID) of a local interactive user’s home\ndirectory is not the same as the primary GID of the user, this would allow\nunauthorized access to the user’s files, and users that share the same group\nmay not be able to access files that they legitimately should.'\n desc 'check', %q(Verify the assigned home directory of all local interactive users is group-owned by that user’s primary GID with the following command:\n\nNote: This may miss local interactive users that have been assigned a privileged UID. Evidence of interactive use may be obtained from a number of log files containing system logon information. The returned directory \"/home/smithj\" is used as an example.\n\n $ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd)\n\n drwxr-x--- 2 smithj admin 4096 Jun 5 12:41 smithj\n\nCheck the user's primary group with the following command:\n\n $ sudo grep $(grep smithj /etc/passwd | awk -F: '{print $4}') /etc/group\n\n admin:x:250:smithj,jonesj,jacksons\n\nIf the user home directory referenced in \"/etc/passwd\" is not group-owned by that user’s primary GID, this is a finding.)\n desc 'fix', 'Change the group owner of a local interactive user’s home directory to the\ngroup found in \"/etc/passwd\". To change the group owner of a local\ninteractive user’s home directory, use the following command:\n\n Note: The example will be for the user \"smithj\", who has a home directory\nof \"/home/smithj\", and has a primary group of users.\n\n $ sudo chgrp users /home/smithj'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230322'\n tag rid: 'SV-258053r880717_rule'\n tag stig_id: 'RHEL-08-010740'\n tag fix_id: 'F-32966r880716_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n exempt_home_users = input('exempt_home_users')\n uid_min = login_defs.read_params['UID_MIN'].to_i\n uid_min = 1000 if uid_min.nil?\n\n iuser_entries = passwd.where { uid.to_i >= uid_min && shell !~ /nologin/ && !exempt_home_users.include?(user) }\n\n if !iuser_entries.users.nil? && !iuser_entries.users.empty?\n failing_iusers = iuser_entries.entries.reject { |iu|\n file(iu['home']).gid == iu.gid.to_i\n }\n failing_homedirs = failing_iusers.map { |iu| iu['home'] }\n\n describe 'All non-exempt interactive user account home directories on the system' do\n it 'should be group-owned by the group of the user they are associated with' do\n expect(failing_homedirs).to be_empty, \"Failing home directories:\\n\\t- #{failing_homedirs.join(\"\\n\\t- \")}\"\n end\n end\n else\n describe 'No non-exempt interactive user accounts' do\n it 'were detected on the system' do\n expect(true).to eq(true)\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258053.rb" + }, + "title": "All RHEL 8 local interactive user home directories must be group-owned\nby the home directory owner’s primary group.", + "desc": "If the Group Identifier (GID) of a local interactive user’s home\ndirectory is not the same as the primary GID of the user, this would allow\nunauthorized access to the user’s files, and users that share the same group\nmay not be able to access files that they legitimately should.", + "descriptions": { + "default": "If the Group Identifier (GID) of a local interactive user’s home\ndirectory is not the same as the primary GID of the user, this would allow\nunauthorized access to the user’s files, and users that share the same group\nmay not be able to access files that they legitimately should.", + "check": "Verify the assigned home directory of all local interactive users is group-owned by that user’s primary GID with the following command:\n\nNote: This may miss local interactive users that have been assigned a privileged UID. Evidence of interactive use may be obtained from a number of log files containing system logon information. The returned directory \"/home/smithj\" is used as an example.\n\n $ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd)\n\n drwxr-x--- 2 smithj admin 4096 Jun 5 12:41 smithj\n\nCheck the user's primary group with the following command:\n\n $ sudo grep $(grep smithj /etc/passwd | awk -F: '{print $4}') /etc/group\n\n admin:x:250:smithj,jonesj,jacksons\n\nIf the user home directory referenced in \"/etc/passwd\" is not group-owned by that user’s primary GID, this is a finding.", + "fix": "Change the group owner of a local interactive user’s home directory to the\ngroup found in \"/etc/passwd\". To change the group owner of a local\ninteractive user’s home directory, use the following command:\n\n Note: The example will be for the user \"smithj\", who has a home directory\nof \"/home/smithj\", and has a primary group of users.\n\n $ sudo chgrp users /home/smithj" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230322", + "rid": "SV-258053r880717_rule", + "stig_id": "RHEL-08-010740", + "fix_id": "F-32966r880716_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258054", + "code": "control 'SV-258054' do\n title 'RHEL 8 must automatically lock an account when three unsuccessful\nlogon attempts occur.'\n desc 'By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.'\n desc 'check', %q(Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured to lock an\naccount after three unsuccessful logon attempts:\n\n $ sudo grep 'deny =' /etc/security/faillock.conf\n\n deny = 3\n\n If the \"deny\" option is not set to \"3\" or less (but not \"0\"), is\nmissing or commented out, this is a finding.)\n desc 'fix', 'Configure the operating system to lock an account when three unsuccessful\nlogon attempts occur.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n deny = 3'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128']\n tag gid: 'V-230333'\n tag rid: 'SV-258054r743966_rule'\n tag stig_id: 'RHEL-08-020011'\n tag fix_id: 'F-32977r743965_fix'\n tag cci: ['CCI-000044']\n tag nist: ['AC-7 a']\n tag 'host'\n tag 'container'\n\n only_if('This check applies to RHEL version 8.2 and later. If the system is not RHEL version 8.2 or newer, this check is Not Applicable.', impact: 0.0) {\n (os.release.to_f) >= 8.2\n }\n\n describe parse_config_file('/etc/security/faillock.conf') do\n its('deny') { should cmp <= input('unsuccessful_attempts') }\n its('deny') { should_not cmp 0 }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258054.rb" + }, + "title": "RHEL 8 must automatically lock an account when three unsuccessful\nlogon attempts occur.", + "desc": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "check": "Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured to lock an\naccount after three unsuccessful logon attempts:\n\n $ sudo grep 'deny =' /etc/security/faillock.conf\n\n deny = 3\n\n If the \"deny\" option is not set to \"3\" or less (but not \"0\"), is\nmissing or commented out, this is a finding.", + "fix": "Configure the operating system to lock an account when three unsuccessful\nlogon attempts occur.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n deny = 3" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000021-GPOS-00005", + "satisfies": [ + "SRG-OS-000021-GPOS-00005", + "SRG-OS-000329-GPOS-00128" + ], + "gid": "V-230333", + "rid": "SV-258054r743966_rule", + "stig_id": "RHEL-08-020011", + "fix_id": "F-32977r743965_fix", + "cci": [ + "CCI-000044" + ], + "nist": [ + "AC-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258055", + "code": "control 'SV-258055' do\n title 'RHEL 9 must automatically lock the root account until the root account is released by an administrator when three unsuccessful logon attempts occur during a 15-minute time period.'\n desc 'By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, also known as brute-forcing, is reduced. Limits are imposed by locking the account.\n\n'\n desc 'check', 'Verify RHEL 9 is configured to lock the root account after three unsuccessful logon attempts with the command:\n\n$ grep even_deny_root /etc/security/faillock.conf\n\neven_deny_root\n\nIf the \"even_deny_root\" option is not set, is missing or commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to lock out the \"root\" account after a number of incorrect login attempts using \"pam_faillock.so\", first enable the feature using the following command:\n \n$ sudo authselect enable-feature with-faillock \n\n Then edit the \"/etc/security/faillock.conf\" file as follows:\n \n add or uncomment the following line:\n even_deny_root'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61796r926150_chk'\n tag severity: 'medium'\n tag gid: 'V-258055'\n tag rid: 'SV-258055r926152_rule'\n tag stig_id: 'RHEL-09-411080'\n tag gtitle: 'SRG-OS-000329-GPOS-00128'\n tag fix_id: 'F-61720r926151_fix'\n tag satisfies: ['SRG-OS-000329-GPOS-00128', 'SRG-OS-000021-GPOS-00005']\n tag 'documentable'\n tag cci: ['CCI-000044', 'CCI-002238']\n tag nist: ['AC-7 a', 'AC-7 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258055.rb" + }, + "title": "RHEL 9 must automatically lock the root account until the root account is released by an administrator when three unsuccessful logon attempts occur during a 15-minute time period.", + "desc": "By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, also known as brute-forcing, is reduced. Limits are imposed by locking the account.\n\n", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, also known as brute-forcing, is reduced. Limits are imposed by locking the account.\n\n", + "check": "Verify RHEL 9 is configured to lock the root account after three unsuccessful logon attempts with the command:\n\n$ grep even_deny_root /etc/security/faillock.conf\n\neven_deny_root\n\nIf the \"even_deny_root\" option is not set, is missing or commented out, this is a finding.", + "fix": "Configure RHEL 9 to lock out the \"root\" account after a number of incorrect login attempts using \"pam_faillock.so\", first enable the feature using the following command:\n \n$ sudo authselect enable-feature with-faillock \n\n Then edit the \"/etc/security/faillock.conf\" file as follows:\n \n add or uncomment the following line:\n even_deny_root" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61796r926150_chk", + "severity": "medium", + "gid": "V-258055", + "rid": "SV-258055r926152_rule", + "stig_id": "RHEL-09-411080", + "gtitle": "SRG-OS-000329-GPOS-00128", + "fix_id": "F-61720r926151_fix", + "satisfies": [ + "SRG-OS-000329-GPOS-00128", + "SRG-OS-000021-GPOS-00005" + ], + "documentable": null, + "cci": [ + "CCI-000044", + "CCI-002238" + ], + "nist": [ + "AC-7 a", + "AC-7 b" + ] + } + }, + { + "id": "SV-258056", + "code": "control 'SV-258056' do\n title 'RHEL 8 must automatically lock an account when three unsuccessful\nlogon attempts occur during a 15-minute time period.'\n desc 'By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.'\n desc 'check', %q(Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured to lock an\naccount after three unsuccessful logon attempts within 15 minutes:\n\n $ sudo grep 'fail_interval =' /etc/security/faillock.conf\n\n fail_interval = 900\n\n If the \"fail_interval\" option is not set to \"900\" or more, is missing\nor commented out, this is a finding.)\n desc 'fix', 'Configure the operating system to lock an account when three unsuccessful\nlogon attempts occur in 15 minutes.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n fail_interval = 900'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128']\n tag gid: 'V-230335'\n tag rid: 'SV-258056r743969_rule'\n tag stig_id: 'RHEL-08-020013'\n tag fix_id: 'F-32979r743968_fix'\n tag cci: ['CCI-000044']\n tag nist: ['AC-7 a']\n tag 'host'\n tag 'container'\n\n only_if('This check applies to RHEL versions 8.2 or newer, if the system is RHEL version 8.0 or 8.1, this check is not applicable.', impact: 0.0) {\n (os.release.to_f) >= 8.2\n }\n\n describe parse_config_file(input('security_faillock_conf')) do\n its('fail_interval') { should cmp >= input('fail_interval') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258056.rb" + }, + "title": "RHEL 8 must automatically lock an account when three unsuccessful\nlogon attempts occur during a 15-minute time period.", + "desc": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "check": "Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured to lock an\naccount after three unsuccessful logon attempts within 15 minutes:\n\n $ sudo grep 'fail_interval =' /etc/security/faillock.conf\n\n fail_interval = 900\n\n If the \"fail_interval\" option is not set to \"900\" or more, is missing\nor commented out, this is a finding.", + "fix": "Configure the operating system to lock an account when three unsuccessful\nlogon attempts occur in 15 minutes.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n fail_interval = 900" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000021-GPOS-00005", + "satisfies": [ + "SRG-OS-000021-GPOS-00005", + "SRG-OS-000329-GPOS-00128" + ], + "gid": "V-230335", + "rid": "SV-258056r743969_rule", + "stig_id": "RHEL-08-020013", + "fix_id": "F-32979r743968_fix", + "cci": [ + "CCI-000044" + ], + "nist": [ + "AC-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258057", + "code": "control 'SV-258057' do\n title 'RHEL 9 must maintain an account lock until the locked account is released by an administrator.'\n desc 'By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.\n\n'\n desc 'check', %q(Verify RHEL 9 is configured to lock an account until released by an administrator after three unsuccessful logon attempts with the command:\n\n$ grep 'unlock_time =' /etc/security/faillock.conf\n\nunlock_time = 0\n\nIf the \"unlock_time\" option is not set to \"0\", the line is missing, or commented out, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to lock an account until released by an administrator after three unsuccessful logon attempts with the command:\n \n$ authselect enable-feature with-faillock \n\nThen edit the \"/etc/security/faillock.conf\" file as follows:\n\nunlock_time = 0'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61798r926156_chk'\n tag severity: 'medium'\n tag gid: 'V-258057'\n tag rid: 'SV-258057r926158_rule'\n tag stig_id: 'RHEL-09-411090'\n tag gtitle: 'SRG-OS-000329-GPOS-00128'\n tag fix_id: 'F-61722r926157_fix'\n tag satisfies: ['SRG-OS-000329-GPOS-00128', 'SRG-OS-000021-GPOS-00005']\n tag 'documentable'\n tag cci: ['CCI-000044', 'CCI-002238']\n tag nist: ['AC-7 a', 'AC-7 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258057.rb" + }, + "title": "RHEL 9 must maintain an account lock until the locked account is released by an administrator.", + "desc": "By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.\n\n", + "descriptions": { + "default": "By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.\n\n", + "check": "Verify RHEL 9 is configured to lock an account until released by an administrator after three unsuccessful logon attempts with the command:\n\n$ grep 'unlock_time =' /etc/security/faillock.conf\n\nunlock_time = 0\n\nIf the \"unlock_time\" option is not set to \"0\", the line is missing, or commented out, this is a finding.", + "fix": "Configure RHEL 9 to lock an account until released by an administrator after three unsuccessful logon attempts with the command:\n \n$ authselect enable-feature with-faillock \n\nThen edit the \"/etc/security/faillock.conf\" file as follows:\n\nunlock_time = 0" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61798r926156_chk", + "severity": "medium", + "gid": "V-258057", + "rid": "SV-258057r926158_rule", + "stig_id": "RHEL-09-411090", + "gtitle": "SRG-OS-000329-GPOS-00128", + "fix_id": "F-61722r926157_fix", + "satisfies": [ + "SRG-OS-000329-GPOS-00128", + "SRG-OS-000021-GPOS-00005" + ], + "documentable": null, + "cci": [ + "CCI-000044", + "CCI-002238" + ], + "nist": [ + "AC-7 a", + "AC-7 b" + ] + } + }, + { + "id": "SV-258058", + "code": "control 'SV-258058' do\n title 'RHEL 8 must not have unnecessary accounts.'\n desc 'Accounts providing no operational purpose provide additional\nopportunities for system compromise. Unnecessary accounts include user accounts\nfor individuals not requiring access to the system and application accounts for\napplications not installed on the system.'\n desc 'check', 'Verify all accounts on the system are assigned to an active system,\napplication, or user account.\n\n Obtain the list of authorized system accounts from the Information System\nSecurity Officer (ISSO).\n\n Check the system accounts on the system with the following command:\n\n $ sudo more /etc/passwd\n\n root:x:0:0:root:/root:/bin/bash\n bin:x:1:1:bin:/bin:/sbin/nologin\n daemon:x:2:2:daemon:/sbin:/sbin/nologin\n sync:x:5:0:sync:/sbin:/bin/sync\n shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown\n halt:x:7:0:halt:/sbin:/sbin/halt\n games:x:12:100:games:/usr/games:/sbin/nologin\n gopher:x:13:30:gopher:/var/gopher:/sbin/nologin\n\n Accounts such as \"games\" and \"gopher\" are not authorized accounts as\nthey do not support authorized system functions.\n\n If the accounts on the system do not match the provided documentation, or\naccounts that do not support an authorized system function are present, this is\na finding.'\n desc 'fix', 'Configure the system so all accounts on the system are assigned to an\nactive system, application, or user account.\n\n Remove accounts that do not support approved system activities or that\nallow for a normal user to perform administrative-level actions.\n\n Document all authorized accounts on the system.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230379'\n tag rid: 'SV-258058r627750_rule'\n tag stig_id: 'RHEL-08-020320'\n tag fix_id: 'F-33023r567884_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n failing_users = passwd.users.reject { |u| (input('known_system_accounts') + input('user_accounts')).uniq.include?(u) }\n\n describe 'All users' do\n it 'should have an explicit, authorized purpose (either a known user account or a required system account)' do\n expect(failing_users).to be_empty, \"Failing users:\\n\\t- #{failing_users.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258058.rb" + }, + "title": "RHEL 8 must not have unnecessary accounts.", + "desc": "Accounts providing no operational purpose provide additional\nopportunities for system compromise. Unnecessary accounts include user accounts\nfor individuals not requiring access to the system and application accounts for\napplications not installed on the system.", + "descriptions": { + "default": "Accounts providing no operational purpose provide additional\nopportunities for system compromise. Unnecessary accounts include user accounts\nfor individuals not requiring access to the system and application accounts for\napplications not installed on the system.", + "check": "Verify all accounts on the system are assigned to an active system,\napplication, or user account.\n\n Obtain the list of authorized system accounts from the Information System\nSecurity Officer (ISSO).\n\n Check the system accounts on the system with the following command:\n\n $ sudo more /etc/passwd\n\n root:x:0:0:root:/root:/bin/bash\n bin:x:1:1:bin:/bin:/sbin/nologin\n daemon:x:2:2:daemon:/sbin:/sbin/nologin\n sync:x:5:0:sync:/sbin:/bin/sync\n shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown\n halt:x:7:0:halt:/sbin:/sbin/halt\n games:x:12:100:games:/usr/games:/sbin/nologin\n gopher:x:13:30:gopher:/var/gopher:/sbin/nologin\n\n Accounts such as \"games\" and \"gopher\" are not authorized accounts as\nthey do not support authorized system functions.\n\n If the accounts on the system do not match the provided documentation, or\naccounts that do not support an authorized system function are present, this is\na finding.", + "fix": "Configure the system so all accounts on the system are assigned to an\nactive system, application, or user account.\n\n Remove accounts that do not support approved system activities or that\nallow for a normal user to perform administrative-level actions.\n\n Document all authorized accounts on the system." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230379", + "rid": "SV-258058r627750_rule", + "stig_id": "RHEL-08-020320", + "fix_id": "F-33023r567884_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258059", + "code": "control 'SV-258059' do\n title 'The root account must be the only account having unrestricted access\nto the RHEL 8 system.'\n desc 'If an account other than root also has a User Identifier (UID) of\n\"0\", it has root authority, giving that account unrestricted access to the\nentire operating system. Multiple accounts with a UID of \"0\" afford an\nopportunity for potential intruders to guess a password for a privileged\naccount.'\n desc 'check', %q(Check the system for duplicate UID \"0\" assignments with the following\ncommand:\n\n $ sudo awk -F: '$3 == 0 {print $1}' /etc/passwd\n\n If any accounts other than root have a UID of \"0\", this is a finding.)\n desc 'fix', 'Change the UID of any account on the system, other than root, that has a\nUID of \"0\".\n\n If the account is associated with system commands or applications, the UID\nshould be changed to one greater than \"0\" but less than \"1000\". Otherwise,\nassign a UID of greater than \"1000\" that has not already been assigned.'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230534'\n tag rid: 'SV-258059r627750_rule'\n tag stig_id: 'RHEL-08-040200'\n tag fix_id: 'F-33178r568349_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n describe passwd.uids(0) do\n its('users') { should cmp 'root' }\n its('entries.length') { should eq 1 }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258059.rb" + }, + "title": "The root account must be the only account having unrestricted access\nto the RHEL 8 system.", + "desc": "If an account other than root also has a User Identifier (UID) of\n\"0\", it has root authority, giving that account unrestricted access to the\nentire operating system. Multiple accounts with a UID of \"0\" afford an\nopportunity for potential intruders to guess a password for a privileged\naccount.", + "descriptions": { + "default": "If an account other than root also has a User Identifier (UID) of\n\"0\", it has root authority, giving that account unrestricted access to the\nentire operating system. Multiple accounts with a UID of \"0\" afford an\nopportunity for potential intruders to guess a password for a privileged\naccount.", + "check": "Check the system for duplicate UID \"0\" assignments with the following\ncommand:\n\n $ sudo awk -F: '$3 == 0 {print $1}' /etc/passwd\n\n If any accounts other than root have a UID of \"0\", this is a finding.", + "fix": "Change the UID of any account on the system, other than root, that has a\nUID of \"0\".\n\n If the account is associated with system commands or applications, the UID\nshould be changed to one greater than \"0\" but less than \"1000\". Otherwise,\nassign a UID of greater than \"1000\" that has not already been assigned." + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230534", + "rid": "SV-258059r627750_rule", + "stig_id": "RHEL-08-040200", + "fix_id": "F-33178r568349_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258060", + "code": "control 'SV-258060' do\n title 'RHEL 8 must ensure account lockouts persist.'\n desc 'By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.'\n desc 'check', %q(Note: This check applies to RHEL versions 8.2 or newer. If the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured use a\nnon-default faillock directory to ensure contents persist after reboot:\n\n $ sudo grep 'dir =' /etc/security/faillock.conf\n\n dir = /var/log/faillock\n\n If the \"dir\" option is not set to a non-default documented tally log\ndirectory, is missing or commented out, this is a finding.)\n desc 'fix', 'Configure the operating system maintain the contents of the faillock\ndirectory after a reboot.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n dir = /var/log/faillock'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128']\n tag gid: 'V-230339'\n tag rid: 'SV-258060r743975_rule'\n tag stig_id: 'RHEL-08-020017'\n tag fix_id: 'F-32983r743974_fix'\n tag cci: ['CCI-000044']\n tag nist: ['AC-7 a']\n tag 'host'\n tag 'container'\n\n only_if('This check applies to RHEL versions 8.2 or newer. If the system is RHEL version 8.0 or 8.1, this check is not applicable.', impact: 0.0) {\n (os.release.to_f) >= 8.2\n }\n\n describe parse_config_file('/etc/security/faillock.conf') do\n its('dir') { should cmp input('log_directory') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258060.rb" + }, + "title": "RHEL 8 must ensure account lockouts persist.", + "desc": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "check": "Note: This check applies to RHEL versions 8.2 or newer. If the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured use a\nnon-default faillock directory to ensure contents persist after reboot:\n\n $ sudo grep 'dir =' /etc/security/faillock.conf\n\n dir = /var/log/faillock\n\n If the \"dir\" option is not set to a non-default documented tally log\ndirectory, is missing or commented out, this is a finding.", + "fix": "Configure the operating system maintain the contents of the faillock\ndirectory after a reboot.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n dir = /var/log/faillock" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000021-GPOS-00005", + "satisfies": [ + "SRG-OS-000021-GPOS-00005", + "SRG-OS-000329-GPOS-00128" + ], + "gid": "V-230339", + "rid": "SV-258060r743975_rule", + "stig_id": "RHEL-08-020017", + "fix_id": "F-32983r743974_fix", + "cci": [ + "CCI-000044" + ], + "nist": [ + "AC-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258061", + "code": "control 'SV-258061' do\n title 'RHEL 9 groups must have unique Group ID (GID).'\n desc 'To ensure accountability and prevent unauthenticated access, groups must be identified uniquely to prevent potential misuse and compromise of the system.'\n desc 'check', 'Verify that RHEL 9 contains no duplicate GIDs for interactive users with the following command:\n \n $ cut -d : -f 3 /etc/group | uniq -d\n \nIf the system has duplicate GIDs, this is a finding.'\n desc 'fix', 'Edit the file \"/etc/group\" and provide each group that has a duplicate GID with a unique GID.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61802r926168_chk'\n tag severity: 'medium'\n tag gid: 'V-258061'\n tag rid: 'SV-258061r926170_rule'\n tag stig_id: 'RHEL-09-411110'\n tag gtitle: 'SRG-OS-000104-GPOS-00051'\n tag fix_id: 'F-61726r926169_fix'\n tag 'documentable'\n tag cci: ['CCI-000764']\n tag nist: ['IA-2']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258061.rb" + }, + "title": "RHEL 9 groups must have unique Group ID (GID).", + "desc": "To ensure accountability and prevent unauthenticated access, groups must be identified uniquely to prevent potential misuse and compromise of the system.", + "descriptions": { + "default": "To ensure accountability and prevent unauthenticated access, groups must be identified uniquely to prevent potential misuse and compromise of the system.", + "check": "Verify that RHEL 9 contains no duplicate GIDs for interactive users with the following command:\n \n $ cut -d : -f 3 /etc/group | uniq -d\n \nIf the system has duplicate GIDs, this is a finding.", + "fix": "Edit the file \"/etc/group\" and provide each group that has a duplicate GID with a unique GID." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61802r926168_chk", + "severity": "medium", + "gid": "V-258061", + "rid": "SV-258061r926170_rule", + "stig_id": "RHEL-09-411110", + "gtitle": "SRG-OS-000104-GPOS-00051", + "fix_id": "F-61726r926169_fix", + "documentable": null, + "cci": [ + "CCI-000764" + ], + "nist": [ + "IA-2" + ] + } + }, + { + "id": "SV-258062", + "code": "control 'SV-258062' do\n title 'Local RHEL 8 initialization files must not execute world-writable\nprograms.'\n desc 'If user start-up files execute world-writable programs, especially in\nunprotected directories, they could be maliciously modified to destroy user\nfiles or otherwise compromise the system at the user level. If the system is\ncompromised at the user level, it is easier to elevate privileges to eventually\ncompromise the system at the root and network level.'\n desc 'check', 'Verify that local initialization files do not execute world-writable\nprograms.\n\n Check the system for world-writable files.\n\n The following command will discover and print world-writable files. Run it\nonce for each local partition [PART]:\n\n $ sudo find [PART] -xdev -type f -perm -0002 -print\n\n For all files listed, check for their presence in the local initialization\nfiles with the following commands:\n\n Note: The example will be for a system that is configured to create user\nhome directories in the \"/home\" directory.\n\n $ sudo grep /home/*/.*\n\n If any local initialization files are found to reference world-writable\nfiles, this is a finding.'\n desc 'fix', 'Set the mode on files being executed by the local initialization files with\nthe following command:\n\n $ sudo chmod 0755 '\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230309'\n tag rid: 'SV-258062r627750_rule'\n tag stig_id: 'RHEL-08-010660'\n tag fix_id: 'F-32953r567674_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n if input('disable_slow_controls')\n describe 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute.' do\n skip 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute. You must enable this control for a full accredidation for production.'\n end\n else\n\n # get all world-writeable programs\n mount_points = etc_fstab.mount_point.join(' ')\n ww_programs = command(\"find #{mount_points} -xdev -type f -perm -0002 -print\").stdout.split.join('|')\n\n # get all homedirs\n interactive_users = passwd.where { uid.to_i >= 1000 && shell !~ /nologin/ }\n\n interactive_user_homedirs = interactive_users.homes.map { |home_path| home_path.match(%r{^(.*)/.*$}).captures.first }.uniq\n\n # get all init files (.*) in homedirs\n init_files = command(\"find #{interactive_user_homedirs.join(' ')} -xdev -maxdepth 2 -name '.*' ! -name '.bash_history' -type f\").stdout.split(\"\\n\")\n\n # check for ww programs in the init files\n init_files_invoking_ww = ww_programs.empty? ? [] : init_files.select { |i| file(i).content.lines.any? { |line| line.match(/^#{ww_programs}/) } }\n\n describe 'Interactive user initialization files' do\n it 'should not invoke world-writeable programs' do\n expect(init_files_invoking_ww).to be_empty, \"Failing init files:\\n\\t- #{init_files_invoking_ww.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258062.rb" + }, + "title": "Local RHEL 8 initialization files must not execute world-writable\nprograms.", + "desc": "If user start-up files execute world-writable programs, especially in\nunprotected directories, they could be maliciously modified to destroy user\nfiles or otherwise compromise the system at the user level. If the system is\ncompromised at the user level, it is easier to elevate privileges to eventually\ncompromise the system at the root and network level.", + "descriptions": { + "default": "If user start-up files execute world-writable programs, especially in\nunprotected directories, they could be maliciously modified to destroy user\nfiles or otherwise compromise the system at the user level. If the system is\ncompromised at the user level, it is easier to elevate privileges to eventually\ncompromise the system at the root and network level.", + "check": "Verify that local initialization files do not execute world-writable\nprograms.\n\n Check the system for world-writable files.\n\n The following command will discover and print world-writable files. Run it\nonce for each local partition [PART]:\n\n $ sudo find [PART] -xdev -type f -perm -0002 -print\n\n For all files listed, check for their presence in the local initialization\nfiles with the following commands:\n\n Note: The example will be for a system that is configured to create user\nhome directories in the \"/home\" directory.\n\n $ sudo grep /home/*/.*\n\n If any local initialization files are found to reference world-writable\nfiles, this is a finding.", + "fix": "Set the mode on files being executed by the local initialization files with\nthe following command:\n\n $ sudo chmod 0755 " + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230309", + "rid": "SV-258062r627750_rule", + "stig_id": "RHEL-08-010660", + "fix_id": "F-32953r567674_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258063", + "code": "control 'SV-258063' do\n title 'RHEL 8 must have the tmux package installed.'\n desc 'A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.'\n desc 'check', 'Verify RHEL 8 has the \"tmux\" package installed, by running the following\ncommand:\n\n $ sudo yum list installed tmux\n\n tmux.x86.64 2.7-1.el8\n@repository\n\n If \"tmux\" is not installed, this is a finding.'\n desc 'fix', 'Configure the operating system to enable a user to initiate a session lock\nvia tmux.\n\n Install the \"tmux\" package, if it is not already installed, by running\nthe following command:\n\n $ sudo yum install tmux'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag gid: 'V-244537'\n tag rid: 'SV-258063r743860_rule'\n tag stig_id: 'RHEL-08-020039'\n tag fix_id: 'F-47769r743859_fix'\n tag cci: ['CCI-000056']\n tag nist: ['AC-11 b']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe package('tmux') do\n it { should be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258063.rb" + }, + "title": "RHEL 8 must have the tmux package installed.", + "desc": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.", + "descriptions": { + "default": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.", + "check": "Verify RHEL 8 has the \"tmux\" package installed, by running the following\ncommand:\n\n $ sudo yum list installed tmux\n\n tmux.x86.64 2.7-1.el8\n@repository\n\n If \"tmux\" is not installed, this is a finding.", + "fix": "Configure the operating system to enable a user to initiate a session lock\nvia tmux.\n\n Install the \"tmux\" package, if it is not already installed, by running\nthe following command:\n\n $ sudo yum install tmux" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000028-GPOS-00009", + "satisfies": [ + "SRG-OS-000028-GPOS-00009", + "SRG-OS-000030-GPOS-00011" + ], + "gid": "V-244537", + "rid": "SV-258063r743860_rule", + "stig_id": "RHEL-08-020039", + "fix_id": "F-47769r743859_fix", + "cci": [ + "CCI-000056" + ], + "nist": [ + "AC-11 b" + ], + "host": null + } + }, + { + "id": "SV-258064", + "code": "control 'SV-258064' do\n title 'RHEL 8 must ensure session control is automatically started at shell\ninitialization.'\n desc 'Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package.'\n desc 'check', 'Verify the operating system shell initialization file is configured to start each shell with the tmux terminal multiplexer with the following commands:\n\nDetermine if tmux is currently running:\n $ sudo ps all | grep tmux | grep -v grep\n\nIf the command does not produce output, this is a finding.\n\nDetermine the location of the tmux script:\n $ sudo grep -r tmux /etc/bashrc /etc/profile.d\n\n /etc/profile.d/tmux.sh: case \"$name\" in (sshd|login) tmux ;; esac\n\nReview the tmux script by using the following example:\n $ sudo cat /etc/profile.d/tmux.sh\n\nif [ \"$PS1\" ]; then\nparent=$(ps -o ppid= -p $$)\nname=$(ps -o comm= -p $parent)\ncase \"$name\" in (sshd|login) tmux ;; esac\nfi\n\nIf \"tmux\" is not configured as the example above, is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure the operating system to initialize the tmux terminal multiplexer as each shell is called by adding the following lines to a custom.sh shell script in the /etc/profile.d/ directory:\n\nif [ \"$PS1\" ]; then\nparent=$(ps -o ppid= -p $$)\nname=$(ps -o comm= -p $parent)\ncase \"$name\" in (sshd|login) tmux ;; esac\nfi\n\nThis setting will take effect at next logon.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag gid: 'V-230349'\n tag rid: 'SV-258064r917920_rule'\n tag stig_id: 'RHEL-08-020041'\n tag fix_id: 'F-32993r880735_fix'\n tag cci: ['CCI-000056']\n tag nist: ['AC-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n tmux_running = command('ps all | grep tmux | grep -v grep').stdout.strip\n\n describe 'tmux' do\n it 'should be running' do\n expect(tmux_running).to_not be_empty, 'tmux is not running'\n end\n end\n\n if tmux_running.nil?\n\n # compare the tmux config with the expected multiline string the same way we do the banner checks\n # i.e. strip out all whitespace and compare the strings\n\n expected_config = \"if [ \\\"$PS1\\\" ]; then\\nparent=$(ps -o ppid= -p $$)\\nname=$(ps -o comm= -p $parent)\\ncase \\\"$name\\\" in (sshd|login) tmux ;; esac\\nfi\".content.gsub(/[\\r\\n\\s]/, '')\n\n tmux_script = command('grep -r tmux /etc/bashrc /etc/profile.d').stdout.strip.match(/^(?\\S+):/)['path']\n tmux_config = file(tmux_script).content.gsub(/[\\r\\n\\s]/, '')\n\n describe 'tmux' do\n it 'should be configured as expected' do\n expect(tmux_config).to match(/#{expected_config}/), 'tmux config does not match expected script'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258064.rb" + }, + "title": "RHEL 8 must ensure session control is automatically started at shell\ninitialization.", + "desc": "Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package.", + "descriptions": { + "default": "Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package.", + "check": "Verify the operating system shell initialization file is configured to start each shell with the tmux terminal multiplexer with the following commands:\n\nDetermine if tmux is currently running:\n $ sudo ps all | grep tmux | grep -v grep\n\nIf the command does not produce output, this is a finding.\n\nDetermine the location of the tmux script:\n $ sudo grep -r tmux /etc/bashrc /etc/profile.d\n\n /etc/profile.d/tmux.sh: case \"$name\" in (sshd|login) tmux ;; esac\n\nReview the tmux script by using the following example:\n $ sudo cat /etc/profile.d/tmux.sh\n\nif [ \"$PS1\" ]; then\nparent=$(ps -o ppid= -p $$)\nname=$(ps -o comm= -p $parent)\ncase \"$name\" in (sshd|login) tmux ;; esac\nfi\n\nIf \"tmux\" is not configured as the example above, is commented out, or is missing, this is a finding.", + "fix": "Configure the operating system to initialize the tmux terminal multiplexer as each shell is called by adding the following lines to a custom.sh shell script in the /etc/profile.d/ directory:\n\nif [ \"$PS1\" ]; then\nparent=$(ps -o ppid= -p $$)\nname=$(ps -o comm= -p $parent)\ncase \"$name\" in (sshd|login) tmux ;; esac\nfi\n\nThis setting will take effect at next logon." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000028-GPOS-00009", + "satisfies": [ + "SRG-OS-000028-GPOS-00009", + "SRG-OS-000030-GPOS-00011" + ], + "gid": "V-230349", + "rid": "SV-258064r917920_rule", + "stig_id": "RHEL-08-020041", + "fix_id": "F-32993r880735_fix", + "cci": [ + "CCI-000056" + ], + "nist": [ + "AC-11 b" + ], + "host": null + } + }, + { + "id": "SV-258065", + "code": "control 'SV-258065' do\n title 'RHEL 8 must enable a user session lock until that user re-establishes\naccess using established identification and authentication procedures for\ncommand line sessions.'\n desc 'A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.'\n desc 'check', %q(Verify the operating system enables the user to manually initiate a session lock with the following command:\n\n $ sudo grep -Ei 'lock-command|lock-session' /etc/tmux.conf\n\n set -g lock-command vlock\n bind X lock-session\n\nIf the \"lock-command\" is not set and \"lock-session\" is not bound to a specific keyboard key in the global settings, this is a finding.)\n desc 'fix', 'Configure the operating system to enable a user to manually initiate a session lock via tmux. This configuration binds the uppercase letter \"X\" to manually initiate a session lock after the prefix key \"Ctrl + b\" has been sent. The complete key sequence is thus \"Ctrl + b\" then \"Shift + x\" to lock tmux.\n\nCreate a global configuration file \"/etc/tmux.conf\" and add the following lines:\n\n set -g lock-command vlock\n bind X lock-session\n\nReload tmux configuration to take effect. This can be performed in tmux while it is running:\n\n $ tmux source-file /etc/tmux.conf'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag gid: 'V-230348'\n tag rid: 'SV-258065r902725_rule'\n tag stig_id: 'RHEL-08-020040'\n tag fix_id: 'F-32992r880719_fix'\n tag cci: ['CCI-000056']\n tag nist: ['AC-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n lock_command = command('grep -i lock-command /etc/tmux.conf').stdout.strip\n lock_session = command('grep -i lock-session /etc/tmux.conf').stdout.strip\n\n describe 'tmux settings' do\n it 'should set lock-command' do\n expect(lock_command).to match(/set -g lock-command vlock/)\n end\n it 'should bind a specific key to lock-session' do\n expect(lock_session).to match(/bind . lock-session/)\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258065.rb" + }, + "title": "RHEL 8 must enable a user session lock until that user re-establishes\naccess using established identification and authentication procedures for\ncommand line sessions.", + "desc": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.", + "descriptions": { + "default": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.", + "check": "Verify the operating system enables the user to manually initiate a session lock with the following command:\n\n $ sudo grep -Ei 'lock-command|lock-session' /etc/tmux.conf\n\n set -g lock-command vlock\n bind X lock-session\n\nIf the \"lock-command\" is not set and \"lock-session\" is not bound to a specific keyboard key in the global settings, this is a finding.", + "fix": "Configure the operating system to enable a user to manually initiate a session lock via tmux. This configuration binds the uppercase letter \"X\" to manually initiate a session lock after the prefix key \"Ctrl + b\" has been sent. The complete key sequence is thus \"Ctrl + b\" then \"Shift + x\" to lock tmux.\n\nCreate a global configuration file \"/etc/tmux.conf\" and add the following lines:\n\n set -g lock-command vlock\n bind X lock-session\n\nReload tmux configuration to take effect. This can be performed in tmux while it is running:\n\n $ tmux source-file /etc/tmux.conf" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000028-GPOS-00009", + "satisfies": [ + "SRG-OS-000028-GPOS-00009", + "SRG-OS-000030-GPOS-00011" + ], + "gid": "V-230348", + "rid": "SV-258065r902725_rule", + "stig_id": "RHEL-08-020040", + "fix_id": "F-32992r880719_fix", + "cci": [ + "CCI-000056" + ], + "nist": [ + "AC-11 b" + ], + "host": null + } + }, + { + "id": "SV-258066", + "code": "control 'SV-258066' do\n title 'RHEL 8 must automatically lock command line user sessions after 15\nminutes of inactivity.'\n desc 'Terminating an idle session within a short time period reduces the\nwindow of opportunity for unauthorized personnel to take control of a\nmanagement session enabled on the console or console port that has been left\nunattended. In addition, quickly terminating an idle session will also free up\nresources committed by the managed network element.\n\n Terminating network connections associated with communications sessions\nincludes, for example, de-allocating associated TCP/IP address/port pairs at\nthe operating system level and de-allocating networking assignments at the\napplication level if multiple application sessions are using a single operating\nsystem-level network connection. This does not mean the operating system\nterminates all sessions or network access; it only ends the inactive session\nand releases the resources associated with that session.'\n desc 'check', 'Verify the operating system initiates a session lock after 15 minutes of\ninactivity.\n\n Check the value of the system inactivity timeout with the following command:\n\n $ sudo grep -i lock-after-time /etc/tmux.conf\n\n set -g lock-after-time 900\n\n If \"lock-after-time\" is not set to \"900\" or less in the global tmux\nconfiguration file to enforce session lock after inactivity, this is a finding.'\n desc 'fix', 'Configure the operating system to enforce session lock after a period of 15\nminutes of inactivity by adding the following line to the \"/etc/tmux.conf\"\nglobal configuration file:\n\n set -g lock-after-time 900'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000029-GPOS-00010'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012']\n tag gid: 'V-230353'\n tag rid: 'SV-258066r627750_rule'\n tag stig_id: 'RHEL-08-020070'\n tag fix_id: 'F-32997r567806_fix'\n tag cci: ['CCI-000057']\n tag nist: ['AC-11 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n timeout = command('grep -i lock-after-time /etc/tmux.conf').stdout.strip.match(/lock-after-time\\s+(?\\d+)/)\n expected_timeout = input('system_activity_timeout')\n\n describe 'tmux settings' do\n it 'should set lock-after-time' do\n expect(timeout).to_not be_nil, 'lock-after-time not set'\n end\n unless timeout.nil?\n it \"should lock the session after #{expected_timeout} seconds\" do\n expect(timeout['timeout'].to_i).to cmp <= expected_timeout\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258066.rb" + }, + "title": "RHEL 8 must automatically lock command line user sessions after 15\nminutes of inactivity.", + "desc": "Terminating an idle session within a short time period reduces the\nwindow of opportunity for unauthorized personnel to take control of a\nmanagement session enabled on the console or console port that has been left\nunattended. In addition, quickly terminating an idle session will also free up\nresources committed by the managed network element.\n\n Terminating network connections associated with communications sessions\nincludes, for example, de-allocating associated TCP/IP address/port pairs at\nthe operating system level and de-allocating networking assignments at the\napplication level if multiple application sessions are using a single operating\nsystem-level network connection. This does not mean the operating system\nterminates all sessions or network access; it only ends the inactive session\nand releases the resources associated with that session.", + "descriptions": { + "default": "Terminating an idle session within a short time period reduces the\nwindow of opportunity for unauthorized personnel to take control of a\nmanagement session enabled on the console or console port that has been left\nunattended. In addition, quickly terminating an idle session will also free up\nresources committed by the managed network element.\n\n Terminating network connections associated with communications sessions\nincludes, for example, de-allocating associated TCP/IP address/port pairs at\nthe operating system level and de-allocating networking assignments at the\napplication level if multiple application sessions are using a single operating\nsystem-level network connection. This does not mean the operating system\nterminates all sessions or network access; it only ends the inactive session\nand releases the resources associated with that session.", + "check": "Verify the operating system initiates a session lock after 15 minutes of\ninactivity.\n\n Check the value of the system inactivity timeout with the following command:\n\n $ sudo grep -i lock-after-time /etc/tmux.conf\n\n set -g lock-after-time 900\n\n If \"lock-after-time\" is not set to \"900\" or less in the global tmux\nconfiguration file to enforce session lock after inactivity, this is a finding.", + "fix": "Configure the operating system to enforce session lock after a period of 15\nminutes of inactivity by adding the following line to the \"/etc/tmux.conf\"\nglobal configuration file:\n\n set -g lock-after-time 900" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000029-GPOS-00010", + "satisfies": [ + "SRG-OS-000029-GPOS-00010", + "SRG-OS-000031-GPOS-00012" + ], + "gid": "V-230353", + "rid": "SV-258066r627750_rule", + "stig_id": "RHEL-08-020070", + "fix_id": "F-32997r567806_fix", + "cci": [ + "CCI-000057" + ], + "nist": [ + "AC-11 a" + ], + "host": null + } + }, + { + "id": "SV-258067", + "code": "control 'SV-258067' do\n title 'RHEL 8 must prevent users from disabling session control mechanisms.'\n desc 'A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.'\n desc 'check', 'Verify the operating system prevents users from disabling the tmux terminal\nmultiplexer with the following command:\n\n $ sudo grep -i tmux /etc/shells\n\n If any output is produced, this is a finding.'\n desc 'fix', 'Configure the operating system to prevent users from disabling\nthe tmux terminal multiplexer by editing the \"/etc/shells\" configuration file\nto remove any instances of tmux.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag gid: 'V-230350'\n tag rid: 'SV-258067r627750_rule'\n tag stig_id: 'RHEL-08-020042'\n tag fix_id: 'F-32994r567797_fix'\n tag cci: ['CCI-000056']\n tag nist: ['AC-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe command('grep -i tmux /etc/shells') do\n its('stdout.strip') { should be_empty }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258067.rb" + }, + "title": "RHEL 8 must prevent users from disabling session control mechanisms.", + "desc": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.", + "descriptions": { + "default": "A session lock is a temporary action taken when a user stops work and\nmoves away from the immediate physical vicinity of the information system but\ndoes not want to log out because of the temporary nature of the absence.\n\n The session lock is implemented at the point where session activity can be\ndetermined. Rather than be forced to wait for a period of time to expire before\nthe user session can be locked, RHEL 8 needs to provide users with the ability\nto manually invoke a session lock so users can secure their session if it is\nnecessary to temporarily vacate the immediate physical vicinity.\n\n Tmux is a terminal multiplexer that enables a number of terminals to be\ncreated, accessed, and controlled from a single screen. Red Hat endorses tmux\nas the recommended session controlling package.", + "check": "Verify the operating system prevents users from disabling the tmux terminal\nmultiplexer with the following command:\n\n $ sudo grep -i tmux /etc/shells\n\n If any output is produced, this is a finding.", + "fix": "Configure the operating system to prevent users from disabling\nthe tmux terminal multiplexer by editing the \"/etc/shells\" configuration file\nto remove any instances of tmux." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000028-GPOS-00009", + "satisfies": [ + "SRG-OS-000028-GPOS-00009", + "SRG-OS-000030-GPOS-00011" + ], + "gid": "V-230350", + "rid": "SV-258067r627750_rule", + "stig_id": "RHEL-08-020042", + "fix_id": "F-32994r567797_fix", + "cci": [ + "CCI-000056" + ], + "nist": [ + "AC-11 b" + ], + "host": null + } + }, + { + "id": "SV-258068", + "code": "control 'SV-258068' do\n title 'RHEL 9 must automatically exit interactive command shell user sessions after 15 minutes of inactivity.'\n desc 'Terminating an idle interactive command shell user session within a short time period reduces the window of opportunity for unauthorized personnel to take control of it when left unattended in a virtual terminal or physical console.\n\n'\n desc 'check', %q(Verify RHEL 9 is configured to exit interactive command shell user sessions after 15 minutes of inactivity or less with the following command:\n\n$ sudo grep -i tmout /etc/profile /etc/profile.d/*.sh\n\n/etc/profile.d/tmout.sh:declare -xr TMOUT=900\n\nIf \"TMOUT\" is not set to \"900\" or less in a script located in the \"/etc/'profile.d/ directory, is missing or is commented out, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to exit interactive command shell user sessions after 15 minutes of inactivity.\n\nAdd or edit the following line in \"/etc/profile.d/tmout.sh\":\n\n#!/bin/bash\n\ndeclare -xr TMOUT=900'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61809r926189_chk'\n tag severity: 'medium'\n tag gid: 'V-258068'\n tag rid: 'SV-258068r926191_rule'\n tag stig_id: 'RHEL-09-412035'\n tag gtitle: 'SRG-OS-000163-GPOS-00072'\n tag fix_id: 'F-61733r926190_fix'\n tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000029-GPOS-00010']\n tag 'documentable'\n tag cci: ['CCI-000057', 'CCI-001133']\n tag nist: ['AC-11 a', 'SC-10']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258068.rb" + }, + "title": "RHEL 9 must automatically exit interactive command shell user sessions after 15 minutes of inactivity.", + "desc": "Terminating an idle interactive command shell user session within a short time period reduces the window of opportunity for unauthorized personnel to take control of it when left unattended in a virtual terminal or physical console.\n\n", + "descriptions": { + "default": "Terminating an idle interactive command shell user session within a short time period reduces the window of opportunity for unauthorized personnel to take control of it when left unattended in a virtual terminal or physical console.\n\n", + "check": "Verify RHEL 9 is configured to exit interactive command shell user sessions after 15 minutes of inactivity or less with the following command:\n\n$ sudo grep -i tmout /etc/profile /etc/profile.d/*.sh\n\n/etc/profile.d/tmout.sh:declare -xr TMOUT=900\n\nIf \"TMOUT\" is not set to \"900\" or less in a script located in the \"/etc/'profile.d/ directory, is missing or is commented out, this is a finding.", + "fix": "Configure RHEL 9 to exit interactive command shell user sessions after 15 minutes of inactivity.\n\nAdd or edit the following line in \"/etc/profile.d/tmout.sh\":\n\n#!/bin/bash\n\ndeclare -xr TMOUT=900" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61809r926189_chk", + "severity": "medium", + "gid": "V-258068", + "rid": "SV-258068r926191_rule", + "stig_id": "RHEL-09-412035", + "gtitle": "SRG-OS-000163-GPOS-00072", + "fix_id": "F-61733r926190_fix", + "satisfies": [ + "SRG-OS-000163-GPOS-00072", + "SRG-OS-000029-GPOS-00010" + ], + "documentable": null, + "cci": [ + "CCI-000057", + "CCI-001133" + ], + "nist": [ + "AC-11 a", + "SC-10" + ] + } + }, + { + "id": "SV-258069", + "code": "control 'SV-258069' do\n title 'RHEL 8 must limit the number of concurrent sessions to ten for all\naccounts and/or account types.'\n desc 'Operating system management includes the ability to control the number\nof users and user sessions that utilize an operating system. Limiting the\nnumber of allowed users and sessions per user is helpful in reducing the risks\nrelated to DoS attacks.\n\n This requirement addresses concurrent sessions for information system\naccounts and does not address concurrent sessions by single users via multiple\nsystem accounts. The maximum number of concurrent sessions should be defined\nbased on mission needs and the operational environment for each system.'\n desc 'check', %q(Verify the operating system limits the number of concurrent sessions to\n\"10\" for all accounts and/or account types by issuing the following command:\n\n $ sudo grep -r -s '^[^#].*maxlogins' /etc/security/limits.conf\n/etc/security/limits.d/*.conf\n\n * hard maxlogins 10\n\n This can be set as a global domain (with the * wildcard) but may be set\ndifferently for multiple domains.\n\n If the \"maxlogins\" item is missing, commented out, or the value is set\ngreater than \"10\" and is not documented with the Information System Security\nOfficer (ISSO) as an operational requirement for all domains that have the\n\"maxlogins\" item assigned, this is a finding.)\n desc 'fix', 'Configure the operating system to limit the number of concurrent sessions\nto \"10\" for all accounts and/or account types.\n\n Add the following line to the top of the /etc/security/limits.conf or in a\n\".conf\" file defined in /etc/security/limits.d/:\n\n * hard maxlogins 10'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000027-GPOS-00008'\n tag gid: 'V-230346'\n tag rid: 'SV-258069r877399_rule'\n tag stig_id: 'RHEL-08-020024'\n tag fix_id: 'F-32990r619863_fix'\n tag cci: ['CCI-000054']\n tag nist: ['AC-10']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n setting = 'maxlogins'\n expected_value = input('concurrent_sessions_permitted')\n\n limits_files = command('ls /etc/security/limits.d/*.conf').stdout.strip.split\n limits_files.append('/etc/security/limits.conf')\n\n # make sure that at least one limits.conf file has the correct setting\n globally_set = limits_files.any? { |lf| !limits_conf(lf).read_params['*'].nil? && limits_conf(lf).read_params['*'].include?(['hard', setting.to_s, expected_value.to_s]) }\n\n # make sure that no limits.conf file has a value that contradicts the global set\n failing_files = limits_files.select { |lf|\n limits_conf(lf).read_params.values.flatten(1).any? { |l|\n l[1].eql?(setting) && l[2].to_i > expected_value\n }\n }\n describe 'Limits files' do\n it \"should limit concurrent sessions to #{expected_value} by default\" do\n expect(globally_set).to eq(true), \"No global ('*') setting for concurrent sessions found\"\n end\n it 'should not have any conflicting settings' do\n expect(failing_files).to be_empty, \"Files with incorrect '#{setting}' settings:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258069.rb" + }, + "title": "RHEL 8 must limit the number of concurrent sessions to ten for all\naccounts and/or account types.", + "desc": "Operating system management includes the ability to control the number\nof users and user sessions that utilize an operating system. Limiting the\nnumber of allowed users and sessions per user is helpful in reducing the risks\nrelated to DoS attacks.\n\n This requirement addresses concurrent sessions for information system\naccounts and does not address concurrent sessions by single users via multiple\nsystem accounts. The maximum number of concurrent sessions should be defined\nbased on mission needs and the operational environment for each system.", + "descriptions": { + "default": "Operating system management includes the ability to control the number\nof users and user sessions that utilize an operating system. Limiting the\nnumber of allowed users and sessions per user is helpful in reducing the risks\nrelated to DoS attacks.\n\n This requirement addresses concurrent sessions for information system\naccounts and does not address concurrent sessions by single users via multiple\nsystem accounts. The maximum number of concurrent sessions should be defined\nbased on mission needs and the operational environment for each system.", + "check": "Verify the operating system limits the number of concurrent sessions to\n\"10\" for all accounts and/or account types by issuing the following command:\n\n $ sudo grep -r -s '^[^#].*maxlogins' /etc/security/limits.conf\n/etc/security/limits.d/*.conf\n\n * hard maxlogins 10\n\n This can be set as a global domain (with the * wildcard) but may be set\ndifferently for multiple domains.\n\n If the \"maxlogins\" item is missing, commented out, or the value is set\ngreater than \"10\" and is not documented with the Information System Security\nOfficer (ISSO) as an operational requirement for all domains that have the\n\"maxlogins\" item assigned, this is a finding.", + "fix": "Configure the operating system to limit the number of concurrent sessions\nto \"10\" for all accounts and/or account types.\n\n Add the following line to the top of the /etc/security/limits.conf or in a\n\".conf\" file defined in /etc/security/limits.d/:\n\n * hard maxlogins 10" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000027-GPOS-00008", + "gid": "V-230346", + "rid": "SV-258069r877399_rule", + "stig_id": "RHEL-08-020024", + "fix_id": "F-32990r619863_fix", + "cci": [ + "CCI-000054" + ], + "nist": [ + "AC-10" + ], + "host": null + } + }, + { + "id": "SV-258070", + "code": "control 'SV-258070' do\n title 'RHEL 8 must log user name information when unsuccessful logon attempts\noccur.'\n desc 'By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.'\n desc 'check', 'Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured to log user\nname information when unsuccessful logon attempts occur:\n\n $ sudo grep audit /etc/security/faillock.conf\n\n audit\n\n If the \"audit\" option is not set, is missing or commented out, this is a\nfinding.'\n desc 'fix', 'Configure the operating system to log user name information when\nunsuccessful logon attempts occur.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n audit'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128']\n tag gid: 'V-230343'\n tag rid: 'SV-258070r743981_rule'\n tag stig_id: 'RHEL-08-020021'\n tag fix_id: 'F-32987r743980_fix'\n tag cci: ['CCI-000044']\n tag nist: ['AC-7 a']\n tag 'host'\n tag 'container'\n\n only_if('This check applies to RHEL versions 8.2 or newer, if the system is RHEL version 8.0 or 8.1, this check is not applicable.', impact: 0.0) {\n (os.release.to_f) >= 8.2\n }\n\n describe parse_config_file('/etc/security/faillock.conf') do\n its('audit') { should_not be_nil }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258070.rb" + }, + "title": "RHEL 8 must log user name information when unsuccessful logon attempts\noccur.", + "desc": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.", + "check": "Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the \"/etc/security/faillock.conf\" file is configured to log user\nname information when unsuccessful logon attempts occur:\n\n $ sudo grep audit /etc/security/faillock.conf\n\n audit\n\n If the \"audit\" option is not set, is missing or commented out, this is a\nfinding.", + "fix": "Configure the operating system to log user name information when\nunsuccessful logon attempts occur.\n\n Add/Modify the \"/etc/security/faillock.conf\" file to match the following\nline:\n\n audit" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000021-GPOS-00005", + "satisfies": [ + "SRG-OS-000021-GPOS-00005", + "SRG-OS-000329-GPOS-00128" + ], + "gid": "V-230343", + "rid": "SV-258070r743981_rule", + "stig_id": "RHEL-08-020021", + "fix_id": "F-32987r743980_fix", + "cci": [ + "CCI-000044" + ], + "nist": [ + "AC-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258071", + "code": "control 'SV-258071' do\n title 'RHEL 8 must enforce a delay of at least four seconds between logon\nprompts following a failed logon attempt.'\n desc 'Configuring the operating system to implement organization-wide\nsecurity implementation guides and security checklists verifies compliance with\nfederal standards and establishes a common security baseline across the DoD\nthat reflects the most restrictive security posture consistent with operational\nrequirements.\n\n Configuration settings are the set of parameters that can be changed in\nhardware, software, or firmware components of the system that affect the\nsecurity posture and/or functionality of the system. Security-related\nparameters are those parameters impacting the security state of the system,\nincluding the parameters required to satisfy other security control\nrequirements. Security-related parameters include, for example, registry\nsettings; account, file, and directory permission settings; and settings for\nfunctions, ports, protocols, services, and remote connections.'\n desc 'check', 'Verify the operating system enforces a delay of at least four seconds\nbetween console logon prompts following a failed logon attempt with the\nfollowing command:\n\n $ sudo grep -i fail_delay /etc/login.defs\n\n FAIL_DELAY 4\n\n If the value of \"FAIL_DELAY\" is not set to \"4\" or greater, or the line\nis commented out, this is a finding.'\n desc 'fix', 'Configure the operating system to enforce a delay of at least four seconds\nbetween logon prompts following a failed console logon attempt.\n\n Modify the \"/etc/login.defs\" file to set the \"FAIL_DELAY\" parameter to\n\"4\" or greater:\n\n FAIL_DELAY 4'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00226'\n tag gid: 'V-230378'\n tag rid: 'SV-258071r627750_rule'\n tag stig_id: 'RHEL-08-020310'\n tag fix_id: 'F-33022r567881_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n describe login_defs do\n its('FAIL_DELAY.to_i') { should cmp >= input('login_prompt_delay') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258071.rb" + }, + "title": "RHEL 8 must enforce a delay of at least four seconds between logon\nprompts following a failed logon attempt.", + "desc": "Configuring the operating system to implement organization-wide\nsecurity implementation guides and security checklists verifies compliance with\nfederal standards and establishes a common security baseline across the DoD\nthat reflects the most restrictive security posture consistent with operational\nrequirements.\n\n Configuration settings are the set of parameters that can be changed in\nhardware, software, or firmware components of the system that affect the\nsecurity posture and/or functionality of the system. Security-related\nparameters are those parameters impacting the security state of the system,\nincluding the parameters required to satisfy other security control\nrequirements. Security-related parameters include, for example, registry\nsettings; account, file, and directory permission settings; and settings for\nfunctions, ports, protocols, services, and remote connections.", + "descriptions": { + "default": "Configuring the operating system to implement organization-wide\nsecurity implementation guides and security checklists verifies compliance with\nfederal standards and establishes a common security baseline across the DoD\nthat reflects the most restrictive security posture consistent with operational\nrequirements.\n\n Configuration settings are the set of parameters that can be changed in\nhardware, software, or firmware components of the system that affect the\nsecurity posture and/or functionality of the system. Security-related\nparameters are those parameters impacting the security state of the system,\nincluding the parameters required to satisfy other security control\nrequirements. Security-related parameters include, for example, registry\nsettings; account, file, and directory permission settings; and settings for\nfunctions, ports, protocols, services, and remote connections.", + "check": "Verify the operating system enforces a delay of at least four seconds\nbetween console logon prompts following a failed logon attempt with the\nfollowing command:\n\n $ sudo grep -i fail_delay /etc/login.defs\n\n FAIL_DELAY 4\n\n If the value of \"FAIL_DELAY\" is not set to \"4\" or greater, or the line\nis commented out, this is a finding.", + "fix": "Configure the operating system to enforce a delay of at least four seconds\nbetween logon prompts following a failed console logon attempt.\n\n Modify the \"/etc/login.defs\" file to set the \"FAIL_DELAY\" parameter to\n\"4\" or greater:\n\n FAIL_DELAY 4" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00226", + "gid": "V-230378", + "rid": "SV-258071r627750_rule", + "stig_id": "RHEL-08-020310", + "fix_id": "F-33022r567881_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258072", + "code": "control 'SV-258072' do\n title 'RHEL 9 must define default permissions for the bash shell.'\n desc 'The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n'\n desc 'check', 'Verify the \"umask\" setting is configured correctly in the \"/etc/bashrc\" file with the following command:\n\nNote: If the value of the \"umask\" parameter is set to \"000\" \"/etc/bashrc\" file, the Severity is raised to a CAT I.\n\n$ grep umask /etc/bashrc \n\numask 077\numask 077 \n\nIf the value for the \"umask\" parameter is not \"077\", or the \"umask\" parameter is missing or is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to define default permissions for all authenticated users using the bash shell.\n\nAdd or edit the lines for the \"umask\" parameter in the \"/etc/bashrc\" file to \"077\":\n\numask 077'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61813r926201_chk'\n tag severity: 'medium'\n tag gid: 'V-258072'\n tag rid: 'SV-258072r926203_rule'\n tag stig_id: 'RHEL-09-412055'\n tag gtitle: 'SRG-OS-000480-GPOS-00228'\n tag fix_id: 'F-61737r926202_fix'\n tag satisfies: ['SRG-OS-000480-GPOS-00228', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258072.rb" + }, + "title": "RHEL 9 must define default permissions for the bash shell.", + "desc": "The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n", + "descriptions": { + "default": "The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n", + "check": "Verify the \"umask\" setting is configured correctly in the \"/etc/bashrc\" file with the following command:\n\nNote: If the value of the \"umask\" parameter is set to \"000\" \"/etc/bashrc\" file, the Severity is raised to a CAT I.\n\n$ grep umask /etc/bashrc \n\numask 077\numask 077 \n\nIf the value for the \"umask\" parameter is not \"077\", or the \"umask\" parameter is missing or is commented out, this is a finding.", + "fix": "Configure RHEL 9 to define default permissions for all authenticated users using the bash shell.\n\nAdd or edit the lines for the \"umask\" parameter in the \"/etc/bashrc\" file to \"077\":\n\numask 077" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61813r926201_chk", + "severity": "medium", + "gid": "V-258072", + "rid": "SV-258072r926203_rule", + "stig_id": "RHEL-09-412055", + "gtitle": "SRG-OS-000480-GPOS-00228", + "fix_id": "F-61737r926202_fix", + "satisfies": [ + "SRG-OS-000480-GPOS-00228", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258073", + "code": "control 'SV-258073' do\n title 'RHEL 9 must define default permissions for the c shell.'\n desc 'The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n'\n desc 'check', 'Verify the \"umask\" setting is configured correctly in the \"/etc/csh.cshrc\" file with the following command:\n\nNote: If the value of the \"umask\" parameter is set to \"000\" \"/etc/csh.cshrc\" file, the Severity is raised to a CAT I.\n\n$ grep umask /etc/csh.cshrc \n\numask 077\numask 077 \n\nIf the value for the \"umask\" parameter is not \"077\", or the \"umask\" parameter is missing or is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to define default permissions for all authenticated users using the c shell.\n\nAdd or edit the lines for the \"umask\" parameter in the \"/etc/csh.cshrc\" file to \"077\":\n\numask 077'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61814r926204_chk'\n tag severity: 'medium'\n tag gid: 'V-258073'\n tag rid: 'SV-258073r926206_rule'\n tag stig_id: 'RHEL-09-412060'\n tag gtitle: 'SRG-OS-000480-GPOS-00228'\n tag fix_id: 'F-61738r926205_fix'\n tag satisfies: ['SRG-OS-000480-GPOS-00228', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258073.rb" + }, + "title": "RHEL 9 must define default permissions for the c shell.", + "desc": "The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n", + "descriptions": { + "default": "The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n", + "check": "Verify the \"umask\" setting is configured correctly in the \"/etc/csh.cshrc\" file with the following command:\n\nNote: If the value of the \"umask\" parameter is set to \"000\" \"/etc/csh.cshrc\" file, the Severity is raised to a CAT I.\n\n$ grep umask /etc/csh.cshrc \n\numask 077\numask 077 \n\nIf the value for the \"umask\" parameter is not \"077\", or the \"umask\" parameter is missing or is commented out, this is a finding.", + "fix": "Configure RHEL 9 to define default permissions for all authenticated users using the c shell.\n\nAdd or edit the lines for the \"umask\" parameter in the \"/etc/csh.cshrc\" file to \"077\":\n\numask 077" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61814r926204_chk", + "severity": "medium", + "gid": "V-258073", + "rid": "SV-258073r926206_rule", + "stig_id": "RHEL-09-412060", + "gtitle": "SRG-OS-000480-GPOS-00228", + "fix_id": "F-61738r926205_fix", + "satisfies": [ + "SRG-OS-000480-GPOS-00228", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258074", + "code": "control 'SV-258074' do\n title 'RHEL 8 must define default permissions for all authenticated users in\nsuch a way that the user can only read and modify their own files.'\n desc 'Setting the most restrictive default permissions ensures that when new\naccounts are created, they do not have unnecessary access.'\n desc 'check', 'Verify the operating system defines default permissions for all\nauthenticated users in such a way that the user can only read and modify their\nown files.\n\n Check for the value of the \"UMASK\" parameter in \"/etc/login.defs\" file\nwith the following command:\n\n Note: If the value of the \"UMASK\" parameter is set to \"000\" in\n\"/etc/login.defs\" file, the Severity is raised to a CAT I.\n\n # grep -i umask /etc/login.defs\n\n UMASK 077\n\n If the value for the \"UMASK\" parameter is not \"077\", or the \"UMASK\"\nparameter is missing or is commented out, this is a finding.'\n desc 'fix', 'Configure the operating system to define default permissions for all\nauthenticated users in such a way that the user can only read and modify their\nown files.\n\n Add or edit the line for the \"UMASK\" parameter in \"/etc/login.defs\"\nfile to \"077\":\n\n UMASK 077'\n impact 0.7\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00228'\n tag gid: 'V-230383'\n tag rid: 'SV-258074r627750_rule'\n tag stig_id: 'RHEL-08-020351'\n tag fix_id: 'F-33027r567896_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n permissions_for_shells = input('permissions_for_shells')\n\n describe login_defs do\n its('UMASK') { should cmp permissions_for_shells['default_umask'] }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258074.rb" + }, + "title": "RHEL 8 must define default permissions for all authenticated users in\nsuch a way that the user can only read and modify their own files.", + "desc": "Setting the most restrictive default permissions ensures that when new\naccounts are created, they do not have unnecessary access.", + "descriptions": { + "default": "Setting the most restrictive default permissions ensures that when new\naccounts are created, they do not have unnecessary access.", + "check": "Verify the operating system defines default permissions for all\nauthenticated users in such a way that the user can only read and modify their\nown files.\n\n Check for the value of the \"UMASK\" parameter in \"/etc/login.defs\" file\nwith the following command:\n\n Note: If the value of the \"UMASK\" parameter is set to \"000\" in\n\"/etc/login.defs\" file, the Severity is raised to a CAT I.\n\n # grep -i umask /etc/login.defs\n\n UMASK 077\n\n If the value for the \"UMASK\" parameter is not \"077\", or the \"UMASK\"\nparameter is missing or is commented out, this is a finding.", + "fix": "Configure the operating system to define default permissions for all\nauthenticated users in such a way that the user can only read and modify their\nown files.\n\n Add or edit the line for the \"UMASK\" parameter in \"/etc/login.defs\"\nfile to \"077\":\n\n UMASK 077" + }, + "impact": 0.7, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00228", + "gid": "V-230383", + "rid": "SV-258074r627750_rule", + "stig_id": "RHEL-08-020351", + "fix_id": "F-33027r567896_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258075", + "code": "control 'SV-258075' do\n title 'RHEL 9 must define default permissions for the system default profile.'\n desc 'The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n'\n desc 'check', 'Verify the \"umask\" setting is configured correctly in the \"/etc/profile\" file with the following command:\n\nNote: If the value of the \"umask\" parameter is set to \"000\" \"/etc/profile\" file, the Severity is raised to a CAT I.\n\n$ grep umask /etc/profile \n\numask 077\n\nIf the value for the \"umask\" parameter is not \"077\", or the \"umask\" parameter is missing or is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to define default permissions for all authenticated users in such a way that the user can only read and modify their own files.\n\nAdd or edit the lines for the \"umask\" parameter in the \"/etc/profile\" file to \"077\":\n\numask 077'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61816r926210_chk'\n tag severity: 'medium'\n tag gid: 'V-258075'\n tag rid: 'SV-258075r926212_rule'\n tag stig_id: 'RHEL-09-412070'\n tag gtitle: 'SRG-OS-000480-GPOS-00228'\n tag fix_id: 'F-61740r926211_fix'\n tag satisfies: ['SRG-OS-000480-GPOS-00228', 'SRG-OS-000480-GPOS-00227']\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258075.rb" + }, + "title": "RHEL 9 must define default permissions for the system default profile.", + "desc": "The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n", + "descriptions": { + "default": "The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be \"0\". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.\n\n", + "check": "Verify the \"umask\" setting is configured correctly in the \"/etc/profile\" file with the following command:\n\nNote: If the value of the \"umask\" parameter is set to \"000\" \"/etc/profile\" file, the Severity is raised to a CAT I.\n\n$ grep umask /etc/profile \n\numask 077\n\nIf the value for the \"umask\" parameter is not \"077\", or the \"umask\" parameter is missing or is commented out, this is a finding.", + "fix": "Configure RHEL 9 to define default permissions for all authenticated users in such a way that the user can only read and modify their own files.\n\nAdd or edit the lines for the \"umask\" parameter in the \"/etc/profile\" file to \"077\":\n\numask 077" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61816r926210_chk", + "severity": "medium", + "gid": "V-258075", + "rid": "SV-258075r926212_rule", + "stig_id": "RHEL-09-412070", + "gtitle": "SRG-OS-000480-GPOS-00228", + "fix_id": "F-61740r926211_fix", + "satisfies": [ + "SRG-OS-000480-GPOS-00228", + "SRG-OS-000480-GPOS-00227" + ], + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258076", + "code": "control 'SV-258076' do\n title 'RHEL 8 must display the date and time of the last successful account\nlogon upon logon.'\n desc 'Providing users with feedback on when account accesses last occurred\nfacilitates user recognition and reporting of unauthorized account use.'\n desc 'check', 'Verify users are provided with feedback on when account accesses last\noccurred with the following command:\n\n $ sudo grep pam_lastlog /etc/pam.d/postlogin\n\n session required pam_lastlog.so showfailed\n\n If \"pam_lastlog\" is missing from \"/etc/pam.d/postlogin\" file, or the\nsilent option is present, this is a finding.'\n desc 'fix', 'Configure the operating system to provide users with feedback on when\naccount accesses last occurred by setting the required configuration options in\n\"/etc/pam.d/postlogin\".\n\n Add the following line to the top of \"/etc/pam.d/postlogin\":\n\n session required pam_lastlog.so showfailed'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230381'\n tag rid: 'SV-258076r858726_rule'\n tag stig_id: 'RHEL-08-020340'\n tag fix_id: 'F-33025r567890_fix'\n tag cci: ['CCI-000366', 'CCI-000052']\n tag nist: ['CM-6 b', 'AC-9']\n tag 'host'\n tag 'container'\n\n describe pam('/etc/pam.d/postlogin') do\n its('lines') { should match_pam_rule('session .* pam_lastlog.so').all_with_args('showfailed') }\n its('lines') { should_not match_pam_rule('session .* pam_lastlog.so').all_without_args('silent') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258076.rb" + }, + "title": "RHEL 8 must display the date and time of the last successful account\nlogon upon logon.", + "desc": "Providing users with feedback on when account accesses last occurred\nfacilitates user recognition and reporting of unauthorized account use.", + "descriptions": { + "default": "Providing users with feedback on when account accesses last occurred\nfacilitates user recognition and reporting of unauthorized account use.", + "check": "Verify users are provided with feedback on when account accesses last\noccurred with the following command:\n\n $ sudo grep pam_lastlog /etc/pam.d/postlogin\n\n session required pam_lastlog.so showfailed\n\n If \"pam_lastlog\" is missing from \"/etc/pam.d/postlogin\" file, or the\nsilent option is present, this is a finding.", + "fix": "Configure the operating system to provide users with feedback on when\naccount accesses last occurred by setting the required configuration options in\n\"/etc/pam.d/postlogin\".\n\n Add the following line to the top of \"/etc/pam.d/postlogin\":\n\n session required pam_lastlog.so showfailed" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230381", + "rid": "SV-258076r858726_rule", + "stig_id": "RHEL-08-020340", + "fix_id": "F-33025r567890_fix", + "cci": [ + "CCI-000366", + "CCI-000052" + ], + "nist": [ + "CM-6 b", + "AC-9" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258077", + "code": "control 'SV-258077' do\n title 'RHEL 8 must terminate idle user sessions.'\n desc 'Terminating an idle session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended.'\n desc 'check', 'Verify that RHEL 8 logs out sessions that are idle for 15 minutes with the following command:\n\n $ sudo grep -i ^StopIdleSessionSec /etc/systemd/logind.conf\n\n StopIdleSessionSec=900\n\nIf \"StopIdleSessionSec\" is not configured to \"900\" seconds, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to log out idle sessions by editing the /etc/systemd/logind.conf file with the following line:\n\n StopIdleSessionSec=900\n\nThe \"logind\" service must be restarted for the changes to take effect. To restart the \"logind\" service, run the following command:\n\n $ sudo systemctl restart systemd-logind\n\nNote: To preserve running user programs such as tmux, uncomment and/or edit \"KillUserProccesses=no\" in \"/etc/systemd/logind.conf\".'\n impact 0.5\n tag check_id: 'C-60942r917889_chk'\n tag severity: 'medium'\n tag gid: 'V-257258'\n tag rid: 'SV-258077r942953_rule'\n tag stig_id: 'RHEL-08-020035'\n tag gtitle: 'SRG-OS-000163-GPOS-00072'\n tag fix_id: 'F-60884r942952_fix'\n tag 'documentable'\n tag cci: ['CCI-001133']\n tag nist: ['SC-10']\n tag 'container'\n tag 'host'\n\n stop_idle_session_sec = input('stop_idle_session_sec')\n\n describe parse_config_file('/etc/systemd/logind.conf') do\n its('Login') { should include('StopIdleSessionSec' => stop_idle_session_sec.to_s) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258077.rb" + }, + "title": "RHEL 8 must terminate idle user sessions.", + "desc": "Terminating an idle session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended.", + "descriptions": { + "default": "Terminating an idle session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended.", + "check": "Verify that RHEL 8 logs out sessions that are idle for 15 minutes with the following command:\n\n $ sudo grep -i ^StopIdleSessionSec /etc/systemd/logind.conf\n\n StopIdleSessionSec=900\n\nIf \"StopIdleSessionSec\" is not configured to \"900\" seconds, this is a finding.", + "fix": "Configure RHEL 8 to log out idle sessions by editing the /etc/systemd/logind.conf file with the following line:\n\n StopIdleSessionSec=900\n\nThe \"logind\" service must be restarted for the changes to take effect. To restart the \"logind\" service, run the following command:\n\n $ sudo systemctl restart systemd-logind\n\nNote: To preserve running user programs such as tmux, uncomment and/or edit \"KillUserProccesses=no\" in \"/etc/systemd/logind.conf\"." + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-60942r917889_chk", + "severity": "medium", + "gid": "V-257258", + "rid": "SV-258077r942953_rule", + "stig_id": "RHEL-08-020035", + "gtitle": "SRG-OS-000163-GPOS-00072", + "fix_id": "F-60884r942952_fix", + "documentable": null, + "cci": [ + "CCI-001133" + ], + "nist": [ + "SC-10" + ], + "container": null, + "host": null + } + }, + { + "id": "SV-258078", + "code": "control 'SV-258078' do\n title 'RHEL 8 must use a Linux Security Module configured to enforce limits\non system services.'\n desc 'Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n This requirement applies to operating systems performing security function\nverification/testing and/or systems and environments that require this\nfunctionality.'\n desc 'check', 'Verify the operating system verifies correct operation of all security\nfunctions.\n\n Check if \"SELinux\" is active and in \"Enforcing\" mode with the following\ncommand:\n\n $ sudo getenforce\n Enforcing\n\n If \"SELinux\" is not active and not in \"Enforcing\" mode, this is a\nfinding.'\n desc 'fix', 'Configure the operating system to verify correct operation of all security\nfunctions.\n\n Set the \"SELinux\" status and the \"Enforcing\" mode by modifying the\n\"/etc/selinux/config\" file to have the following line:\n\n SELINUX=enforcing\n\n A reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000134-GPOS-00068'\n tag gid: 'V-230240'\n tag rid: 'SV-258078r627750_rule'\n tag stig_id: 'RHEL-08-010170'\n tag fix_id: 'F-32884r567467_fix'\n tag cci: ['CCI-001084']\n tag nist: ['SC-3']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) do\n !virtualization.system.eql?('docker')\n end\n\n describe selinux do\n it { should be_enforcing }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258078.rb" + }, + "title": "RHEL 8 must use a Linux Security Module configured to enforce limits\non system services.", + "desc": "Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n This requirement applies to operating systems performing security function\nverification/testing and/or systems and environments that require this\nfunctionality.", + "descriptions": { + "default": "Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n This requirement applies to operating systems performing security function\nverification/testing and/or systems and environments that require this\nfunctionality.", + "check": "Verify the operating system verifies correct operation of all security\nfunctions.\n\n Check if \"SELinux\" is active and in \"Enforcing\" mode with the following\ncommand:\n\n $ sudo getenforce\n Enforcing\n\n If \"SELinux\" is not active and not in \"Enforcing\" mode, this is a\nfinding.", + "fix": "Configure the operating system to verify correct operation of all security\nfunctions.\n\n Set the \"SELinux\" status and the \"Enforcing\" mode by modifying the\n\"/etc/selinux/config\" file to have the following line:\n\n SELINUX=enforcing\n\n A reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000134-GPOS-00068", + "gid": "V-230240", + "rid": "SV-258078r627750_rule", + "stig_id": "RHEL-08-010170", + "fix_id": "F-32884r567467_fix", + "cci": [ + "CCI-001084" + ], + "nist": [ + "SC-3" + ], + "host": null + } + }, + { + "id": "SV-258079", + "code": "control 'SV-258079' do\n title 'RHEL 8 must enable the SELinux targeted policy.'\n desc 'Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n This requirement applies to operating systems performing security function\nverification/testing and/or systems and environments that require this\nfunctionality.'\n desc 'check', %q(Ensure the operating system verifies correct operation of all security\nfunctions.\n\n Check if \"SELinux\" is active and is enforcing the targeted policy with\nthe following command:\n\n $ sudo sestatus\n\n SELinux status: enabled\n SELinuxfs mount: /sys/fs/selinux\n SELinux root directory: /etc/selinux\n Loaded policy name: targeted\n Current mode: enforcing\n Mode from config file: enforcing\n Policy MLS status: enabled\n Policy deny_unknown status: allowed\n Memory protection checking: actual (secure)\n Max kernel policy version: 31\n\n If the \"Loaded policy name\" is not set to \"targeted\", this is a finding.\n\n Verify that the /etc/selinux/config file is configured to the\n\"SELINUXTYPE\" to \"targeted\":\n\n $ sudo grep -i \"selinuxtype\" /etc/selinux/config | grep -v '^#'\n\n SELINUXTYPE = targeted\n\n If no results are returned or \"SELINUXTYPE\" is not set to \"targeted\",\nthis is a finding.)\n desc 'fix', 'Configure the operating system to verify correct operation of all security\nfunctions.\n\n Set the \"SELinuxtype\" to the \"targeted\" policy by modifying the\n\"/etc/selinux/config\" file to have the following line:\n\n SELINUXTYPE=targeted\n\n A reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000445-GPOS-00199'\n tag gid: 'V-230282'\n tag rid: 'SV-258079r854035_rule'\n tag stig_id: 'RHEL-08-010450'\n tag fix_id: 'F-32926r567593_fix'\n tag cci: ['CCI-002696']\n tag nist: ['SI-6 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe selinux do\n it { should_not be_disabled }\n it { should be_enforcing }\n its('policy') { should eq 'targeted' }\n end\n\n describe parse_config_file('/etc/selinux/config') do\n its('SELINUXTYPE') { should eq 'targeted' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258079.rb" + }, + "title": "RHEL 8 must enable the SELinux targeted policy.", + "desc": "Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n This requirement applies to operating systems performing security function\nverification/testing and/or systems and environments that require this\nfunctionality.", + "descriptions": { + "default": "Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n This requirement applies to operating systems performing security function\nverification/testing and/or systems and environments that require this\nfunctionality.", + "check": "Ensure the operating system verifies correct operation of all security\nfunctions.\n\n Check if \"SELinux\" is active and is enforcing the targeted policy with\nthe following command:\n\n $ sudo sestatus\n\n SELinux status: enabled\n SELinuxfs mount: /sys/fs/selinux\n SELinux root directory: /etc/selinux\n Loaded policy name: targeted\n Current mode: enforcing\n Mode from config file: enforcing\n Policy MLS status: enabled\n Policy deny_unknown status: allowed\n Memory protection checking: actual (secure)\n Max kernel policy version: 31\n\n If the \"Loaded policy name\" is not set to \"targeted\", this is a finding.\n\n Verify that the /etc/selinux/config file is configured to the\n\"SELINUXTYPE\" to \"targeted\":\n\n $ sudo grep -i \"selinuxtype\" /etc/selinux/config | grep -v '^#'\n\n SELINUXTYPE = targeted\n\n If no results are returned or \"SELINUXTYPE\" is not set to \"targeted\",\nthis is a finding.", + "fix": "Configure the operating system to verify correct operation of all security\nfunctions.\n\n Set the \"SELinuxtype\" to the \"targeted\" policy by modifying the\n\"/etc/selinux/config\" file to have the following line:\n\n SELINUXTYPE=targeted\n\n A reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000445-GPOS-00199", + "gid": "V-230282", + "rid": "SV-258079r854035_rule", + "stig_id": "RHEL-08-010450", + "fix_id": "F-32926r567593_fix", + "cci": [ + "CCI-002696" + ], + "nist": [ + "SI-6 a" + ], + "host": null + } + }, + { + "id": "SV-258080", + "code": "control 'SV-258080' do\n title 'RHEL 8 systems, versions 8.2 and above, must configure SELinux context\n type to allow the use of a non-default faillock tally directory.'\n desc %q(By limiting the number of failed logon attempts, the risk of\n unauthorized system access via user password guessing, otherwise known as\n brute-force attacks, is reduced. Limits are imposed by locking the account.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n \"pam_faillock\" uses is usually cleared on system boot so the access will be\n re-enabled after system reboot. If that is undesirable, a different tally\n directory must be set with the \"dir\" option.\n\n SELinux, enforcing a targeted policy, will require any non-default tally\n directory's security context type to match the default directory's security\n context type. Without updating the security context type, the pam_faillock\n module will not write failed login attempts to the non-default tally directory.)\n desc 'check', 'If the system does not have SELinux enabled and enforcing a\n targeted policy, or if the pam_faillock module is not configured for use,\n this requirement is not applicable.\n\n Note: This check applies to RHEL versions 8.2 or newer. If the system is\n RHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the location of the non-default tally directory for the pam_faillock\n module with the following command:\n\n $ sudo grep -w dir /etc/security/faillock.conf\n\n dir = /var/log/faillock\n\n Check the security context type of the non-default tally directory with the\n following command:\n\n $ sudo ls -Zd /var/log/faillock\n\n unconfined_u:object_r:faillog_t:s0 /var/log/faillock\n\n If the security context type of the non-default tally directory is not\n \"faillog_t\", this is a finding.'\n desc 'fix', 'Configure RHEL 8 to allow the use of a non-default faillock tally\n directory while SELinux enforces a targeted policy.\n\n Create a non-default faillock tally directory (if it does not already exist)\n with the following example:\n\n $ sudo mkdir /var/log/faillock\n\n Update the /etc/selinux/targeted/contexts/files/file_contexts.local with\n \"faillog_t\" context type for the non-default faillock tally directory with\n the following command:\n\n $ sudo semanage fcontext -a -t faillog_t \"/var/log/faillock(/.*)?\"\n\n Next, update the context type of the non-default faillock directory/subdirectories\n and files with the following command:\n\n $ sudo restorecon -R -v /var/log/faillock'\n impact 0.5\n tag check_id: 'C-53749r793000_chk'\n tag severity: 'medium'\n tag gid: 'V-250315'\n tag rid: 'SV-258080r854079_rule'\n tag stig_id: 'RHEL-08-020027'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag fix_id: 'F-53703r793001_fix'\n tag 'documentable'\n tag cci: ['CCI-000044', 'CCI-002238']\n tag nist: ['AC-7 a', 'AC-7 b']\n tag 'host'\n\n only_if('This check applies to RHEL version 8.2 and later. If the system is not RHEL version 8.2 or newer, this check is Not Applicable.', impact: 0.0) {\n (os.release.to_f) >= 8.2\n }\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable in a container' do\n skip 'SELinux controls Not Applicable in a container'\n end\n else\n\n describe selinux do\n it { should be_installed }\n it { should be_enforcing }\n it { should_not be_disabled }\n end\n\n describe parse_config_file('/etc/security/faillock.conf') do\n its('dir') { should cmp input('non_default_tally_dir') }\n end\n\n faillock_tally = input('faillock_tally')\n\n describe \"The selected non-default tally directory for PAM: #{input('non_default_tally_dir')}\" do\n subject { file(input('non_default_tally_dir')) }\n its('selinux_label') { should match(/#{faillock_tally}/) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258080.rb" + }, + "title": "RHEL 8 systems, versions 8.2 and above, must configure SELinux context\n type to allow the use of a non-default faillock tally directory.", + "desc": "By limiting the number of failed logon attempts, the risk of\n unauthorized system access via user password guessing, otherwise known as\n brute-force attacks, is reduced. Limits are imposed by locking the account.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n \"pam_faillock\" uses is usually cleared on system boot so the access will be\n re-enabled after system reboot. If that is undesirable, a different tally\n directory must be set with the \"dir\" option.\n\n SELinux, enforcing a targeted policy, will require any non-default tally\n directory's security context type to match the default directory's security\n context type. Without updating the security context type, the pam_faillock\n module will not write failed login attempts to the non-default tally directory.", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of\n unauthorized system access via user password guessing, otherwise known as\n brute-force attacks, is reduced. Limits are imposed by locking the account.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n \"pam_faillock\" uses is usually cleared on system boot so the access will be\n re-enabled after system reboot. If that is undesirable, a different tally\n directory must be set with the \"dir\" option.\n\n SELinux, enforcing a targeted policy, will require any non-default tally\n directory's security context type to match the default directory's security\n context type. Without updating the security context type, the pam_faillock\n module will not write failed login attempts to the non-default tally directory.", + "check": "If the system does not have SELinux enabled and enforcing a\n targeted policy, or if the pam_faillock module is not configured for use,\n this requirement is not applicable.\n\n Note: This check applies to RHEL versions 8.2 or newer. If the system is\n RHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the location of the non-default tally directory for the pam_faillock\n module with the following command:\n\n $ sudo grep -w dir /etc/security/faillock.conf\n\n dir = /var/log/faillock\n\n Check the security context type of the non-default tally directory with the\n following command:\n\n $ sudo ls -Zd /var/log/faillock\n\n unconfined_u:object_r:faillog_t:s0 /var/log/faillock\n\n If the security context type of the non-default tally directory is not\n \"faillog_t\", this is a finding.", + "fix": "Configure RHEL 8 to allow the use of a non-default faillock tally\n directory while SELinux enforces a targeted policy.\n\n Create a non-default faillock tally directory (if it does not already exist)\n with the following example:\n\n $ sudo mkdir /var/log/faillock\n\n Update the /etc/selinux/targeted/contexts/files/file_contexts.local with\n \"faillog_t\" context type for the non-default faillock tally directory with\n the following command:\n\n $ sudo semanage fcontext -a -t faillog_t \"/var/log/faillock(/.*)?\"\n\n Next, update the context type of the non-default faillock directory/subdirectories\n and files with the following command:\n\n $ sudo restorecon -R -v /var/log/faillock" + }, + "impact": 0, + "refs": [], + "tags": { + "check_id": "C-53749r793000_chk", + "severity": "medium", + "gid": "V-250315", + "rid": "SV-258080r854079_rule", + "stig_id": "RHEL-08-020027", + "gtitle": "SRG-OS-000021-GPOS-00005", + "fix_id": "F-53703r793001_fix", + "documentable": null, + "cci": [ + "CCI-000044", + "CCI-002238" + ], + "nist": [ + "AC-7 a", + "AC-7 b" + ], + "host": null + } + }, + { + "id": "SV-258081", + "code": "control 'SV-258081' do\n title 'RHEL 8 must have policycoreutils package installed.'\n desc 'Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n Policycoreutils contains the policy core utilities that are required for\nbasic operation of an SELinux-enabled system. These utilities include\nload_policy to load SELinux policies, setfile to label filesystems, newrole to\nswitch roles, and run_init to run /etc/init.d scripts in the proper context.'\n desc 'check', 'Verify the operating system has the policycoreutils package installed with\nthe following command:\n\n $ sudo yum list installed policycoreutils\n\n policycoreutils.x86_64\n2.9-3.el8 @anaconda\n\n If the policycoreutils package is not installed, this is a finding.'\n desc 'fix', 'Configure the operating system to have the policycoreutils package\ninstalled with the following command:\n\n $ sudo yum install policycoreutils'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000134-GPOS-00068'\n tag gid: 'V-230241'\n tag rid: 'SV-258081r627750_rule'\n tag stig_id: 'RHEL-08-010171'\n tag fix_id: 'F-32885r567470_fix'\n tag cci: ['CCI-001084']\n tag nist: ['SC-3']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) do\n !virtualization.system.eql?('docker')\n end\n\n describe package('policycoreutils') do\n it { should be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258081.rb" + }, + "title": "RHEL 8 must have policycoreutils package installed.", + "desc": "Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n Policycoreutils contains the policy core utilities that are required for\nbasic operation of an SELinux-enabled system. These utilities include\nload_policy to load SELinux policies, setfile to label filesystems, newrole to\nswitch roles, and run_init to run /etc/init.d scripts in the proper context.", + "descriptions": { + "default": "Without verification of the security functions, security functions may\nnot operate correctly and the failure may go unnoticed. Security function is\ndefined as the hardware, software, and/or firmware of the information system\nresponsible for enforcing the system security policy and supporting the\nisolation of code and data on which the protection is based. Security\nfunctionality includes, but is not limited to, establishing system accounts,\nconfiguring access authorizations (i.e., permissions, privileges), setting\nevents to be audited, and setting intrusion detection parameters.\n\n Policycoreutils contains the policy core utilities that are required for\nbasic operation of an SELinux-enabled system. These utilities include\nload_policy to load SELinux policies, setfile to label filesystems, newrole to\nswitch roles, and run_init to run /etc/init.d scripts in the proper context.", + "check": "Verify the operating system has the policycoreutils package installed with\nthe following command:\n\n $ sudo yum list installed policycoreutils\n\n policycoreutils.x86_64\n2.9-3.el8 @anaconda\n\n If the policycoreutils package is not installed, this is a finding.", + "fix": "Configure the operating system to have the policycoreutils package\ninstalled with the following command:\n\n $ sudo yum install policycoreutils" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000134-GPOS-00068", + "gid": "V-230241", + "rid": "SV-258081r627750_rule", + "stig_id": "RHEL-08-010171", + "fix_id": "F-32885r567470_fix", + "cci": [ + "CCI-001084" + ], + "nist": [ + "SC-3" + ], + "host": null + } + }, + { + "id": "SV-258082", + "code": "control 'SV-258082' do\n title 'RHEL 9 policycoreutils-python-utils package must be installed.'\n desc 'The policycoreutils-python-utils package is required to operate and manage an SELinux environment and its policies. It provides utilities such as semanage, audit2allow, audit2why, chcat, and sandbox.'\n desc 'check', 'Verify that RHEL 9 policycoreutils-python-utils service package is installed with the following command:\n\n$ sudo dnf list --installed policycoreutils-python-utils\n\nExample output:\n\npolicycoreutils-python-utils.noarch 3.3-6.el9_0\n\nIf the \"policycoreutils-python-utils\" package is not installed, this is a finding.'\n desc 'fix', 'Install the policycoreutils-python-utils service package (if the policycoreutils-python-utils service is not already installed) with the following command:\n\n$ sudo dnf install policycoreutils-python-utils'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61823r926231_chk'\n tag severity: 'medium'\n tag gid: 'V-258082'\n tag rid: 'SV-258082r926233_rule'\n tag stig_id: 'RHEL-09-431030'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61747r926232_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258082.rb" + }, + "title": "RHEL 9 policycoreutils-python-utils package must be installed.", + "desc": "The policycoreutils-python-utils package is required to operate and manage an SELinux environment and its policies. It provides utilities such as semanage, audit2allow, audit2why, chcat, and sandbox.", + "descriptions": { + "default": "The policycoreutils-python-utils package is required to operate and manage an SELinux environment and its policies. It provides utilities such as semanage, audit2allow, audit2why, chcat, and sandbox.", + "check": "Verify that RHEL 9 policycoreutils-python-utils service package is installed with the following command:\n\n$ sudo dnf list --installed policycoreutils-python-utils\n\nExample output:\n\npolicycoreutils-python-utils.noarch 3.3-6.el9_0\n\nIf the \"policycoreutils-python-utils\" package is not installed, this is a finding.", + "fix": "Install the policycoreutils-python-utils service package (if the policycoreutils-python-utils service is not already installed) with the following command:\n\n$ sudo dnf install policycoreutils-python-utils" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61823r926231_chk", + "severity": "medium", + "gid": "V-258082", + "rid": "SV-258082r926233_rule", + "stig_id": "RHEL-09-431030", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61747r926232_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258083", + "code": "control 'SV-258083' do\n title 'RHEL 9 must have the sudo package installed.'\n desc '\"sudo\" is a program designed to allow a system administrator to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow system users to get their work done.'\n desc 'check', 'Verify that RHEL 9 sudo package is installed with the following command:\n\n$ sudo dnf list --installed sudo\n\nExample output:\n\nsudo.x86_64 1.9.5p2-7.el9\n\nIf the \"sudo\" package is not installed, this is a finding.'\n desc 'fix', 'The sudo package can be installed with the following command:\n \n$ sudo dnf install sudo'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61824r926234_chk'\n tag severity: 'medium'\n tag gid: 'V-258083'\n tag rid: 'SV-258083r926236_rule'\n tag stig_id: 'RHEL-09-432010'\n tag gtitle: 'SRG-OS-000324-GPOS-00125'\n tag fix_id: 'F-61748r926235_fix'\n tag 'documentable'\n tag cci: ['CCI-002235']\n tag nist: ['AC-6 (10)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258083.rb" + }, + "title": "RHEL 9 must have the sudo package installed.", + "desc": "\"sudo\" is a program designed to allow a system administrator to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow system users to get their work done.", + "descriptions": { + "default": "\"sudo\" is a program designed to allow a system administrator to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow system users to get their work done.", + "check": "Verify that RHEL 9 sudo package is installed with the following command:\n\n$ sudo dnf list --installed sudo\n\nExample output:\n\nsudo.x86_64 1.9.5p2-7.el9\n\nIf the \"sudo\" package is not installed, this is a finding.", + "fix": "The sudo package can be installed with the following command:\n \n$ sudo dnf install sudo" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61824r926234_chk", + "severity": "medium", + "gid": "V-258083", + "rid": "SV-258083r926236_rule", + "stig_id": "RHEL-09-432010", + "gtitle": "SRG-OS-000324-GPOS-00125", + "fix_id": "F-61748r926235_fix", + "documentable": null, + "cci": [ + "CCI-002235" + ], + "nist": [ + "AC-6 (10)" + ] + } + }, + { + "id": "SV-258084", + "code": "control 'SV-258084' do\n title 'RHEL 8 must require re-authentication when using the \"sudo\" command.'\n desc %q(Without re-authentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the organization requires the user to\nre-authenticate when using the \"sudo\" command.\n\n If the value is set to an integer less than 0, the user's time stamp will\nnot expire and the user will not have to re-authenticate for privileged actions\nuntil the user's session is terminated.)\n desc 'check', %q(Verify the operating system requires re-authentication when using the \"sudo\" command to elevate privileges.\n\n$ sudo grep -ir 'timestamp_timeout' /etc/sudoers /etc/sudoers.d\n/etc/sudoers:Defaults timestamp_timeout=0\n\nIf conflicting results are returned, this is a finding.\n\nIf \"timestamp_timeout\" is set to a negative number, is commented out, or no results are returned, this is a finding.)\n desc 'fix', 'Configure the \"sudo\" command to require re-authentication.\nEdit the /etc/sudoers file:\n$ sudo visudo\n\nAdd or modify the following line:\nDefaults timestamp_timeout=[value]\nNote: The \"[value]\" must be a number that is greater than or equal to \"0\".\n\nRemove any duplicate or conflicting lines from /etc/sudoers and /etc/sudoers.d/ files.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000373-GPOS-00156'\n tag gid: 'V-237643'\n tag rid: 'SV-258084r861088_rule'\n tag stig_id: 'RHEL-08-010384'\n tag fix_id: 'F-40825r858763_fix'\n tag cci: ['CCI-002038']\n tag nist: ['IA-11']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This requirement is Not Applicable in a container with no sudo installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !command('sudo').exist?)\n }\n\n setting = 'timestamp_timeout'\n setting_value = sudoers(input('sudoers_config_files')).settings.Defaults[setting]\n\n describe 'Sudoers configuration' do\n it \"should should set #{setting} to a non-negative number, exactly once\" do\n expect(setting_value).to_not be_nil, \"#{setting} not found inside sudoers config file(s)\"\n expect(setting_value.count).to eq(1), \"#{setting} set #{setting_value.count} times inside sudoers config file(s)\"\n expect(setting_value.first.to_i).to be >= 0\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258084.rb" + }, + "title": "RHEL 8 must require re-authentication when using the \"sudo\" command.", + "desc": "Without re-authentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the organization requires the user to\nre-authenticate when using the \"sudo\" command.\n\n If the value is set to an integer less than 0, the user's time stamp will\nnot expire and the user will not have to re-authenticate for privileged actions\nuntil the user's session is terminated.", + "descriptions": { + "default": "Without re-authentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the organization requires the user to\nre-authenticate when using the \"sudo\" command.\n\n If the value is set to an integer less than 0, the user's time stamp will\nnot expire and the user will not have to re-authenticate for privileged actions\nuntil the user's session is terminated.", + "check": "Verify the operating system requires re-authentication when using the \"sudo\" command to elevate privileges.\n\n$ sudo grep -ir 'timestamp_timeout' /etc/sudoers /etc/sudoers.d\n/etc/sudoers:Defaults timestamp_timeout=0\n\nIf conflicting results are returned, this is a finding.\n\nIf \"timestamp_timeout\" is set to a negative number, is commented out, or no results are returned, this is a finding.", + "fix": "Configure the \"sudo\" command to require re-authentication.\nEdit the /etc/sudoers file:\n$ sudo visudo\n\nAdd or modify the following line:\nDefaults timestamp_timeout=[value]\nNote: The \"[value]\" must be a number that is greater than or equal to \"0\".\n\nRemove any duplicate or conflicting lines from /etc/sudoers and /etc/sudoers.d/ files." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000373-GPOS-00156", + "gid": "V-237643", + "rid": "SV-258084r861088_rule", + "stig_id": "RHEL-08-010384", + "fix_id": "F-40825r858763_fix", + "cci": [ + "CCI-002038" + ], + "nist": [ + "IA-11" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258085", + "code": "control 'SV-258085' do\n title %q(RHEL 8 must use the invoking user's password for privilege escalation\nwhen using \"sudo\".)\n desc %q(The sudoers security policy requires that users authenticate\nthemselves before they can use sudo. When sudoers requires authentication, it\nvalidates the invoking user's credentials. If the rootpw, targetpw, or runaspw\nflags are defined and not disabled, by default the operating system will prompt\nthe invoking user for the \"root\" user password.\n For more information on each of the listed configurations, reference the\nsudoers(5) manual page.)\n desc 'check', %q(Verify that the sudoers security policy is configured to use the invoking user's password for privilege escalation.\n\n $ sudo grep -Eir '(rootpw|targetpw|runaspw)' /etc/sudoers /etc/sudoers.d* | grep -v '#'\n\n /etc/sudoers:Defaults !targetpw\n /etc/sudoers:Defaults !rootpw\n /etc/sudoers:Defaults !runaspw\n\nIf conflicting results are returned, this is a finding.\nIf \"Defaults !targetpw\" is not defined, this is a finding.\nIf \"Defaults !rootpw\" is not defined, this is a finding.\nIf \"Defaults !runaspw\" is not defined, this is a finding.)\n desc 'fix', 'Define the following in the Defaults section of the /etc/sudoers file or a configuration file in the /etc/sudoers.d/ directory:\n Defaults !targetpw\n Defaults !rootpw\n Defaults !runaspw\n\nRemove any configurations that conflict with the above from the following locations:\n /etc/sudoers\n /etc/sudoers.d/'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-237642'\n tag rid: 'SV-258085r880727_rule'\n tag stig_id: 'RHEL-08-010383'\n tag fix_id: 'F-40824r880726_fix'\n tag cci: ['CCI-002227']\n tag nist: ['AC-6 (5)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers without sudo installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !command('sudo').exist?)\n }\n\n settings = sudoers(input('sudoers_config_files').join(' ')).settings['Defaults']\n\n describe 'Sudoers file(s) settings' do\n it 'should set !targetpw' do\n expect(settings).to include('!targetpw'), 'Sudoers file(s) do not set !targetpw'\n expect(settings).not_to include('targetpw'), 'Sudoers file(s) set targetpw'\n end\n it 'should set !rootpw' do\n expect(settings).to include('!rootpw'), 'Sudoers file(s) do not set !rootpw'\n expect(settings).not_to include('rootpw'), 'Sudoers file(s) set rootpw'\n end\n it 'should set !runaspw' do\n expect(settings).to include('!runaspw'), 'Sudoers file(s) do not set !runaspw'\n expect(settings).not_to include('runaspw'), 'Sudoers file(s) set runaspw'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258085.rb" + }, + "title": "RHEL 8 must use the invoking user's password for privilege escalation\nwhen using \"sudo\".", + "desc": "The sudoers security policy requires that users authenticate\nthemselves before they can use sudo. When sudoers requires authentication, it\nvalidates the invoking user's credentials. If the rootpw, targetpw, or runaspw\nflags are defined and not disabled, by default the operating system will prompt\nthe invoking user for the \"root\" user password.\n For more information on each of the listed configurations, reference the\nsudoers(5) manual page.", + "descriptions": { + "default": "The sudoers security policy requires that users authenticate\nthemselves before they can use sudo. When sudoers requires authentication, it\nvalidates the invoking user's credentials. If the rootpw, targetpw, or runaspw\nflags are defined and not disabled, by default the operating system will prompt\nthe invoking user for the \"root\" user password.\n For more information on each of the listed configurations, reference the\nsudoers(5) manual page.", + "check": "Verify that the sudoers security policy is configured to use the invoking user's password for privilege escalation.\n\n $ sudo grep -Eir '(rootpw|targetpw|runaspw)' /etc/sudoers /etc/sudoers.d* | grep -v '#'\n\n /etc/sudoers:Defaults !targetpw\n /etc/sudoers:Defaults !rootpw\n /etc/sudoers:Defaults !runaspw\n\nIf conflicting results are returned, this is a finding.\nIf \"Defaults !targetpw\" is not defined, this is a finding.\nIf \"Defaults !rootpw\" is not defined, this is a finding.\nIf \"Defaults !runaspw\" is not defined, this is a finding.", + "fix": "Define the following in the Defaults section of the /etc/sudoers file or a configuration file in the /etc/sudoers.d/ directory:\n Defaults !targetpw\n Defaults !rootpw\n Defaults !runaspw\n\nRemove any configurations that conflict with the above from the following locations:\n /etc/sudoers\n /etc/sudoers.d/" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-237642", + "rid": "SV-258085r880727_rule", + "stig_id": "RHEL-08-010383", + "fix_id": "F-40824r880726_fix", + "cci": [ + "CCI-002227" + ], + "nist": [ + "AC-6 (5)" + ], + "host": null + } + }, + { + "id": "SV-258086", + "code": "control 'SV-258086' do\n title 'RHEL 8 must require users to reauthenticate for privilege escalation.'\n desc 'Without reauthentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the user reauthenticate.'\n desc 'check', 'Verify that \"/etc/sudoers\" has no occurrences of \"!authenticate\".\n\n Check that the \"/etc/sudoers\" file has no occurrences of\n\"!authenticate\" by running the following command:\n\n $ sudo grep -i !authenticate /etc/sudoers /etc/sudoers.d/*\n\n If any occurrences of \"!authenticate\" return from the command, this is a\nfinding.'\n desc 'fix', 'Remove any occurrence of \"!authenticate\" found in\n\"/etc/sudoers\" file or files in the \"/etc/sudoers.d\" directory.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000373-GPOS-00156'\n tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158']\n tag gid: 'V-230272'\n tag rid: 'SV-258086r854027_rule'\n tag stig_id: 'RHEL-08-010381'\n tag fix_id: 'F-32916r567563_fix'\n tag cci: ['CCI-002038']\n tag nist: ['IA-11']\n tag 'host'\n tag 'container-conditional'\n\n only_if('Control not applicable within a container without sudo installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !command('sudo').exist?)\n }\n\n describe sudoers(input('sudoers_config_files')) do\n its('settings.Defaults') { should_not include '!authenticate' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258086.rb" + }, + "title": "RHEL 8 must require users to reauthenticate for privilege escalation.", + "desc": "Without reauthentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the user reauthenticate.", + "descriptions": { + "default": "Without reauthentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the user reauthenticate.", + "check": "Verify that \"/etc/sudoers\" has no occurrences of \"!authenticate\".\n\n Check that the \"/etc/sudoers\" file has no occurrences of\n\"!authenticate\" by running the following command:\n\n $ sudo grep -i !authenticate /etc/sudoers /etc/sudoers.d/*\n\n If any occurrences of \"!authenticate\" return from the command, this is a\nfinding.", + "fix": "Remove any occurrence of \"!authenticate\" found in\n\"/etc/sudoers\" file or files in the \"/etc/sudoers.d\" directory." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000373-GPOS-00156", + "satisfies": [ + "SRG-OS-000373-GPOS-00156", + "SRG-OS-000373-GPOS-00157", + "SRG-OS-000373-GPOS-00158" + ], + "gid": "V-230272", + "rid": "SV-258086r854027_rule", + "stig_id": "RHEL-08-010381", + "fix_id": "F-32916r567563_fix", + "cci": [ + "CCI-002038" + ], + "nist": [ + "IA-11" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258087", + "code": "control 'SV-258087' do\n title 'RHEL 8 must restrict privilege elevation to authorized personnel.'\n desc 'The sudo command allows a user to execute programs with elevated\n(administrator) privileges. It prompts the user for their password and confirms\nyour request to execute a command by checking a file, called sudoers. If the\n\"sudoers\" file is not configured correctly, any user defined on the system\ncan initiate privileged actions on the target system.'\n desc 'check', %q(Verify the \"sudoers\" file restricts sudo access to authorized personnel.\n$ sudo grep -iw 'ALL' /etc/sudoers /etc/sudoers.d/*\n\nIf the either of the following entries are returned, this is a finding:\nALL ALL=(ALL) ALL\nALL ALL=(ALL:ALL) ALL)\n desc 'fix', 'Remove the following entries from the sudoers file:\nALL ALL=(ALL) ALL\nALL ALL=(ALL:ALL) ALL'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-237641'\n tag rid: 'SV-258087r646893_rule'\n tag stig_id: 'RHEL-08-010382'\n tag fix_id: 'F-40823r646892_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers without sudo installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !command('sudo').exist?)\n }\n\n bad_sudoers_rules = sudoers(input('sudoers_config_files').join(' ')).rules.where {\n users == 'ALL' &&\n hosts == 'ALL' &&\n run_as.start_with?('ALL') &&\n commands == 'ALL'\n }\n\n describe 'Sudoers file(s)' do\n it 'should not contain any unrestricted sudo rules' do\n expect(bad_sudoers_rules.entries).to be_empty, \"Unrestricted sudo rules found; check sudoers file(s):\\n\\t- #{input('sudoers_config_files').join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258087.rb" + }, + "title": "RHEL 8 must restrict privilege elevation to authorized personnel.", + "desc": "The sudo command allows a user to execute programs with elevated\n(administrator) privileges. It prompts the user for their password and confirms\nyour request to execute a command by checking a file, called sudoers. If the\n\"sudoers\" file is not configured correctly, any user defined on the system\ncan initiate privileged actions on the target system.", + "descriptions": { + "default": "The sudo command allows a user to execute programs with elevated\n(administrator) privileges. It prompts the user for their password and confirms\nyour request to execute a command by checking a file, called sudoers. If the\n\"sudoers\" file is not configured correctly, any user defined on the system\ncan initiate privileged actions on the target system.", + "check": "Verify the \"sudoers\" file restricts sudo access to authorized personnel.\n$ sudo grep -iw 'ALL' /etc/sudoers /etc/sudoers.d/*\n\nIf the either of the following entries are returned, this is a finding:\nALL ALL=(ALL) ALL\nALL ALL=(ALL:ALL) ALL", + "fix": "Remove the following entries from the sudoers file:\nALL ALL=(ALL) ALL\nALL ALL=(ALL:ALL) ALL" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-237641", + "rid": "SV-258087r646893_rule", + "stig_id": "RHEL-08-010382", + "fix_id": "F-40823r646892_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258088", + "code": "control 'SV-258088' do\n title 'RHEL 9 must restrict the use of the \"su\" command.'\n desc 'The \"su\" program allows to run commands with a substitute user and group ID. It is commonly used to run commands as the root user. Limiting access to such commands is considered a good security practice.\n\n'\n desc 'check', 'Verify that RHEL 9 requires uses to be members of the \"wheel\" group with the following command:\n\n$ grep pam_wheel /etc/pam.d/su \n\nauth required pam_wheel.so use_uid \n\nIf a line for \"pam_wheel.so\" does not exist, or is commented out, this is a finding.'\n desc 'fix', %q(Configure RHEL 9 to require users to be in the \"wheel\" group to run \"su\" command.\n\nIn file \"/etc/pam.d/su\", uncomment the following line:\n\n\"#auth required pam_wheel.so use_uid\"\n\n$ sed '/^[[:space:]]*#[[:space:]]*auth[[:space:]]\\+required[[:space:]]\\+pam_wheel\\.so[[:space:]]\\+use_uid$/s/^[[:space:]]*#//' -i /etc/pam.d/su\n\nIf necessary, create a \"wheel\" group and add administrative users to the group.)\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61829r926249_chk'\n tag severity: 'medium'\n tag gid: 'V-258088'\n tag rid: 'SV-258088r926251_rule'\n tag stig_id: 'RHEL-09-432035'\n tag gtitle: 'SRG-OS-000373-GPOS-00156'\n tag fix_id: 'F-61753r926250_fix'\n tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000312-GPOS-00123']\n tag 'documentable'\n tag cci: ['CCI-002038', 'CCI-002165']\n tag nist: ['IA-11', 'AC-3 (4)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258088.rb" + }, + "title": "RHEL 9 must restrict the use of the \"su\" command.", + "desc": "The \"su\" program allows to run commands with a substitute user and group ID. It is commonly used to run commands as the root user. Limiting access to such commands is considered a good security practice.\n\n", + "descriptions": { + "default": "The \"su\" program allows to run commands with a substitute user and group ID. It is commonly used to run commands as the root user. Limiting access to such commands is considered a good security practice.\n\n", + "check": "Verify that RHEL 9 requires uses to be members of the \"wheel\" group with the following command:\n\n$ grep pam_wheel /etc/pam.d/su \n\nauth required pam_wheel.so use_uid \n\nIf a line for \"pam_wheel.so\" does not exist, or is commented out, this is a finding.", + "fix": "Configure RHEL 9 to require users to be in the \"wheel\" group to run \"su\" command.\n\nIn file \"/etc/pam.d/su\", uncomment the following line:\n\n\"#auth required pam_wheel.so use_uid\"\n\n$ sed '/^[[:space:]]*#[[:space:]]*auth[[:space:]]\\+required[[:space:]]\\+pam_wheel\\.so[[:space:]]\\+use_uid$/s/^[[:space:]]*#//' -i /etc/pam.d/su\n\nIf necessary, create a \"wheel\" group and add administrative users to the group." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61829r926249_chk", + "severity": "medium", + "gid": "V-258088", + "rid": "SV-258088r926251_rule", + "stig_id": "RHEL-09-432035", + "gtitle": "SRG-OS-000373-GPOS-00156", + "fix_id": "F-61753r926250_fix", + "satisfies": [ + "SRG-OS-000373-GPOS-00156", + "SRG-OS-000312-GPOS-00123" + ], + "documentable": null, + "cci": [ + "CCI-002038", + "CCI-002165" + ], + "nist": [ + "IA-11", + "AC-3 (4)" + ] + } + }, + { + "id": "SV-258089", + "code": "control 'SV-258089' do\n title 'The RHEL 8 fapolicy module must be installed.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.'\n desc 'check', 'Verify the RHEL 8 \"fapolicyd\" is installed.\n\nCheck that \"fapolicyd\" is installed with the following command:\n\n$ sudo yum list installed fapolicyd\n\nInstalled Packages\nfapolicyd.x86_64\n\nIf fapolicyd is not installed, this is a finding.'\n desc 'fix', 'Install \"fapolicyd\" with the following command:\n\n$ sudo yum install fapolicyd.x86_64'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155', 'SRG-OS-000480-GPOS-00232']\n tag gid: 'V-230523'\n tag rid: 'SV-258089r854064_rule'\n tag stig_id: 'RHEL-08-040135'\n tag fix_id: 'F-33167r744022_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if !input('use_fapolicyd')\n impact 0.0\n describe 'The organization is not using the Fapolicyd service to manage firewall servies, this control is Not Applicable' do\n skip 'The organization is not using the Fapolicyd service to manage firewall servies, this control is Not Applicable'\n end\n else\n describe package('fapolicyd') do\n it { should be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258089.rb" + }, + "title": "The RHEL 8 fapolicy module must be installed.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.", + "check": "Verify the RHEL 8 \"fapolicyd\" is installed.\n\nCheck that \"fapolicyd\" is installed with the following command:\n\n$ sudo yum list installed fapolicyd\n\nInstalled Packages\nfapolicyd.x86_64\n\nIf fapolicyd is not installed, this is a finding.", + "fix": "Install \"fapolicyd\" with the following command:\n\n$ sudo yum install fapolicyd.x86_64" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "satisfies": [ + "SRG-OS-000368-GPOS-00154", + "SRG-OS-000370-GPOS-00155", + "SRG-OS-000480-GPOS-00232" + ], + "gid": "V-230523", + "rid": "SV-258089r854064_rule", + "stig_id": "RHEL-08-040135", + "fix_id": "F-33167r744022_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-258090", + "code": "control 'SV-258090' do\n title 'The RHEL 8 fapolicy module must be enabled.'\n desc 'The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.'\n desc 'check', 'Verify the RHEL 8 \"fapolicyd\" is enabled and running with the following\ncommand:\n\n $ sudo systemctl status fapolicyd.service\n\n fapolicyd.service - File Access Policy Daemon\n Loaded: loaded (/usr/lib/systemd/system/fapolicyd.service; enabled; vendor\npreset: disabled)\n Active: active (running)\n\n If fapolicyd is not enabled and running, this is a finding.'\n desc 'fix', 'Enable \"fapolicyd\" using the following command:\n\n$ sudo systemctl enable --now fapolicyd'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155', 'SRG-OS-000480-GPOS-00232']\n tag gid: 'V-244545'\n tag rid: 'SV-258090r854074_rule'\n tag stig_id: 'RHEL-08-040136'\n tag fix_id: 'F-47777r743883_fix'\n tag cci: ['CCI-001764']\n tag nist: ['CM-7 (2)']\n tag 'host'\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'This requirement is Not Applicable in the container' do\n skip 'This requirement is Not Applicable in the container'\n end\n elsif !input('use_fapolicyd')\n impact 0.0\n describe 'The organization does not use the Fapolicyd service to manage firewall services' do\n skip 'The organization is not using the Fapolicyd service to manage firewall services, this control is Not Applicable'\n end\n else\n describe service('fapolicyd') do\n it { should be_enabled }\n it { should be_running }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258090.rb" + }, + "title": "The RHEL 8 fapolicy module must be enabled.", + "desc": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.", + "descriptions": { + "default": "The organization must identify authorized software programs and permit\nexecution of authorized software. The process used to identify software\nprograms that are authorized to execute on organizational information systems\nis commonly referred to as whitelisting.\n\n Utilizing a whitelist provides a configuration management method for\nallowing the execution of only authorized software. Using only authorized\nsoftware decreases risk by limiting the number of potential vulnerabilities.\nVerification of whitelisted software occurs prior to execution or at system\nstartup.\n\n User home directories/folders may contain information of a sensitive\nnature. Non-privileged users should coordinate any sharing of information with\nan SA through shared resources.\n\n RHEL 8 ships with many optional packages. One such package is a file access\npolicy daemon called \"fapolicyd\". \"fapolicyd\" is a userspace daemon that\ndetermines access rights to files based on attributes of the process and file.\nIt can be used to either blacklist or whitelist processes or file access.\n\n Proceed with caution with enforcing the use of this daemon. Improper\nconfiguration may render the system non-functional. The \"fapolicyd\" API is\nnot namespace aware and can cause issues when launching or running containers.", + "check": "Verify the RHEL 8 \"fapolicyd\" is enabled and running with the following\ncommand:\n\n $ sudo systemctl status fapolicyd.service\n\n fapolicyd.service - File Access Policy Daemon\n Loaded: loaded (/usr/lib/systemd/system/fapolicyd.service; enabled; vendor\npreset: disabled)\n Active: active (running)\n\n If fapolicyd is not enabled and running, this is a finding.", + "fix": "Enable \"fapolicyd\" using the following command:\n\n$ sudo systemctl enable --now fapolicyd" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000368-GPOS-00154", + "satisfies": [ + "SRG-OS-000368-GPOS-00154", + "SRG-OS-000370-GPOS-00155", + "SRG-OS-000480-GPOS-00232" + ], + "gid": "V-244545", + "rid": "SV-258090r854074_rule", + "stig_id": "RHEL-08-040136", + "fix_id": "F-47777r743883_fix", + "cci": [ + "CCI-001764" + ], + "nist": [ + "CM-7 (2)" + ], + "host": null + } + }, + { + "id": "SV-258091", + "code": "control 'SV-258091' do\n title 'RHEL 8 systems, version 8.4 and above, must ensure the password complexity module is configured for three retries or less.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 utilizes \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth\nBy limiting the number of attempts to meet the pwquality module complexity requirements before returning with an error, the system will audit abnormal attempts at password changes.'\n desc 'check', 'Note: This requirement applies to RHEL versions 8.4 or newer. If the system is RHEL below version 8.4, this requirement is not applicable.\n\nVerify the operating system is configured to limit the \"pwquality\" retry option to 3.\n\nCheck for the use of the \"pwquality\" retry option with the following command:\n\n$ sudo grep -r retry /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:retry = 3\n\nIf the value of \"retry\" is set to \"0\" or greater than \"3\", is commented out or missing, this is a finding.\n\nIf conflicting results are returned, this is a finding.\n\nCheck for the use of the \"pwquality\" retry option in the system-auth and password-auth files with the following command:\n\n$ sudo grep pwquality /etc/pam.d/system-auth /etc/pam.d/password-auth | grep retry\n\nIf the command returns any results, this is a finding.'\n desc 'fix', 'Configure the operating system to limit the \"pwquality\" retry option to 3.\n\nAdd the following line to the \"/etc/security/pwquality.conf\" file(or modify the line to have the required value):\n\nretry = 3\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag check_id: 'C-55153r858735_chk'\n tag severity: 'medium'\n tag gid: 'V-251716'\n tag rid: 'SV-258091r858737_rule'\n tag stig_id: 'RHEL-08-020104'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-55107r858736_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n only_if('This requirement only applies to RHEL 8 versions above 8.4', impact: 0.0) {\n os.release.to_f >= 8.4\n }\n\n describe 'System pwquality setting' do\n subject { parse_config(command('grep -rh retry /etc/security/pwquality.conf*').stdout.strip) }\n its('retry') { should cmp >= input('min_retry') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258091.rb" + }, + "title": "RHEL 8 systems, version 8.4 and above, must ensure the password complexity module is configured for three retries or less.", + "desc": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 utilizes \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth\nBy limiting the number of attempts to meet the pwquality module complexity requirements before returning with an error, the system will audit abnormal attempts at password changes.", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 utilizes \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth\nBy limiting the number of attempts to meet the pwquality module complexity requirements before returning with an error, the system will audit abnormal attempts at password changes.", + "check": "Note: This requirement applies to RHEL versions 8.4 or newer. If the system is RHEL below version 8.4, this requirement is not applicable.\n\nVerify the operating system is configured to limit the \"pwquality\" retry option to 3.\n\nCheck for the use of the \"pwquality\" retry option with the following command:\n\n$ sudo grep -r retry /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:retry = 3\n\nIf the value of \"retry\" is set to \"0\" or greater than \"3\", is commented out or missing, this is a finding.\n\nIf conflicting results are returned, this is a finding.\n\nCheck for the use of the \"pwquality\" retry option in the system-auth and password-auth files with the following command:\n\n$ sudo grep pwquality /etc/pam.d/system-auth /etc/pam.d/password-auth | grep retry\n\nIf the command returns any results, this is a finding.", + "fix": "Configure the operating system to limit the \"pwquality\" retry option to 3.\n\nAdd the following line to the \"/etc/security/pwquality.conf\" file(or modify the line to have the required value):\n\nretry = 3\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-55153r858735_chk", + "severity": "medium", + "gid": "V-251716", + "rid": "SV-258091r858737_rule", + "stig_id": "RHEL-08-020104", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-55107r858736_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258092", + "code": "control 'SV-258092' do\n title 'RHEL 8 must be configured in the password-auth file to prohibit password reuse for a minimum of five generations.'\n desc 'Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements.\n\n RHEL 8 uses \"pwhistory\" consecutively as a mechanism to prohibit password reuse. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth.\n\nNote that manual changes to the listed files may be overwritten by the \"authselect\" program.'\n desc 'check', 'Verify the operating system is configured in the password-auth file to prohibit password reuse for a minimum of five generations.\n\nCheck for the value of the \"remember\" argument in \"/etc/pam.d/password-auth\" with the following command:\n\n $ sudo grep -i remember /etc/pam.d/password-auth\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3\n\nIf the line containing \"pam_pwhistory.so\" does not have the \"remember\" module argument set, is commented out, or the value of the \"remember\" module argument is set to less than \"5\", this is a finding.'\n desc 'fix', 'Configure the operating system in the password-auth file to prohibit password reuse for a minimum of five generations.\n\nAdd the following line in \"/etc/pam.d/password-auth\" (or modify the line to have the required value):\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000077-GPOS-00045'\n tag gid: 'V-230368'\n tag rid: 'SV-258092r902759_rule'\n tag stig_id: 'RHEL-08-020220'\n tag fix_id: 'F-33012r902757_fix'\n tag cci: ['CCI-000200']\n tag nist: ['IA-5 (1) (e)']\n tag 'host'\n tag 'container'\n\n pam_auth_files = input('pam_auth_files')\n\n describe pam(pam_auth_files['password-auth']) do\n its('lines') { should match_pam_rule('password (required|requisite|sufficient) pam_pwhistory.so').any_with_integer_arg('remember', '>=', input('min_reuse_generations')) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258092.rb" + }, + "title": "RHEL 8 must be configured in the password-auth file to prohibit password reuse for a minimum of five generations.", + "desc": "Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements.\n\n RHEL 8 uses \"pwhistory\" consecutively as a mechanism to prohibit password reuse. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth.\n\nNote that manual changes to the listed files may be overwritten by the \"authselect\" program.", + "descriptions": { + "default": "Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements.\n\n RHEL 8 uses \"pwhistory\" consecutively as a mechanism to prohibit password reuse. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth.\n\nNote that manual changes to the listed files may be overwritten by the \"authselect\" program.", + "check": "Verify the operating system is configured in the password-auth file to prohibit password reuse for a minimum of five generations.\n\nCheck for the value of the \"remember\" argument in \"/etc/pam.d/password-auth\" with the following command:\n\n $ sudo grep -i remember /etc/pam.d/password-auth\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3\n\nIf the line containing \"pam_pwhistory.so\" does not have the \"remember\" module argument set, is commented out, or the value of the \"remember\" module argument is set to less than \"5\", this is a finding.", + "fix": "Configure the operating system in the password-auth file to prohibit password reuse for a minimum of five generations.\n\nAdd the following line in \"/etc/pam.d/password-auth\" (or modify the line to have the required value):\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000077-GPOS-00045", + "gid": "V-230368", + "rid": "SV-258092r902759_rule", + "stig_id": "RHEL-08-020220", + "fix_id": "F-33012r902757_fix", + "cci": [ + "CCI-000200" + ], + "nist": [ + "IA-5 (1) (e)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258093", + "code": "control 'SV-258093' do\n title 'RHEL 8 must be configured in the system-auth file to prohibit password reuse for a minimum of five generations.'\n desc 'Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements.\n\nRHEL 8 uses \"pwhistory\" consecutively as a mechanism to prohibit password reuse. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth.\n\nNote that manual changes to the listed files may be overwritten by the \"authselect\" program.'\n desc 'check', 'Verify the operating system is configured in the system-auth file to prohibit password reuse for a minimum of five generations.\n\nCheck for the value of the \"remember\" argument in \"/etc/pam.d/system-auth\" with the following command:\n\n $ sudo grep -i remember /etc/pam.d/system-auth\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3\n\nIf the line containing \"pam_pwhistory.so\" does not have the \"remember\" module argument set, is commented out, or the value of the \"remember\" module argument is set to less than \"5\", this is a finding.'\n desc 'fix', 'Configure the operating system in the system-auth file to prohibit password reuse for a minimum of five generations.\n\nAdd the following line in \"/etc/pam.d/system-auth\" (or modify the line to have the required value):\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3'\n impact 0.5\n tag check_id: 'C-55154r902747_chk'\n tag severity: 'medium'\n tag gid: 'V-251717'\n tag rid: 'SV-258093r902749_rule'\n tag stig_id: 'RHEL-08-020221'\n tag gtitle: 'SRG-OS-000077-GPOS-00045'\n tag fix_id: 'F-55108r902748_fix'\n tag 'documentable'\n tag cci: ['CCI-000200']\n tag nist: ['IA-5 (1) (e)']\n tag 'host'\n tag 'container'\n\n pam_auth_files = input('pam_auth_files')\n\n describe pam(pam_auth_files['system-auth']) do\n its('lines') { should match_pam_rule('password (required|requisite|sufficient) pam_pwhistory.so').any_with_integer_arg('remember', '>=', input('min_reuse_generations')) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258093.rb" + }, + "title": "RHEL 8 must be configured in the system-auth file to prohibit password reuse for a minimum of five generations.", + "desc": "Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements.\n\nRHEL 8 uses \"pwhistory\" consecutively as a mechanism to prohibit password reuse. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth.\n\nNote that manual changes to the listed files may be overwritten by the \"authselect\" program.", + "descriptions": { + "default": "Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements.\n\nRHEL 8 uses \"pwhistory\" consecutively as a mechanism to prohibit password reuse. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth.\n\nNote that manual changes to the listed files may be overwritten by the \"authselect\" program.", + "check": "Verify the operating system is configured in the system-auth file to prohibit password reuse for a minimum of five generations.\n\nCheck for the value of the \"remember\" argument in \"/etc/pam.d/system-auth\" with the following command:\n\n $ sudo grep -i remember /etc/pam.d/system-auth\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3\n\nIf the line containing \"pam_pwhistory.so\" does not have the \"remember\" module argument set, is commented out, or the value of the \"remember\" module argument is set to less than \"5\", this is a finding.", + "fix": "Configure the operating system in the system-auth file to prohibit password reuse for a minimum of five generations.\n\nAdd the following line in \"/etc/pam.d/system-auth\" (or modify the line to have the required value):\n\n password requisite pam_pwhistory.so use_authtok remember=5 retry=3" + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-55154r902747_chk", + "severity": "medium", + "gid": "V-251717", + "rid": "SV-258093r902749_rule", + "stig_id": "RHEL-08-020221", + "gtitle": "SRG-OS-000077-GPOS-00045", + "fix_id": "F-55108r902748_fix", + "documentable": null, + "cci": [ + "CCI-000200" + ], + "nist": [ + "IA-5 (1) (e)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258094", + "code": "control 'SV-258094' do\n title 'RHEL 9 must not allow blank or null passwords.'\n desc 'If an account has an empty password, anyone could log in and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.'\n desc 'check', 'Verify that null passwords cannot be used with the following command:\n\n$ sudo grep -i nullok /etc/pam.d/system-auth /etc/pam.d/password-auth\n\nIf output is produced, this is a finding.'\n desc 'fix', 'Remove any instances of the \"nullok\" option in the \"/etc/pam.d/password-auth\" and \"/etc/pam.d/system-auth\" files to prevent logons with empty passwords.\n\nNote: Manual changes to the listed file may be overwritten by the \"authselect\" program.'\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61835r926267_chk'\n tag severity: 'high'\n tag gid: 'V-258094'\n tag rid: 'SV-258094r926269_rule'\n tag stig_id: 'RHEL-09-611025'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61759r926268_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258094.rb" + }, + "title": "RHEL 9 must not allow blank or null passwords.", + "desc": "If an account has an empty password, anyone could log in and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.", + "descriptions": { + "default": "If an account has an empty password, anyone could log in and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.", + "check": "Verify that null passwords cannot be used with the following command:\n\n$ sudo grep -i nullok /etc/pam.d/system-auth /etc/pam.d/password-auth\n\nIf output is produced, this is a finding.", + "fix": "Remove any instances of the \"nullok\" option in the \"/etc/pam.d/password-auth\" and \"/etc/pam.d/system-auth\" files to prevent logons with empty passwords.\n\nNote: Manual changes to the listed file may be overwritten by the \"authselect\" program." + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61835r926267_chk", + "severity": "high", + "gid": "V-258094", + "rid": "SV-258094r926269_rule", + "stig_id": "RHEL-09-611025", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61759r926268_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258095", + "code": "control 'SV-258095' do\n title 'RHEL 8 must configure the use of the pam_faillock.so module in the\n/etc/pam.d/system-auth file.'\n desc 'By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.\n The preauth argument must be used when the module is called before the\nmodules which ask for the user credentials such as the password.'\n desc 'check', 'Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the pam_faillock.so module is present in the\n\"/etc/pam.d/system-auth\" file:\n\n $ sudo grep pam_faillock.so /etc/pam.d/system-auth\n\n auth required pam_faillock.so\npreauth\n auth required pam_faillock.so\nauthfail\n account required pam_faillock.so\n If the pam_faillock.so module is not present in the\n\"/etc/pam.d/system-auth\" file with the \"preauth\" line listed before\npam_unix.so, this is a finding.'\n desc 'fix', 'Configure the operating system to include the use of the pam_faillock.so\nmodule in the /etc/pam.d/system-auth file.\n\n Add/Modify the appropriate sections of the \"/etc/pam.d/system-auth\" file\nto match the following lines:\n Note: The \"preauth\" line must be listed before pam_unix.so.\n\n auth required pam_faillock.so preauth\n auth required pam_faillock.so authfail\n account required pam_faillock.so'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128']\n tag gid: 'V-244533'\n tag rid: 'SV-258095r743848_rule'\n tag stig_id: 'RHEL-08-020025'\n tag fix_id: 'F-47765r743847_fix'\n tag cci: ['CCI-000044']\n tag nist: ['AC-7 a']\n tag 'host'\n tag 'container'\n\n only_if('This check applies to RHEL versions 8.2 or newer, if the system is RHEL version 8.0 or 8.1, this check is not applicable.', impact: 0.0) {\n (os.release.to_f) >= 8.2\n }\n\n pam_auth_files = input('pam_auth_files')\n\n describe pam(pam_auth_files['system-auth']) do\n its('lines') { should match_pam_rule('auth required pam_faillock.so preauth') }\n its('lines') { should match_pam_rule('auth required pam_faillock.so authfail') }\n its('lines') { should match_pam_rule('account required pam_faillock.so') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258095.rb" + }, + "title": "RHEL 8 must configure the use of the pam_faillock.so module in the\n/etc/pam.d/system-auth file.", + "desc": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.\n The preauth argument must be used when the module is called before the\nmodules which ask for the user credentials such as the password.", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.\n The preauth argument must be used when the module is called before the\nmodules which ask for the user credentials such as the password.", + "check": "Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the pam_faillock.so module is present in the\n\"/etc/pam.d/system-auth\" file:\n\n $ sudo grep pam_faillock.so /etc/pam.d/system-auth\n\n auth required pam_faillock.so\npreauth\n auth required pam_faillock.so\nauthfail\n account required pam_faillock.so\n If the pam_faillock.so module is not present in the\n\"/etc/pam.d/system-auth\" file with the \"preauth\" line listed before\npam_unix.so, this is a finding.", + "fix": "Configure the operating system to include the use of the pam_faillock.so\nmodule in the /etc/pam.d/system-auth file.\n\n Add/Modify the appropriate sections of the \"/etc/pam.d/system-auth\" file\nto match the following lines:\n Note: The \"preauth\" line must be listed before pam_unix.so.\n\n auth required pam_faillock.so preauth\n auth required pam_faillock.so authfail\n account required pam_faillock.so" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000021-GPOS-00005", + "satisfies": [ + "SRG-OS-000021-GPOS-00005", + "SRG-OS-000329-GPOS-00128" + ], + "gid": "V-244533", + "rid": "SV-258095r743848_rule", + "stig_id": "RHEL-08-020025", + "fix_id": "F-47765r743847_fix", + "cci": [ + "CCI-000044" + ], + "nist": [ + "AC-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258096", + "code": "control 'SV-258096' do\n title 'RHEL 8 must configure the use of the pam_faillock.so module in the\n/etc/pam.d/password-auth file.'\n desc 'By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.\n The preauth argument must be used when the module is called before the\nmodules which ask for the user credentials such as the password.'\n desc 'check', 'Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the pam_faillock.so module is present in the\n\"/etc/pam.d/password-auth\" file:\n\n $ sudo grep pam_faillock.so /etc/pam.d/password-auth\n\n auth required pam_faillock.so\npreauth\n auth required pam_faillock.so\nauthfail\n account required pam_faillock.so\n\n If the pam_faillock.so module is not present in the\n\"/etc/pam.d/password-auth\" file with the \"preauth\" line listed before\npam_unix.so, this is a finding.'\n desc 'fix', 'Configure the operating system to include the use of the pam_faillock.so\nmodule in the /etc/pam.d/password-auth file.\n\n Add/Modify the appropriate sections of the \"/etc/pam.d/password-auth\"\nfile to match the following lines:\n Note: The \"preauth\" line must be listed before pam_unix.so.\n\n auth required pam_faillock.so preauth\n auth required pam_faillock.so authfail\n account required pam_faillock.so'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag satisfies: ['SRG-OS-000021-GPOS-00005', 'SRG-OS-000329-GPOS-00128']\n tag gid: 'V-244534'\n tag rid: 'SV-258096r743851_rule'\n tag stig_id: 'RHEL-08-020026'\n tag fix_id: 'F-47766r743850_fix'\n tag cci: ['CCI-000044']\n tag nist: ['AC-7 a']\n tag 'host'\n tag 'container'\n\n only_if('This check applies to RHEL versions 8.2 or newer, if the system is RHEL version 8.0 or 8.1, this check is not applicable.', impact: 0.0) {\n (os.release.to_f) >= 8.2\n }\n\n describe pam('/etc/pam.d/password-auth') do\n its('lines') { should match_pam_rule('auth required pam_faillock.so preauth') }\n its('lines') { should match_pam_rule('auth required pam_faillock.so authfail') }\n its('lines') { should match_pam_rule('account required pam_faillock.so') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258096.rb" + }, + "title": "RHEL 8 must configure the use of the pam_faillock.so module in the\n/etc/pam.d/password-auth file.", + "desc": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.\n The preauth argument must be used when the module is called before the\nmodules which ask for the user credentials such as the password.", + "descriptions": { + "default": "By limiting the number of failed logon attempts, the risk of\nunauthorized system access via user password guessing, otherwise known as\nbrute-force attacks, is reduced. Limits are imposed by locking the account.\n\n In RHEL 8.2 the \"/etc/security/faillock.conf\" file was incorporated to\ncentralize the configuration of the pam_faillock.so module. Also introduced is\na \"local_users_only\" option that will only track failed user authentication\nattempts for local users in /etc/passwd and ignore centralized (AD, IdM, LDAP,\netc.) users to allow the centralized platform to solely manage user lockout.\n\n From \"faillock.conf\" man pages: Note that the default directory that\n\"pam_faillock\" uses is usually cleared on system boot so the access will be\nreenabled after system reboot. If that is undesirable a different tally\ndirectory must be set with the \"dir\" option.\n The preauth argument must be used when the module is called before the\nmodules which ask for the user credentials such as the password.", + "check": "Note: This check applies to RHEL versions 8.2 or newer, if the system is\nRHEL version 8.0 or 8.1, this check is not applicable.\n\n Verify the pam_faillock.so module is present in the\n\"/etc/pam.d/password-auth\" file:\n\n $ sudo grep pam_faillock.so /etc/pam.d/password-auth\n\n auth required pam_faillock.so\npreauth\n auth required pam_faillock.so\nauthfail\n account required pam_faillock.so\n\n If the pam_faillock.so module is not present in the\n\"/etc/pam.d/password-auth\" file with the \"preauth\" line listed before\npam_unix.so, this is a finding.", + "fix": "Configure the operating system to include the use of the pam_faillock.so\nmodule in the /etc/pam.d/password-auth file.\n\n Add/Modify the appropriate sections of the \"/etc/pam.d/password-auth\"\nfile to match the following lines:\n Note: The \"preauth\" line must be listed before pam_unix.so.\n\n auth required pam_faillock.so preauth\n auth required pam_faillock.so authfail\n account required pam_faillock.so" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000021-GPOS-00005", + "satisfies": [ + "SRG-OS-000021-GPOS-00005", + "SRG-OS-000329-GPOS-00128" + ], + "gid": "V-244534", + "rid": "SV-258096r743851_rule", + "stig_id": "RHEL-08-020026", + "fix_id": "F-47766r743850_fix", + "cci": [ + "CCI-000044" + ], + "nist": [ + "AC-7 a" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258097", + "code": "control 'SV-258097' do\n title 'RHEL 8 must ensure the password complexity module is enabled in the password-auth file.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 utilizes \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth'\n desc 'check', 'Verify the operating system uses \"pwquality\" to enforce the password complexity rules.\n\nCheck for the use of \"pwquality\" in the password-auth file with the following command:\n\n $ sudo cat /etc/pam.d/password-auth | grep pam_pwquality\n\n password requisite pam_pwquality.so\n\nIf the command does not return a line containing the value \"pam_pwquality.so\" as shown, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure the operating system to use \"pwquality\" to enforce password complexity rules.\n\nAdd the following line to the \"/etc/pam.d/password-auth\" file (or modify the line to have the required value):\n\n password requisite pam_pwquality.so'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000069-GPOS-00037'\n tag gid: 'V-230356'\n tag rid: 'SV-258097r902728_rule'\n tag stig_id: 'RHEL-08-020100'\n tag fix_id: 'F-33000r902727_fix'\n tag cci: ['CCI-000192', 'CCI-000366']\n tag nist: ['IA-5 (1) (a)', 'CM-6 b']\n tag 'host'\n tag 'container'\n\n pam_auth_files = input('pam_auth_files')\n\n describe pam(pam_auth_files['password-auth']) do\n its('lines') { should match_pam_rule('password (required|requisite) pam_pwquality.so') }\n end\n describe pam(pam_auth_files['system-auth']) do\n its('lines') { should match_pam_rule('password (required|requisite) pam_pwquality.so') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258097.rb" + }, + "title": "RHEL 8 must ensure the password complexity module is enabled in the password-auth file.", + "desc": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 utilizes \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 utilizes \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth", + "check": "Verify the operating system uses \"pwquality\" to enforce the password complexity rules.\n\nCheck for the use of \"pwquality\" in the password-auth file with the following command:\n\n $ sudo cat /etc/pam.d/password-auth | grep pam_pwquality\n\n password requisite pam_pwquality.so\n\nIf the command does not return a line containing the value \"pam_pwquality.so\" as shown, or the line is commented out, this is a finding.", + "fix": "Configure the operating system to use \"pwquality\" to enforce password complexity rules.\n\nAdd the following line to the \"/etc/pam.d/password-auth\" file (or modify the line to have the required value):\n\n password requisite pam_pwquality.so" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000069-GPOS-00037", + "gid": "V-230356", + "rid": "SV-258097r902728_rule", + "stig_id": "RHEL-08-020100", + "fix_id": "F-33000r902727_fix", + "cci": [ + "CCI-000192", + "CCI-000366" + ], + "nist": [ + "IA-5 (1) (a)", + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258098", + "code": "control 'SV-258098' do\n title 'RHEL 8 must ensure the password complexity module is enabled in the system-auth file.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 uses \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth'\n desc 'check', 'Verify the operating system uses \"pwquality\" to enforce the password complexity rules.\n\nCheck for the use of \"pwquality\" in the system-auth file with the following command:\n\n $ sudo cat /etc/pam.d/system-auth | grep pam_pwquality\n\n password requisite pam_pwquality.so\n\nIf the command does not return a line containing the value \"pam_pwquality.so\" as shown, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure the operating system to use \"pwquality\" to enforce password complexity rules.\n\nAdd the following line to the \"/etc/pam.d/system-auth\" file (or modify the line to have the required value):\n\n password requisite pam_pwquality.so'\n impact 0.5\n tag check_id: 'C-55150r902738_chk'\n tag severity: 'medium'\n tag gid: 'V-251713'\n tag rid: 'SV-258098r902740_rule'\n tag stig_id: 'RHEL-08-020101'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-55104r902739_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n pam_auth_files = input('pam_auth_files')\n\n [pam_auth_files['password-auth'], pam_auth_files['system-auth']].each do |path|\n describe pam(path) do\n its('lines') { should match_pam_rule('.* .* pam_pwquality.so') }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258098.rb" + }, + "title": "RHEL 8 must ensure the password complexity module is enabled in the system-auth file.", + "desc": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 uses \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.\n\nRHEL 8 uses \"pwquality\" as a mechanism to enforce password complexity. This is set in both:\n/etc/pam.d/password-auth\n/etc/pam.d/system-auth", + "check": "Verify the operating system uses \"pwquality\" to enforce the password complexity rules.\n\nCheck for the use of \"pwquality\" in the system-auth file with the following command:\n\n $ sudo cat /etc/pam.d/system-auth | grep pam_pwquality\n\n password requisite pam_pwquality.so\n\nIf the command does not return a line containing the value \"pam_pwquality.so\" as shown, or the line is commented out, this is a finding.", + "fix": "Configure the operating system to use \"pwquality\" to enforce password complexity rules.\n\nAdd the following line to the \"/etc/pam.d/system-auth\" file (or modify the line to have the required value):\n\n password requisite pam_pwquality.so" + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-55150r902738_chk", + "severity": "medium", + "gid": "V-251713", + "rid": "SV-258098r902740_rule", + "stig_id": "RHEL-08-020101", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-55104r902739_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258099", + "code": "control 'SV-258099' do\n title 'RHEL 9 password-auth must be configured to use a sufficient number of hashing rounds.'\n desc 'Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nUsing more hashing rounds makes password cracking attacks more difficult.\n\n'\n desc 'check', 'Verify the number of rounds for the password hashing algorithm is configured with the following command:\n\n$ sudo grep rounds /etc/pam.d/password-auth\n\npassword sufficient pam_unix.so sha512 rounds=5000\n\nIf a matching line is not returned or \"rounds\" is less than \"5000\", this a finding.'\n desc 'fix', 'Configure Red Hat Enterprise Linux 9 to use 5000 hashing rounds for hashing passwords.\n\nAdd or modify the following line in \"/etc/pam.d/password-auth\" and set \"rounds\" to \"5000\".\n\npassword sufficient pam_unix.so sha512 rounds=5000'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61840r926282_chk'\n tag severity: 'medium'\n tag gid: 'V-258099'\n tag rid: 'SV-258099r926284_rule'\n tag stig_id: 'RHEL-09-611050'\n tag gtitle: 'SRG-OS-000073-GPOS-00041'\n tag fix_id: 'F-61764r926283_fix'\n tag satisfies: ['SRG-OS-000073-GPOS-00041', 'SRG-OS-000120-GPOS-00061']\n tag 'documentable'\n tag cci: ['CCI-000196', 'CCI-000803']\n tag nist: ['IA-5 (1) (c)', 'IA-7']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258099.rb" + }, + "title": "RHEL 9 password-auth must be configured to use a sufficient number of hashing rounds.", + "desc": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nUsing more hashing rounds makes password cracking attacks more difficult.\n\n", + "descriptions": { + "default": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nUsing more hashing rounds makes password cracking attacks more difficult.\n\n", + "check": "Verify the number of rounds for the password hashing algorithm is configured with the following command:\n\n$ sudo grep rounds /etc/pam.d/password-auth\n\npassword sufficient pam_unix.so sha512 rounds=5000\n\nIf a matching line is not returned or \"rounds\" is less than \"5000\", this a finding.", + "fix": "Configure Red Hat Enterprise Linux 9 to use 5000 hashing rounds for hashing passwords.\n\nAdd or modify the following line in \"/etc/pam.d/password-auth\" and set \"rounds\" to \"5000\".\n\npassword sufficient pam_unix.so sha512 rounds=5000" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61840r926282_chk", + "severity": "medium", + "gid": "V-258099", + "rid": "SV-258099r926284_rule", + "stig_id": "RHEL-09-611050", + "gtitle": "SRG-OS-000073-GPOS-00041", + "fix_id": "F-61764r926283_fix", + "satisfies": [ + "SRG-OS-000073-GPOS-00041", + "SRG-OS-000120-GPOS-00061" + ], + "documentable": null, + "cci": [ + "CCI-000196", + "CCI-000803" + ], + "nist": [ + "IA-5 (1) (c)", + "IA-7" + ] + } + }, + { + "id": "SV-258100", + "code": "control 'SV-258100' do\n title 'RHEL 9 system-auth must be configured to use a sufficient number of hashing rounds.'\n desc 'Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nUsing more hashing rounds makes password cracking attacks more difficult.\n\n'\n desc 'check', 'Verify the number of rounds for the password hashing algorithm is configured with the following command:\n\n$ sudo grep rounds /etc/pam.d/system-auth\n\npassword sufficient pam_unix.so sha512 rounds=5000\n\nIf a matching line is not returned or \"rounds\" is less than 5000, this a finding.'\n desc 'fix', %q(Configure Red Hat Enterprise Linux 9 to use 5000 hashing rounds for hashing passwords.\n\nAdd or modify the following line in \"/etc/pam.d/system-auth\" and set \"rounds\" to 5000.\n\npassword sufficient pam_unix.so sha512 rounds=5000')\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61841r926285_chk'\n tag severity: 'medium'\n tag gid: 'V-258100'\n tag rid: 'SV-258100r926287_rule'\n tag stig_id: 'RHEL-09-611055'\n tag gtitle: 'SRG-OS-000073-GPOS-00041'\n tag fix_id: 'F-61765r926286_fix'\n tag satisfies: ['SRG-OS-000073-GPOS-00041', 'SRG-OS-000120-GPOS-00061']\n tag 'documentable'\n tag cci: ['CCI-000196', 'CCI-000803']\n tag nist: ['IA-5 (1) (c)', 'IA-7']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258100.rb" + }, + "title": "RHEL 9 system-auth must be configured to use a sufficient number of hashing rounds.", + "desc": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nUsing more hashing rounds makes password cracking attacks more difficult.\n\n", + "descriptions": { + "default": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nUsing more hashing rounds makes password cracking attacks more difficult.\n\n", + "check": "Verify the number of rounds for the password hashing algorithm is configured with the following command:\n\n$ sudo grep rounds /etc/pam.d/system-auth\n\npassword sufficient pam_unix.so sha512 rounds=5000\n\nIf a matching line is not returned or \"rounds\" is less than 5000, this a finding.", + "fix": "Configure Red Hat Enterprise Linux 9 to use 5000 hashing rounds for hashing passwords.\n\nAdd or modify the following line in \"/etc/pam.d/system-auth\" and set \"rounds\" to 5000.\n\npassword sufficient pam_unix.so sha512 rounds=5000'" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61841r926285_chk", + "severity": "medium", + "gid": "V-258100", + "rid": "SV-258100r926287_rule", + "stig_id": "RHEL-09-611055", + "gtitle": "SRG-OS-000073-GPOS-00041", + "fix_id": "F-61765r926286_fix", + "satisfies": [ + "SRG-OS-000073-GPOS-00041", + "SRG-OS-000120-GPOS-00061" + ], + "documentable": null, + "cci": [ + "CCI-000196", + "CCI-000803" + ], + "nist": [ + "IA-5 (1) (c)", + "IA-7" + ] + } + }, + { + "id": "SV-258101", + "code": "control 'SV-258101' do\n title 'RHEL 9 must enforce password complexity rules for the root account.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks.\n\nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.\n\n'\n desc 'check', 'Verify that RHEL 9 enforces password complexity rules for the root account.\n\nCheck if root user is required to use complex passwords with the following command:\n\n$ grep enforce_for_root /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf\n\n/etc/security/pwquality.conf:enforce_for_root\n\nIf \"enforce_for_root\" is commented or missing, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to enforce password complexity on the root account.\n\nAdd or update the following line in /etc/security/pwquality.conf:\n\nenforce_for_root'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61842r926288_chk'\n tag severity: 'medium'\n tag gid: 'V-258101'\n tag rid: 'SV-258101r926290_rule'\n tag stig_id: 'RHEL-09-611060'\n tag gtitle: 'SRG-OS-000072-GPOS-00040'\n tag fix_id: 'F-61766r926289_fix'\n tag satisfies: ['SRG-OS-000072-GPOS-00040', 'SRG-OS-000071-GPOS-00039', 'SRG-OS-000070-GPOS-00038', 'SRG-OS-000266-GPOS-00101', 'SRG-OS-000078-GPOS-00046', 'SRG-OS-000480-GPOS-00225', 'SRG-OS-000069-GPOS-00037']\n tag 'documentable'\n tag cci: ['CCI-000192', 'CCI-000193', 'CCI-000194', 'CCI-000195', 'CCI-000205', 'CCI-000366', 'CCI-001619']\n tag nist: ['IA-5 (1) (a)', 'IA-5 (1) (a)', 'IA-5 (1) (a)', 'IA-5 (1) (b)', 'IA-5 (1) (a)', 'CM-6 b', 'IA-5 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258101.rb" + }, + "title": "RHEL 9 must enforce password complexity rules for the root account.", + "desc": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks.\n\nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.\n\n", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks.\n\nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.\n\n", + "check": "Verify that RHEL 9 enforces password complexity rules for the root account.\n\nCheck if root user is required to use complex passwords with the following command:\n\n$ grep enforce_for_root /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf\n\n/etc/security/pwquality.conf:enforce_for_root\n\nIf \"enforce_for_root\" is commented or missing, this is a finding.", + "fix": "Configure RHEL 9 to enforce password complexity on the root account.\n\nAdd or update the following line in /etc/security/pwquality.conf:\n\nenforce_for_root" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61842r926288_chk", + "severity": "medium", + "gid": "V-258101", + "rid": "SV-258101r926290_rule", + "stig_id": "RHEL-09-611060", + "gtitle": "SRG-OS-000072-GPOS-00040", + "fix_id": "F-61766r926289_fix", + "satisfies": [ + "SRG-OS-000072-GPOS-00040", + "SRG-OS-000071-GPOS-00039", + "SRG-OS-000070-GPOS-00038", + "SRG-OS-000266-GPOS-00101", + "SRG-OS-000078-GPOS-00046", + "SRG-OS-000480-GPOS-00225", + "SRG-OS-000069-GPOS-00037" + ], + "documentable": null, + "cci": [ + "CCI-000192", + "CCI-000193", + "CCI-000194", + "CCI-000195", + "CCI-000205", + "CCI-000366", + "CCI-001619" + ], + "nist": [ + "IA-5 (1) (a)", + "IA-5 (1) (a)", + "IA-5 (1) (a)", + "IA-5 (1) (b)", + "IA-5 (1) (a)", + "CM-6 b", + "IA-5 (1) (a)" + ] + } + }, + { + "id": "SV-258102", + "code": "control 'SV-258102' do\n title 'RHEL 8 must enforce password complexity by requiring that at least one\nlower-case character be used.'\n desc 'Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes pwquality as a mechanism to enforce password complexity.\nNote that in order to require lower-case characters without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".'\n desc 'check', 'Verify the value for \"lcredit\" with the following command:\n\n$ sudo grep -r lcredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:lcredit = -1\n\nIf the value of \"lcredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to enforce password complexity by requiring that at least one lower-case character be used by setting the \"lcredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\nlcredit = -1\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000070-GPOS-00038'\n tag gid: 'V-230358'\n tag rid: 'SV-258102r858773_rule'\n tag stig_id: 'RHEL-08-020120'\n tag fix_id: 'F-33002r858772_fix'\n tag cci: ['CCI-000193']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting) { 'lcredit' }\n let(:value) { Array(config.params[setting]) }\n\n it 'has `lcredit` set' do\n expect(value).not_to be_empty, 'lcredit is not set in pwquality.conf'\n end\n\n it 'only sets `lcredit` once' do\n expect(value.length).to eq(1), 'lcredit is commented or set more than once in pwquality.conf'\n end\n\n it 'does not set `lcredit` to a positive value' do\n expect(value.first.to_i).to be < 0, 'lcredit is not set to a negative value in pwquality.conf'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258102.rb" + }, + "title": "RHEL 8 must enforce password complexity by requiring that at least one\nlower-case character be used.", + "desc": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes pwquality as a mechanism to enforce password complexity.\nNote that in order to require lower-case characters without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes pwquality as a mechanism to enforce password complexity.\nNote that in order to require lower-case characters without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "check": "Verify the value for \"lcredit\" with the following command:\n\n$ sudo grep -r lcredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:lcredit = -1\n\nIf the value of \"lcredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to enforce password complexity by requiring that at least one lower-case character be used by setting the \"lcredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\nlcredit = -1\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000070-GPOS-00038", + "gid": "V-230358", + "rid": "SV-258102r858773_rule", + "stig_id": "RHEL-08-020120", + "fix_id": "F-33002r858772_fix", + "cci": [ + "CCI-000193" + ], + "nist": [ + "IA-5 (1) (a)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258103", + "code": "control 'SV-258103' do\n title 'RHEL 8 must enforce password complexity by requiring that at least one\nnumeric character be used.'\n desc 'Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Note that in order to require numeric characters, without degrading\nthe minlen value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".'\n desc 'check', 'Verify the value for \"dcredit\" with the following command:\n\n$ sudo grep -r dcredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:dcredit = -1\n\nIf the value of \"dcredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to enforce password complexity by requiring that at least one numeric character be used by setting the \"dcredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\ndcredit = -1\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000071-GPOS-00039'\n tag gid: 'V-230359'\n tag rid: 'SV-258103r858775_rule'\n tag stig_id: 'RHEL-08-020130'\n tag fix_id: 'F-33003r858774_fix'\n tag cci: ['CCI-000194']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting) { 'dcredit' }\n let(:value) { Array(config.params[setting]) }\n\n it 'has `dcredit` set' do\n expect(value).not_to be_empty, 'dcredit is not set in pwquality.conf'\n end\n\n it 'only sets `dcredit` once' do\n expect(value.length).to eq(1), 'dcredit is commented or set more than once in pwquality.conf'\n end\n\n it 'does not set `dcredit` to a positive value' do\n expect(value.first.to_i).to be < 0, 'dcredit is not set to a negative value in pwquality.conf'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258103.rb" + }, + "title": "RHEL 8 must enforce password complexity by requiring that at least one\nnumeric character be used.", + "desc": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Note that in order to require numeric characters, without degrading\nthe minlen value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Note that in order to require numeric characters, without degrading\nthe minlen value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "check": "Verify the value for \"dcredit\" with the following command:\n\n$ sudo grep -r dcredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:dcredit = -1\n\nIf the value of \"dcredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to enforce password complexity by requiring that at least one numeric character be used by setting the \"dcredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\ndcredit = -1\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000071-GPOS-00039", + "gid": "V-230359", + "rid": "SV-258103r858775_rule", + "stig_id": "RHEL-08-020130", + "fix_id": "F-33003r858774_fix", + "cci": [ + "CCI-000194" + ], + "nist": [ + "IA-5 (1) (a)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258104", + "code": "control 'SV-258104' do\n title 'RHEL 8 passwords for new users or password changes must have a 24 hours/1 day minimum password lifetime restriction in /etc/login.defs.'\n desc \"Enforcing a minimum password lifetime helps to prevent repeated\npassword changes to defeat the password reuse or history enforcement\nrequirement. If users are allowed to immediately and continually change their\npassword, the password could be repeatedly changed in a short period of time to\ndefeat the organization's policy regarding password reuse.\"\n desc 'check', 'Verify the operating system enforces 24 hours/1 day as the minimum password\nlifetime for new user accounts.\n\n Check for the value of \"PASS_MIN_DAYS\" in \"/etc/login.defs\" with the\nfollowing command:\n\n $ sudo grep -i pass_min_days /etc/login.defs\n PASS_MIN_DAYS 1\n\n If the \"PASS_MIN_DAYS\" parameter value is not \"1\" or greater, or is\ncommented out, this is a finding.'\n desc 'fix', 'Configure the operating system to enforce 24 hours/1 day as the minimum\npassword lifetime.\n\n Add the following line in \"/etc/login.defs\" (or modify the line to have\nthe required value):\n\n PASS_MIN_DAYS 1'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000075-GPOS-00043'\n tag gid: 'V-230365'\n tag rid: 'SV-258104r858727_rule'\n tag stig_id: 'RHEL-08-020190'\n tag fix_id: 'F-33009r567842_fix'\n tag cci: ['CCI-000198']\n tag nist: ['IA-5 (1) (d)']\n tag 'host'\n tag 'container'\n\n value = input('pass_min_days')\n setting = input_object('pass_min_days').name.upcase\n\n describe \"/etc/login.defs does not have `#{setting}` configured\" do\n let(:config) { login_defs.read_params[setting] }\n it \"greater than #{value} day\" do\n expect(config).to cmp <= value\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258104.rb" + }, + "title": "RHEL 8 passwords for new users or password changes must have a 24 hours/1 day minimum password lifetime restriction in /etc/login.defs.", + "desc": "Enforcing a minimum password lifetime helps to prevent repeated\npassword changes to defeat the password reuse or history enforcement\nrequirement. If users are allowed to immediately and continually change their\npassword, the password could be repeatedly changed in a short period of time to\ndefeat the organization's policy regarding password reuse.", + "descriptions": { + "default": "Enforcing a minimum password lifetime helps to prevent repeated\npassword changes to defeat the password reuse or history enforcement\nrequirement. If users are allowed to immediately and continually change their\npassword, the password could be repeatedly changed in a short period of time to\ndefeat the organization's policy regarding password reuse.", + "check": "Verify the operating system enforces 24 hours/1 day as the minimum password\nlifetime for new user accounts.\n\n Check for the value of \"PASS_MIN_DAYS\" in \"/etc/login.defs\" with the\nfollowing command:\n\n $ sudo grep -i pass_min_days /etc/login.defs\n PASS_MIN_DAYS 1\n\n If the \"PASS_MIN_DAYS\" parameter value is not \"1\" or greater, or is\ncommented out, this is a finding.", + "fix": "Configure the operating system to enforce 24 hours/1 day as the minimum\npassword lifetime.\n\n Add the following line in \"/etc/login.defs\" (or modify the line to have\nthe required value):\n\n PASS_MIN_DAYS 1" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000075-GPOS-00043", + "gid": "V-230365", + "rid": "SV-258104r858727_rule", + "stig_id": "RHEL-08-020190", + "fix_id": "F-33009r567842_fix", + "cci": [ + "CCI-000198" + ], + "nist": [ + "IA-5 (1) (d)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258105", + "code": "control 'SV-258105' do\n title 'RHEL 8 passwords must have a 24 hours/1 day minimum password lifetime\nrestriction in /etc/shadow.'\n desc \"Enforcing a minimum password lifetime helps to prevent repeated\npassword changes to defeat the password reuse or history enforcement\nrequirement. If users are allowed to immediately and continually change their\npassword, the password could be repeatedly changed in a short period of time to\ndefeat the organization's policy regarding password reuse.\"\n desc 'check', %q(Check whether the minimum time period between password changes for each\nuser account is one day or greater.\n\n $ sudo awk -F: '$4 < 1 {print $1 \" \" $4}' /etc/shadow\n\n If any results are returned that are not associated with a system account,\nthis is a finding.)\n desc 'fix', 'Configure non-compliant accounts to enforce a 24 hours/1 day minimum\npassword lifetime:\n\n $ sudo chage -m 1 [user]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000075-GPOS-00043'\n tag gid: 'V-230364'\n tag rid: 'SV-258105r627750_rule'\n tag stig_id: 'RHEL-08-020180'\n tag fix_id: 'F-33008r567839_fix'\n tag cci: ['CCI-000198']\n tag nist: ['IA-5 (1) (d)']\n tag 'host'\n tag 'container'\n\n # TODO: add inputs for a frequecny\n\n bad_users = users.where { uid >= 1000 }.where { mindays < 1 }.usernames\n in_scope_users = bad_users - input('exempt_home_users')\n\n describe 'Users should not' do\n it 'be able to change their password more then once a 24 hour period' do\n failure_message = \"The following users can update their password more then once a day: #{in_scope_users.join(', ')}\"\n expect(in_scope_users).to be_empty, failure_message\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258105.rb" + }, + "title": "RHEL 8 passwords must have a 24 hours/1 day minimum password lifetime\nrestriction in /etc/shadow.", + "desc": "Enforcing a minimum password lifetime helps to prevent repeated\npassword changes to defeat the password reuse or history enforcement\nrequirement. If users are allowed to immediately and continually change their\npassword, the password could be repeatedly changed in a short period of time to\ndefeat the organization's policy regarding password reuse.", + "descriptions": { + "default": "Enforcing a minimum password lifetime helps to prevent repeated\npassword changes to defeat the password reuse or history enforcement\nrequirement. If users are allowed to immediately and continually change their\npassword, the password could be repeatedly changed in a short period of time to\ndefeat the organization's policy regarding password reuse.", + "check": "Check whether the minimum time period between password changes for each\nuser account is one day or greater.\n\n $ sudo awk -F: '$4 < 1 {print $1 \" \" $4}' /etc/shadow\n\n If any results are returned that are not associated with a system account,\nthis is a finding.", + "fix": "Configure non-compliant accounts to enforce a 24 hours/1 day minimum\npassword lifetime:\n\n $ sudo chage -m 1 [user]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000075-GPOS-00043", + "gid": "V-230364", + "rid": "SV-258105r627750_rule", + "stig_id": "RHEL-08-020180", + "fix_id": "F-33008r567839_fix", + "cci": [ + "CCI-000198" + ], + "nist": [ + "IA-5 (1) (d)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258106", + "code": "control 'SV-258106' do\n title 'RHEL 8 must require users to provide a password for privilege\nescalation.'\n desc 'Without reauthentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the user reauthenticate.'\n desc 'check', 'Verify that \"/etc/sudoers\" has no occurrences of \"NOPASSWD\".\n\n Check that the \"/etc/sudoers\" file has no occurrences of \"NOPASSWD\" by\nrunning the following command:\n\n $ sudo grep -i nopasswd /etc/sudoers /etc/sudoers.d/*\n\n %admin ALL=(ALL) NOPASSWD: ALL\n\n If any occurrences of \"NOPASSWD\" are returned from the command and have\nnot been documented with the ISSO as an organizationally defined administrative\ngroup utilizing MFA, this is a finding.'\n desc 'fix', 'Remove any occurrence of \"NOPASSWD\" found in \"/etc/sudoers\"\nfile or files in the \"/etc/sudoers.d\" directory.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000373-GPOS-00156'\n tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158']\n tag gid: 'V-230271'\n tag rid: 'SV-258106r854026_rule'\n tag stig_id: 'RHEL-08-010380'\n tag fix_id: 'F-32915r854025_fix'\n tag cci: ['CCI-002038']\n tag nist: ['IA-11']\n tag 'host'\n tag 'container-conditional'\n\n only_if('Control not applicable within a container without sudo installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !command('sudo').exist?)\n }\n\n # TODO: figure out why this .where throws an exception if we don't explicitly filter out nils via 'tags.nil?'\n # ergo shouldn't the filtertable be handling that kind of nil-checking for us?\n failing_results = sudoers(input('sudoers_config_files').join(' ')).rules.where { tags.nil? && (tags || '').include?('NOPASSWD') }\n\n failing_results = failing_results.where { !input('passwordless_admins').include?(users) } if input('passwordless_admins').nil?\n\n describe 'Sudoers' do\n it 'should not include any (non-exempt) users with NOPASSWD set' do\n expect(failing_results.users).to be_empty, \"NOPASSWD settings found for users:\\n\\t- #{failing_results.users.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258106.rb" + }, + "title": "RHEL 8 must require users to provide a password for privilege\nescalation.", + "desc": "Without reauthentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the user reauthenticate.", + "descriptions": { + "default": "Without reauthentication, users may access resources or perform tasks\nfor which they do not have authorization.\n\n When operating systems provide the capability to escalate a functional\ncapability, it is critical the user reauthenticate.", + "check": "Verify that \"/etc/sudoers\" has no occurrences of \"NOPASSWD\".\n\n Check that the \"/etc/sudoers\" file has no occurrences of \"NOPASSWD\" by\nrunning the following command:\n\n $ sudo grep -i nopasswd /etc/sudoers /etc/sudoers.d/*\n\n %admin ALL=(ALL) NOPASSWD: ALL\n\n If any occurrences of \"NOPASSWD\" are returned from the command and have\nnot been documented with the ISSO as an organizationally defined administrative\ngroup utilizing MFA, this is a finding.", + "fix": "Remove any occurrence of \"NOPASSWD\" found in \"/etc/sudoers\"\nfile or files in the \"/etc/sudoers.d\" directory." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000373-GPOS-00156", + "satisfies": [ + "SRG-OS-000373-GPOS-00156", + "SRG-OS-000373-GPOS-00157", + "SRG-OS-000373-GPOS-00158" + ], + "gid": "V-230271", + "rid": "SV-258106r854026_rule", + "stig_id": "RHEL-08-010380", + "fix_id": "F-32915r854025_fix", + "cci": [ + "CCI-002038" + ], + "nist": [ + "IA-11" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258107", + "code": "control 'SV-258107' do\n title 'RHEL 8 passwords must have a minimum of 15 characters.'\n desc 'The shorter the password, the lower the number of possible\ncombinations that need to be tested before the password is compromised.\n\n Password complexity, or strength, is a measure of the effectiveness of a\npassword in resisting attempts at guessing and brute-force attacks. Password\nlength is one factor of several that helps to determine strength and how long\nit takes to crack a password. Use of more characters in a password helps to\nincrease exponentially the time and/or resources required to compromise the\npassword.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Configurations are set in the \"etc/security/pwquality.conf\" file.\n\n The \"minlen\", sometimes noted as minimum length, acts as a \"score\" of\ncomplexity based on the credit components of the \"pwquality\" module. By\nsetting the credit components to a negative value, not only will those\ncomponents be required, they will not count towards the total \"score\" of\n\"minlen\". This will enable \"minlen\" to require a 15-character minimum.\n\n The DoD minimum password requirement is 15 characters.'\n desc 'check', 'Verify the operating system enforces a minimum 15-character password length. The \"minlen\" option sets the minimum number of characters in a new password.\n\nCheck for the value of the \"minlen\" option with the following command:\n\n$ sudo grep -r minlen /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:minlen = 15\n\nIf the command does not return a \"minlen\" value of 15 or greater, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure operating system to enforce a minimum 15-character password length.\n\nAdd the following line to \"/etc/security/pwquality.conf\" (or modify the line to have the required value):\n\nminlen = 15\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000078-GPOS-00046'\n tag gid: 'V-230369'\n tag rid: 'SV-258107r858785_rule'\n tag stig_id: 'RHEL-08-020230'\n tag fix_id: 'F-33013r858784_fix'\n tag cci: ['CCI-000205']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe parse_config_file('/etc/security/pwquality.conf') do\n its('minlen.to_i') { should cmp >= input('pass_min_len') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258107.rb" + }, + "title": "RHEL 8 passwords must have a minimum of 15 characters.", + "desc": "The shorter the password, the lower the number of possible\ncombinations that need to be tested before the password is compromised.\n\n Password complexity, or strength, is a measure of the effectiveness of a\npassword in resisting attempts at guessing and brute-force attacks. Password\nlength is one factor of several that helps to determine strength and how long\nit takes to crack a password. Use of more characters in a password helps to\nincrease exponentially the time and/or resources required to compromise the\npassword.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Configurations are set in the \"etc/security/pwquality.conf\" file.\n\n The \"minlen\", sometimes noted as minimum length, acts as a \"score\" of\ncomplexity based on the credit components of the \"pwquality\" module. By\nsetting the credit components to a negative value, not only will those\ncomponents be required, they will not count towards the total \"score\" of\n\"minlen\". This will enable \"minlen\" to require a 15-character minimum.\n\n The DoD minimum password requirement is 15 characters.", + "descriptions": { + "default": "The shorter the password, the lower the number of possible\ncombinations that need to be tested before the password is compromised.\n\n Password complexity, or strength, is a measure of the effectiveness of a\npassword in resisting attempts at guessing and brute-force attacks. Password\nlength is one factor of several that helps to determine strength and how long\nit takes to crack a password. Use of more characters in a password helps to\nincrease exponentially the time and/or resources required to compromise the\npassword.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Configurations are set in the \"etc/security/pwquality.conf\" file.\n\n The \"minlen\", sometimes noted as minimum length, acts as a \"score\" of\ncomplexity based on the credit components of the \"pwquality\" module. By\nsetting the credit components to a negative value, not only will those\ncomponents be required, they will not count towards the total \"score\" of\n\"minlen\". This will enable \"minlen\" to require a 15-character minimum.\n\n The DoD minimum password requirement is 15 characters.", + "check": "Verify the operating system enforces a minimum 15-character password length. The \"minlen\" option sets the minimum number of characters in a new password.\n\nCheck for the value of the \"minlen\" option with the following command:\n\n$ sudo grep -r minlen /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:minlen = 15\n\nIf the command does not return a \"minlen\" value of 15 or greater, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure operating system to enforce a minimum 15-character password length.\n\nAdd the following line to \"/etc/security/pwquality.conf\" (or modify the line to have the required value):\n\nminlen = 15\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000078-GPOS-00046", + "gid": "V-230369", + "rid": "SV-258107r858785_rule", + "stig_id": "RHEL-08-020230", + "fix_id": "F-33013r858784_fix", + "cci": [ + "CCI-000205" + ], + "nist": [ + "IA-5 (1) (a)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258108", + "code": "control 'SV-258108' do\n title 'RHEL 8 passwords for new users must have a minimum of 15 characters.'\n desc 'The shorter the password, the lower the number of possible\ncombinations that need to be tested before the password is compromised.\n\n Password complexity, or strength, is a measure of the effectiveness of a\npassword in resisting attempts at guessing and brute-force attacks. Password\nlength is one factor of several that helps to determine strength and how long\nit takes to crack a password. Use of more characters in a password helps to\nincrease exponentially the time and/or resources required to compromise the\npassword.\n\n The DoD minimum password requirement is 15 characters.'\n desc 'check', 'Verify that RHEL 8 enforces a minimum 15-character password length for new\nuser accounts by running the following command:\n\n $ sudo grep -i pass_min_len /etc/login.defs\n\n PASS_MIN_LEN 15\n\n If the \"PASS_MIN_LEN\" parameter value is less than \"15\", or commented\nout, this is a finding.'\n desc 'fix', 'Configure operating system to enforce a minimum 15-character password\nlength for new user accounts.\n\n Add, or modify the following line in the \"/etc/login.defs\" file:\n\n PASS_MIN_LEN 15'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000078-GPOS-00046'\n tag gid: 'V-230370'\n tag rid: 'SV-258108r627750_rule'\n tag stig_id: 'RHEL-08-020231'\n tag fix_id: 'F-33014r567857_fix'\n tag cci: ['CCI-000205']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n value = input('pass_min_len')\n setting = input_object('pass_min_len').name.upcase\n\n describe \"/etc/login.defs does not have `#{setting}` configured\" do\n let(:config) { login_defs.read_params[setting] }\n it \"greater than #{value} day\" do\n expect(config).to cmp >= value\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258108.rb" + }, + "title": "RHEL 8 passwords for new users must have a minimum of 15 characters.", + "desc": "The shorter the password, the lower the number of possible\ncombinations that need to be tested before the password is compromised.\n\n Password complexity, or strength, is a measure of the effectiveness of a\npassword in resisting attempts at guessing and brute-force attacks. Password\nlength is one factor of several that helps to determine strength and how long\nit takes to crack a password. Use of more characters in a password helps to\nincrease exponentially the time and/or resources required to compromise the\npassword.\n\n The DoD minimum password requirement is 15 characters.", + "descriptions": { + "default": "The shorter the password, the lower the number of possible\ncombinations that need to be tested before the password is compromised.\n\n Password complexity, or strength, is a measure of the effectiveness of a\npassword in resisting attempts at guessing and brute-force attacks. Password\nlength is one factor of several that helps to determine strength and how long\nit takes to crack a password. Use of more characters in a password helps to\nincrease exponentially the time and/or resources required to compromise the\npassword.\n\n The DoD minimum password requirement is 15 characters.", + "check": "Verify that RHEL 8 enforces a minimum 15-character password length for new\nuser accounts by running the following command:\n\n $ sudo grep -i pass_min_len /etc/login.defs\n\n PASS_MIN_LEN 15\n\n If the \"PASS_MIN_LEN\" parameter value is less than \"15\", or commented\nout, this is a finding.", + "fix": "Configure operating system to enforce a minimum 15-character password\nlength for new user accounts.\n\n Add, or modify the following line in the \"/etc/login.defs\" file:\n\n PASS_MIN_LEN 15" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000078-GPOS-00046", + "gid": "V-230370", + "rid": "SV-258108r627750_rule", + "stig_id": "RHEL-08-020231", + "fix_id": "F-33014r567857_fix", + "cci": [ + "CCI-000205" + ], + "nist": [ + "IA-5 (1) (a)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258109", + "code": "control 'SV-258109' do\n title 'All RHEL 8 passwords must contain at least one special character.'\n desc 'Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Note that to require special characters without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".'\n desc 'check', 'Verify the value for \"ocredit\" with the following command:\n\n$ sudo grep -r ocredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:ocredit = -1\n\nIf the value of \"ocredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to enforce password complexity by requiring that at least one special character be used by setting the \"ocredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\nocredit = -1\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000266-GPOS-00101'\n tag gid: 'V-230375'\n tag rid: 'SV-258109r858787_rule'\n tag stig_id: 'RHEL-08-020280'\n tag fix_id: 'F-33019r858786_fix'\n tag cci: ['CCI-001619']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n # value = input('ocredit')\n setting = 'ocredit'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) }\n\n it \"has `#{setting}` set\" do\n expect(setting_value).not_to be_empty, \"#{setting} is not set in pwquality.conf\"\n end\n\n it \"only sets `#{setting}` once\" do\n expect(setting_value.length).to eq(1), \"#{setting} is commented or set more than once in pwquality.conf\"\n end\n\n it \"does not set `#{setting}` to a positive value\" do\n expect(setting_value.first.to_i).to be <= 0, \"#{setting} is set to a positive value in pwquality.conf\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258109.rb" + }, + "title": "All RHEL 8 passwords must contain at least one special character.", + "desc": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Note that to require special characters without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. Note that to require special characters without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "check": "Verify the value for \"ocredit\" with the following command:\n\n$ sudo grep -r ocredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:ocredit = -1\n\nIf the value of \"ocredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to enforce password complexity by requiring that at least one special character be used by setting the \"ocredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\nocredit = -1\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000266-GPOS-00101", + "gid": "V-230375", + "rid": "SV-258109r858787_rule", + "stig_id": "RHEL-08-020280", + "fix_id": "F-33019r858786_fix", + "cci": [ + "CCI-001619" + ], + "nist": [ + "IA-5 (1) (a)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258110", + "code": "control 'SV-258110' do\n title 'RHEL 8 must prevent the use of dictionary words for passwords.'\n desc 'If RHEL 8 allows the user to select passwords based on dictionary\nwords, this increases the chances of password compromise by increasing the\nopportunity for successful guesses, and brute-force attacks.'\n desc 'check', 'Verify RHEL 8 prevents the use of dictionary words for passwords.\n\nDetermine if the field \"dictcheck\" is set with the following command:\n\n$ sudo grep -r dictcheck /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:dictcheck=1\n\nIf the \"dictcheck\" parameter is not set to \"1\", or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to prevent the use of dictionary words for passwords.\n\nAdd or update the following line in the \"/etc/security/pwquality.conf\" file or a configuration file in the /etc/pwquality.conf.d/ directory to contain the \"dictcheck\" parameter:\n\ndictcheck=1\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00225'\n tag gid: 'V-230377'\n tag rid: 'SV-258110r858789_rule'\n tag stig_id: 'RHEL-08-020300'\n tag fix_id: 'F-33021r858788_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n describe parse_config_file('/etc/security/pwquality.conf') do\n its('dictcheck') { should eq '1' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258110.rb" + }, + "title": "RHEL 8 must prevent the use of dictionary words for passwords.", + "desc": "If RHEL 8 allows the user to select passwords based on dictionary\nwords, this increases the chances of password compromise by increasing the\nopportunity for successful guesses, and brute-force attacks.", + "descriptions": { + "default": "If RHEL 8 allows the user to select passwords based on dictionary\nwords, this increases the chances of password compromise by increasing the\nopportunity for successful guesses, and brute-force attacks.", + "check": "Verify RHEL 8 prevents the use of dictionary words for passwords.\n\nDetermine if the field \"dictcheck\" is set with the following command:\n\n$ sudo grep -r dictcheck /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:dictcheck=1\n\nIf the \"dictcheck\" parameter is not set to \"1\", or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure RHEL 8 to prevent the use of dictionary words for passwords.\n\nAdd or update the following line in the \"/etc/security/pwquality.conf\" file or a configuration file in the /etc/pwquality.conf.d/ directory to contain the \"dictcheck\" parameter:\n\ndictcheck=1\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00225", + "gid": "V-230377", + "rid": "SV-258110r858789_rule", + "stig_id": "RHEL-08-020300", + "fix_id": "F-33021r858788_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258111", + "code": "control 'SV-258111' do\n title 'RHEL 8 must enforce password complexity by requiring that at least one\nuppercase character be used.'\n desc 'Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes pwquality as a mechanism to enforce password complexity.\nNote that in order to require uppercase characters, without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".'\n desc 'check', 'Verify the value for \"ucredit\" with the following command:\n\n$ sudo grep -r ucredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:ucredit = -1\n\nIf the value of \"ucredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to enforce password complexity by requiring that at least one uppercase character be used by setting the \"ucredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\nucredit = -1\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000069-GPOS-00037'\n tag gid: 'V-230357'\n tag rid: 'SV-258111r858771_rule'\n tag stig_id: 'RHEL-08-020110'\n tag fix_id: 'F-33001r858770_fix'\n tag cci: ['CCI-000192']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe 'pwquality.conf:' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting) { 'ucredit' }\n let(:value) { Array(config.params[setting]) }\n\n it 'has `ucredit` set' do\n expect(value).not_to be_empty, 'ucredit is not set in pwquality.conf'\n end\n\n it 'only sets `ucredit` once' do\n expect(value.length).to eq(1), 'ucredit is commented or set more than once in pwquality.conf'\n end\n\n it 'does not set `ucredit` to a positive value' do\n expect(value.first.to_i).to cmp < 0, 'ucredit is not set to a negative value in pwquality.conf'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258111.rb" + }, + "title": "RHEL 8 must enforce password complexity by requiring that at least one\nuppercase character be used.", + "desc": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes pwquality as a mechanism to enforce password complexity.\nNote that in order to require uppercase characters, without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes pwquality as a mechanism to enforce password complexity.\nNote that in order to require uppercase characters, without degrading the\n\"minlen\" value, the credit value must be expressed as a negative number in\n\"/etc/security/pwquality.conf\".", + "check": "Verify the value for \"ucredit\" with the following command:\n\n$ sudo grep -r ucredit /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:ucredit = -1\n\nIf the value of \"ucredit\" is a positive number or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to enforce password complexity by requiring that at least one uppercase character be used by setting the \"ucredit\" option.\n\nAdd the following line to /etc/security/pwquality.conf (or modify the line to have the required value):\n\nucredit = -1\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000069-GPOS-00037", + "gid": "V-230357", + "rid": "SV-258111r858771_rule", + "stig_id": "RHEL-08-020110", + "fix_id": "F-33001r858770_fix", + "cci": [ + "CCI-000192" + ], + "nist": [ + "IA-5 (1) (a)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258112", + "code": "control 'SV-258112' do\n title 'RHEL 9 must require the change of at least eight characters when passwords are changed.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute–force attacks. \n\nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring a minimum number of different characters during password changes ensures that newly changed passwords will not resemble previously compromised ones. Note that passwords changed on compromised systems will still be compromised.'\n desc 'check', 'Verify the value of the \"difok\" option in \"/etc/security/pwquality.conf\" with the following command:\n\n$ sudo grep difok /etc/security/pwquality.conf\n\ndifok = 8\n \nIf the value of \"difok\" is set to less than \"8\", or is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to require the change of at least eight of the total number of characters when passwords are changed by setting the \"difok\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf\" (or modify the line to have the required value):\n\ndifok = 8'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61853r926321_chk'\n tag severity: 'medium'\n tag gid: 'V-258112'\n tag rid: 'SV-258112r926323_rule'\n tag stig_id: 'RHEL-09-611115'\n tag gtitle: 'SRG-OS-000072-GPOS-00040'\n tag fix_id: 'F-61777r926322_fix'\n tag 'documentable'\n tag cci: ['CCI-000195']\n tag nist: ['IA-5 (1) (b)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258112.rb" + }, + "title": "RHEL 9 must require the change of at least eight characters when passwords are changed.", + "desc": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute–force attacks. \n\nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring a minimum number of different characters during password changes ensures that newly changed passwords will not resemble previously compromised ones. Note that passwords changed on compromised systems will still be compromised.", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute–force attacks. \n\nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring a minimum number of different characters during password changes ensures that newly changed passwords will not resemble previously compromised ones. Note that passwords changed on compromised systems will still be compromised.", + "check": "Verify the value of the \"difok\" option in \"/etc/security/pwquality.conf\" with the following command:\n\n$ sudo grep difok /etc/security/pwquality.conf\n\ndifok = 8\n \nIf the value of \"difok\" is set to less than \"8\", or is commented out, this is a finding.", + "fix": "Configure RHEL 9 to require the change of at least eight of the total number of characters when passwords are changed by setting the \"difok\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf\" (or modify the line to have the required value):\n\ndifok = 8" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61853r926321_chk", + "severity": "medium", + "gid": "V-258112", + "rid": "SV-258112r926323_rule", + "stig_id": "RHEL-09-611115", + "gtitle": "SRG-OS-000072-GPOS-00040", + "fix_id": "F-61777r926322_fix", + "documentable": null, + "cci": [ + "CCI-000195" + ], + "nist": [ + "IA-5 (1) (b)" + ] + } + }, + { + "id": "SV-258113", + "code": "control 'SV-258113' do\n title 'RHEL 8 must require the maximum number of repeating characters of the\nsame character class be limited to four when passwords are changed.'\n desc 'Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"maxclassrepeat\" option sets the maximum number of allowed\nsame consecutive characters in the same class in the new password.'\n desc 'check', 'Check for the value of the \"maxclassrepeat\" option with the following command:\n\n$ sudo grep -r maxclassrepeat /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:maxclassrepeat = 4\n\nIf the value of \"maxclassrepeat\" is set to \"0\", more than \"4\" or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to require the change of the number of repeating characters of the same character class when passwords are changed by setting the \"maxclassrepeat\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf\" conf (or modify the line to have the required value):\n\nmaxclassrepeat = 4\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000072-GPOS-00040'\n tag gid: 'V-230360'\n tag rid: 'SV-258113r858777_rule'\n tag stig_id: 'RHEL-08-020140'\n tag fix_id: 'F-33004r858776_fix'\n tag cci: ['CCI-000195']\n tag nist: ['IA-5 (1) (b)']\n tag 'host'\n tag 'container'\n\n value = input('maxclassrepeat')\n setting = 'maxclassrepeat'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) }\n\n it \"has `#{setting}` set\" do\n expect(setting_value).not_to be_empty, \"#{setting} is not set in pwquality.conf\"\n end\n\n it \"only sets `#{setting}` once\" do\n expect(setting_value.length).to eq(1), \"#{setting} is commented or set more than once in pwquality.conf\"\n end\n\n it \"does not set `#{setting}` to more than #{value}\" do\n expect(setting_value.first.to_i).to be <= value.to_i, \"#{setting} is set to a value greater than #{value} in pwquality.conf\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258113.rb" + }, + "title": "RHEL 8 must require the maximum number of repeating characters of the\nsame character class be limited to four when passwords are changed.", + "desc": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"maxclassrepeat\" option sets the maximum number of allowed\nsame consecutive characters in the same class in the new password.", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"maxclassrepeat\" option sets the maximum number of allowed\nsame consecutive characters in the same class in the new password.", + "check": "Check for the value of the \"maxclassrepeat\" option with the following command:\n\n$ sudo grep -r maxclassrepeat /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:maxclassrepeat = 4\n\nIf the value of \"maxclassrepeat\" is set to \"0\", more than \"4\" or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to require the change of the number of repeating characters of the same character class when passwords are changed by setting the \"maxclassrepeat\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf\" conf (or modify the line to have the required value):\n\nmaxclassrepeat = 4\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000072-GPOS-00040", + "gid": "V-230360", + "rid": "SV-258113r858777_rule", + "stig_id": "RHEL-08-020140", + "fix_id": "F-33004r858776_fix", + "cci": [ + "CCI-000195" + ], + "nist": [ + "IA-5 (1) (b)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258114", + "code": "control 'SV-258114' do\n title 'RHEL 8 must require the maximum number of repeating characters be\nlimited to three when passwords are changed.'\n desc 'Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"maxrepeat\" option sets the maximum number of allowed same\nconsecutive characters in a new password.'\n desc 'check', 'Check for the value of the \"maxrepeat\" option with the following command:\n\n$ sudo grep -r maxrepeat /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:maxrepeat = 3\n\nIf the value of \"maxrepeat\" is set to more than \"3\" or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to require the change of the number of repeating consecutive characters when passwords are changed by setting the \"maxrepeat\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf conf\" (or modify the line to have the required value):\n\nmaxrepeat = 3\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000072-GPOS-00040'\n tag gid: 'V-230361'\n tag rid: 'SV-258114r858779_rule'\n tag stig_id: 'RHEL-08-020150'\n tag fix_id: 'F-33005r858778_fix'\n tag cci: ['CCI-000195']\n tag nist: ['IA-5 (1) (b)']\n tag 'host'\n tag 'container'\n\n value = input('maxrepeat')\n setting = 'maxrepeat'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) }\n\n it \"has `#{setting}` set\" do\n expect(setting_value).not_to be_empty, \"#{setting} is not set in pwquality.conf\"\n end\n\n it \"only sets `#{setting}` once\" do\n expect(setting_value.length).to eq(1), \"#{setting} is commented or set more than once in pwquality.conf\"\n end\n\n it \"does not set `#{setting}` to more than #{value}\" do\n expect(setting_value.first.to_i).to be <= value.to_i, \"#{setting} is set to a value greater than #{value} in pwquality.conf\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258114.rb" + }, + "title": "RHEL 8 must require the maximum number of repeating characters be\nlimited to three when passwords are changed.", + "desc": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"maxrepeat\" option sets the maximum number of allowed same\nconsecutive characters in a new password.", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"maxrepeat\" option sets the maximum number of allowed same\nconsecutive characters in a new password.", + "check": "Check for the value of the \"maxrepeat\" option with the following command:\n\n$ sudo grep -r maxrepeat /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:maxrepeat = 3\n\nIf the value of \"maxrepeat\" is set to more than \"3\" or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to require the change of the number of repeating consecutive characters when passwords are changed by setting the \"maxrepeat\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf conf\" (or modify the line to have the required value):\n\nmaxrepeat = 3\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000072-GPOS-00040", + "gid": "V-230361", + "rid": "SV-258114r858779_rule", + "stig_id": "RHEL-08-020150", + "fix_id": "F-33005r858778_fix", + "cci": [ + "CCI-000195" + ], + "nist": [ + "IA-5 (1) (b)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258115", + "code": "control 'SV-258115' do\n title 'RHEL 8 must require the change of at least four character classes when passwords are changed.'\n desc 'Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"minclass\" option sets the minimum number of required classes\nof characters for the new password (digits, uppercase, lowercase, others).'\n desc 'check', 'Verify the value of the \"minclass\" option with the following command:\n\n$ sudo grep -r minclass /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:minclass = 4\n\nIf the value of \"minclass\" is set to less than \"4\" or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure the operating system to require the change of at least four character classes when passwords are changed by setting the \"minclass\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf conf\" (or modify the line to have the required value):\n\nminclass = 4\n\nRemove any configurations that conflict with the above value.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000072-GPOS-00040'\n tag gid: 'V-230362'\n tag rid: 'SV-258115r858781_rule'\n tag stig_id: 'RHEL-08-020160'\n tag fix_id: 'F-33006r858780_fix'\n tag cci: ['CCI-000195']\n tag nist: ['IA-5 (1) (b)']\n tag 'host'\n tag 'container'\n\n value = input('minclass')\n setting = 'minclass'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) }\n\n it \"has `#{setting}` set\" do\n expect(setting_value).not_to be_empty, \"#{setting} is not set in pwquality.conf\"\n end\n\n it \"only sets `#{setting}` once\" do\n expect(setting_value.length).to eq(1), \"#{setting} is commented or set more than once in pwquality.conf\"\n end\n\n it \"does not set `#{setting}` to more than #{value}\" do\n expect(setting_value.first.to_i).to be <= value.to_i, \"#{setting} is set to a value greater than #{value} in pwquality.conf\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258115.rb" + }, + "title": "RHEL 8 must require the change of at least four character classes when passwords are changed.", + "desc": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"minclass\" option sets the minimum number of required classes\nof characters for the new password (digits, uppercase, lowercase, others).", + "descriptions": { + "default": "Use of a complex password helps to increase the time and resources\nrequired to compromise the password. Password complexity, or strength, is a\nmeasure of the effectiveness of a password in resisting attempts at guessing\nand brute-force attacks.\n\n Password complexity is one factor of several that determines how long it\ntakes to crack a password. The more complex the password, the greater the\nnumber of possible combinations that need to be tested before the password is\ncompromised.\n\n RHEL 8 utilizes \"pwquality\" as a mechanism to enforce password\ncomplexity. The \"minclass\" option sets the minimum number of required classes\nof characters for the new password (digits, uppercase, lowercase, others).", + "check": "Verify the value of the \"minclass\" option with the following command:\n\n$ sudo grep -r minclass /etc/security/pwquality.conf*\n\n/etc/security/pwquality.conf:minclass = 4\n\nIf the value of \"minclass\" is set to less than \"4\" or is commented out, this is a finding.\nIf conflicting results are returned, this is a finding.", + "fix": "Configure the operating system to require the change of at least four character classes when passwords are changed by setting the \"minclass\" option.\n\nAdd the following line to \"/etc/security/pwquality.conf conf\" (or modify the line to have the required value):\n\nminclass = 4\n\nRemove any configurations that conflict with the above value." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000072-GPOS-00040", + "gid": "V-230362", + "rid": "SV-258115r858781_rule", + "stig_id": "RHEL-08-020160", + "fix_id": "F-33006r858780_fix", + "cci": [ + "CCI-000195" + ], + "nist": [ + "IA-5 (1) (b)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258116", + "code": "control 'SV-258116' do\n title 'RHEL 9 must be configured so that user and group account administration utilities are configured to store only encrypted representations of passwords.'\n desc 'Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nThis setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the \"crypt_style\" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.'\n desc 'check', 'Verify the user and group account administration utilities are configured to store only encrypted representations of passwords with the following command:\n\n# grep crypt /etc/libuser.conf \n\ncrypt_style = sha512\n\nIf the \"crypt_style\" variable is not set to \"sha512\", is not in the defaults section, is commented out, or does not exist, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to use the SHA-512 algorithm for password hashing.\n\nAdd or change the following line in the \"[default]\" section of \"/etc/libuser.conf\" file:\n\ncrypt_style = sha512'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61857r926333_chk'\n tag severity: 'medium'\n tag gid: 'V-258116'\n tag rid: 'SV-258116r926335_rule'\n tag stig_id: 'RHEL-09-611135'\n tag gtitle: 'SRG-OS-000073-GPOS-00041'\n tag fix_id: 'F-61781r926334_fix'\n tag 'documentable'\n tag cci: ['CCI-000196']\n tag nist: ['IA-5 (1) (c)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258116.rb" + }, + "title": "RHEL 9 must be configured so that user and group account administration utilities are configured to store only encrypted representations of passwords.", + "desc": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nThis setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the \"crypt_style\" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.", + "descriptions": { + "default": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nThis setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the \"crypt_style\" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.", + "check": "Verify the user and group account administration utilities are configured to store only encrypted representations of passwords with the following command:\n\n# grep crypt /etc/libuser.conf \n\ncrypt_style = sha512\n\nIf the \"crypt_style\" variable is not set to \"sha512\", is not in the defaults section, is commented out, or does not exist, this is a finding.", + "fix": "Configure RHEL 9 to use the SHA-512 algorithm for password hashing.\n\nAdd or change the following line in the \"[default]\" section of \"/etc/libuser.conf\" file:\n\ncrypt_style = sha512" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61857r926333_chk", + "severity": "medium", + "gid": "V-258116", + "rid": "SV-258116r926335_rule", + "stig_id": "RHEL-09-611135", + "gtitle": "SRG-OS-000073-GPOS-00041", + "fix_id": "F-61781r926334_fix", + "documentable": null, + "cci": [ + "CCI-000196" + ], + "nist": [ + "IA-5 (1) (c)" + ] + } + }, + { + "id": "SV-258117", + "code": "control 'SV-258117' do\n title 'RHEL 9 must be configured to use the shadow file to store only encrypted representations of passwords.'\n desc 'Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nThis setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the \"crypt_style\" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.'\n desc 'check', %q(Verify the system's shadow file is configured to store only encrypted representations of passwords with a hash value of SHA512 with the following command:\n\n# grep -i encrypt_method /etc/login.defs\n\nENCRYPT_METHOD SHA512\n\nIf \"ENCRYPT_METHOD\" does not have a value of \"SHA512\", or the line is commented out, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to store only SHA512 encrypted representations of passwords.\n\nAdd or update the following line in the \"/etc/login.defs\" file:\n\nENCRYPT_METHOD SHA512'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61858r926336_chk'\n tag severity: 'medium'\n tag gid: 'V-258117'\n tag rid: 'SV-258117r926338_rule'\n tag stig_id: 'RHEL-09-611140'\n tag gtitle: 'SRG-OS-000073-GPOS-00041'\n tag fix_id: 'F-61782r926337_fix'\n tag 'documentable'\n tag cci: ['CCI-000196']\n tag nist: ['IA-5 (1) (c)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258117.rb" + }, + "title": "RHEL 9 must be configured to use the shadow file to store only encrypted representations of passwords.", + "desc": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nThis setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the \"crypt_style\" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.", + "descriptions": { + "default": "Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text.\n\nThis setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the \"crypt_style\" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.", + "check": "Verify the system's shadow file is configured to store only encrypted representations of passwords with a hash value of SHA512 with the following command:\n\n# grep -i encrypt_method /etc/login.defs\n\nENCRYPT_METHOD SHA512\n\nIf \"ENCRYPT_METHOD\" does not have a value of \"SHA512\", or the line is commented out, this is a finding.", + "fix": "Configure RHEL 9 to store only SHA512 encrypted representations of passwords.\n\nAdd or update the following line in the \"/etc/login.defs\" file:\n\nENCRYPT_METHOD SHA512" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61858r926336_chk", + "severity": "medium", + "gid": "V-258117", + "rid": "SV-258117r926338_rule", + "stig_id": "RHEL-09-611140", + "gtitle": "SRG-OS-000073-GPOS-00041", + "fix_id": "F-61782r926337_fix", + "documentable": null, + "cci": [ + "CCI-000196" + ], + "nist": [ + "IA-5 (1) (c)" + ] + } + }, + { + "id": "SV-258118", + "code": "control 'SV-258118' do\n title 'The RHEL 8 operating system must not be configured to bypass password requirements for privilege escalation.'\n desc 'Without re-authentication, users may access resources or perform tasks for which they do not have authorization.\n\nWhen operating systems provide the capability to escalate a functional capability, it is critical the user re-authenticate.'\n desc 'check', 'Verify the operating system is not be configured to bypass password requirements for privilege escalation.\n\nCheck the configuration of the \"/etc/pam.d/sudo\" file with the following command:\n\n$ sudo grep pam_succeed_if /etc/pam.d/sudo\n\nIf any occurrences of \"pam_succeed_if\" is returned from the command, this is a finding.'\n desc 'fix', 'Configure the operating system to require users to supply a password for privilege escalation.\n\nCheck the configuration of the \"/etc/ pam.d/sudo\" file with the following command:\n$ sudo vi /etc/pam.d/sudo\n\nRemove any occurrences of \"pam_succeed_if\" in the file.'\n impact 0.5\n tag check_id: 'C-55149r809358_chk'\n tag severity: 'medium'\n tag gid: 'V-251712'\n tag rid: 'SV-258118r854083_rule'\n tag stig_id: 'RHEL-08-010385'\n tag gtitle: 'SRG-OS-000373-GPOS-00156'\n tag fix_id: 'F-55103r854082_fix'\n tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158']\n tag 'documentable'\n tag cci: ['CCI-002038']\n tag nist: ['IA-11']\n tag 'host'\n tag 'container-conditional'\n\n if virtualization.system.eql?('docker') && !command('sudo').exist?\n impact 0.0\n describe 'Control not applicable within a container without sudo enabled' do\n skip 'Control not applicable within a container without sudo enabled'\n end\n else\n describe parse_config_file('/etc/pam.d/sudo') do\n its('content') { should_not match(/pam_succeed_if/) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258118.rb" + }, + "title": "The RHEL 8 operating system must not be configured to bypass password requirements for privilege escalation.", + "desc": "Without re-authentication, users may access resources or perform tasks for which they do not have authorization.\n\nWhen operating systems provide the capability to escalate a functional capability, it is critical the user re-authenticate.", + "descriptions": { + "default": "Without re-authentication, users may access resources or perform tasks for which they do not have authorization.\n\nWhen operating systems provide the capability to escalate a functional capability, it is critical the user re-authenticate.", + "check": "Verify the operating system is not be configured to bypass password requirements for privilege escalation.\n\nCheck the configuration of the \"/etc/pam.d/sudo\" file with the following command:\n\n$ sudo grep pam_succeed_if /etc/pam.d/sudo\n\nIf any occurrences of \"pam_succeed_if\" is returned from the command, this is a finding.", + "fix": "Configure the operating system to require users to supply a password for privilege escalation.\n\nCheck the configuration of the \"/etc/ pam.d/sudo\" file with the following command:\n$ sudo vi /etc/pam.d/sudo\n\nRemove any occurrences of \"pam_succeed_if\" in the file." + }, + "impact": 0, + "refs": [], + "tags": { + "check_id": "C-55149r809358_chk", + "severity": "medium", + "gid": "V-251712", + "rid": "SV-258118r854083_rule", + "stig_id": "RHEL-08-010385", + "gtitle": "SRG-OS-000373-GPOS-00156", + "fix_id": "F-55103r854082_fix", + "satisfies": [ + "SRG-OS-000373-GPOS-00156", + "SRG-OS-000373-GPOS-00157", + "SRG-OS-000373-GPOS-00158" + ], + "documentable": null, + "cci": [ + "CCI-002038" + ], + "nist": [ + "IA-11" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258119", + "code": "control 'SV-258119' do\n title 'RHEL 8 must encrypt all stored passwords with a FIPS 140-2 approved\ncryptographic hashing algorithm.'\n desc 'Passwords need to be protected at all times, and encryption is the\nstandard method for protecting passwords. If passwords are not encrypted, they\ncan be plainly read (i.e., clear text) and easily compromised.\n\n Unapproved mechanisms that are used for authentication to the cryptographic\nmodule are not verified and therefore cannot be relied upon to provide\nconfidentiality or integrity, and DoD data may be compromised.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD requirements.'\n desc 'check', 'Verify that the shadow password suite configuration is set to encrypt\npassword with a FIPS 140-2 approved cryptographic hashing algorithm.\n\n Check the hashing algorithm that is being used to hash passwords with the\nfollowing command:\n\n $ sudo grep -i crypt /etc/login.defs\n\n ENCRYPT_METHOD SHA512\n\n If \"ENCRYPT_METHOD\" does not equal SHA512 or greater, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to encrypt all stored passwords.\n\n Edit/Modify the following line in the \"/etc/login.defs\" file and set\n\"[ENCRYPT_METHOD]\" to SHA512.\n\n ENCRYPT_METHOD SHA512'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000073-GPOS-00041'\n tag gid: 'V-230231'\n tag rid: 'SV-258119r877397_rule'\n tag stig_id: 'RHEL-08-010110'\n tag fix_id: 'F-32875r567440_fix'\n tag cci: ['CCI-000196']\n tag nist: ['IA-5 (1) (c)']\n tag 'host'\n tag 'container'\n\n describe login_defs do\n its('ENCRYPT_METHOD') { should cmp 'SHA512' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258119.rb" + }, + "title": "RHEL 8 must encrypt all stored passwords with a FIPS 140-2 approved\ncryptographic hashing algorithm.", + "desc": "Passwords need to be protected at all times, and encryption is the\nstandard method for protecting passwords. If passwords are not encrypted, they\ncan be plainly read (i.e., clear text) and easily compromised.\n\n Unapproved mechanisms that are used for authentication to the cryptographic\nmodule are not verified and therefore cannot be relied upon to provide\nconfidentiality or integrity, and DoD data may be compromised.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD requirements.", + "descriptions": { + "default": "Passwords need to be protected at all times, and encryption is the\nstandard method for protecting passwords. If passwords are not encrypted, they\ncan be plainly read (i.e., clear text) and easily compromised.\n\n Unapproved mechanisms that are used for authentication to the cryptographic\nmodule are not verified and therefore cannot be relied upon to provide\nconfidentiality or integrity, and DoD data may be compromised.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD requirements.", + "check": "Verify that the shadow password suite configuration is set to encrypt\npassword with a FIPS 140-2 approved cryptographic hashing algorithm.\n\n Check the hashing algorithm that is being used to hash passwords with the\nfollowing command:\n\n $ sudo grep -i crypt /etc/login.defs\n\n ENCRYPT_METHOD SHA512\n\n If \"ENCRYPT_METHOD\" does not equal SHA512 or greater, this is a finding.", + "fix": "Configure RHEL 8 to encrypt all stored passwords.\n\n Edit/Modify the following line in the \"/etc/login.defs\" file and set\n\"[ENCRYPT_METHOD]\" to SHA512.\n\n ENCRYPT_METHOD SHA512" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000073-GPOS-00041", + "gid": "V-230231", + "rid": "SV-258119r877397_rule", + "stig_id": "RHEL-08-010110", + "fix_id": "F-32875r567440_fix", + "cci": [ + "CCI-000196" + ], + "nist": [ + "IA-5 (1) (c)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258120", + "code": "control 'SV-258120' do\n title 'The RHEL 8 operating system must not have accounts configured with blank or null passwords.'\n desc 'If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.'\n desc 'check', %q(Check the \"/etc/shadow\" file for blank passwords with the following command:\n\n$ sudo awk -F: '!$2 {print $1}' /etc/shadow\n\nIf the command returns any results, this is a finding.)\n desc 'fix', 'Configure all accounts on the system to have a password or lock the account\nwith the following commands:\n\nPerform a password reset:\n$ sudo passwd [username]\n\nLock an account:\n$ sudo passwd -l [username]'\n impact 0.7\n tag check_id: 'C-55143r809340_chk'\n tag severity: 'high'\n tag gid: 'V-251706'\n tag rid: 'SV-258120r809342_rule'\n tag stig_id: 'RHEL-08-010121'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-55097r809341_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n users_with_blank_passwords = shadow.where { password.nil? || password.empty? }.users - input('users_allowed_blank_passwords')\n\n describe 'All users' do\n it 'should have a password set' do\n fail_msg = \"Users with blank passwords:\\n\\t- #{users_with_blank_passwords.join(\"\\n\\t- \")}\"\n expect(users_with_blank_passwords).to be_empty, fail_msg\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258120.rb" + }, + "title": "The RHEL 8 operating system must not have accounts configured with blank or null passwords.", + "desc": "If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.", + "descriptions": { + "default": "If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.", + "check": "Check the \"/etc/shadow\" file for blank passwords with the following command:\n\n$ sudo awk -F: '!$2 {print $1}' /etc/shadow\n\nIf the command returns any results, this is a finding.", + "fix": "Configure all accounts on the system to have a password or lock the account\nwith the following commands:\n\nPerform a password reset:\n$ sudo passwd [username]\n\nLock an account:\n$ sudo passwd -l [username]" + }, + "impact": 0.7, + "refs": [], + "tags": { + "check_id": "C-55143r809340_chk", + "severity": "high", + "gid": "V-251706", + "rid": "SV-258120r809342_rule", + "stig_id": "RHEL-08-010121", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-55097r809341_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258121", + "code": "control 'SV-258121' do\n title 'RHEL 9 must use the CAC smart card driver.'\n desc 'Smart card login provides two-factor authentication stronger than that provided by a username and password combination. Smart cards leverage public key infrastructure to provide and verify credentials. Configuring the smart card driver in use by the organization helps to prevent users from using unauthorized smart cards.\n\n'\n desc 'check', 'Verify that RHEL loads the CAC driver with the following command:\n\n$ grep card_drivers /etc/opensc.conf\n\ncard_drivers = cac; \n\nIf \"cac\" is not listed as a card driver, or there is no line returned for \"card_drivers\", this is a finding.'\n desc 'fix', 'Configure RHEL 9 to load the CAC driver.\n\nAdd or modify the following line in the \"/etc/opensc.conf\" file:\n\ncard_drivers = cac;'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61862r926348_chk'\n tag severity: 'medium'\n tag gid: 'V-258121'\n tag rid: 'SV-258121r926350_rule'\n tag stig_id: 'RHEL-09-611160'\n tag gtitle: 'SRG-OS-000104-GPOS-00051'\n tag fix_id: 'F-61786r926349_fix'\n tag satisfies: ['SRG-OS-000104-GPOS-00051', 'SRG-OS-000106-GPOS-00053', 'SRG-OS-000107-GPOS-00054', 'SRG-OS-000109-GPOS-00056', 'SRG-OS-000108-GPOS-00055', 'SRG-OS-000112-GPOS-00057', 'SRG-OS-000113-GPOS-00058']\n tag 'documentable'\n tag cci: ['CCI-000764', 'CCI-000766', 'CCI-000767', 'CCI-000768', 'CCI-000770', 'CCI-001941', 'CCI-001942']\n tag nist: ['IA-2', 'IA-2 (2)', 'IA-2 (3)', 'IA-2 (4)', 'IA-2 (5)', 'IA-2 (8)', 'IA-2 (9)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258121.rb" + }, + "title": "RHEL 9 must use the CAC smart card driver.", + "desc": "Smart card login provides two-factor authentication stronger than that provided by a username and password combination. Smart cards leverage public key infrastructure to provide and verify credentials. Configuring the smart card driver in use by the organization helps to prevent users from using unauthorized smart cards.\n\n", + "descriptions": { + "default": "Smart card login provides two-factor authentication stronger than that provided by a username and password combination. Smart cards leverage public key infrastructure to provide and verify credentials. Configuring the smart card driver in use by the organization helps to prevent users from using unauthorized smart cards.\n\n", + "check": "Verify that RHEL loads the CAC driver with the following command:\n\n$ grep card_drivers /etc/opensc.conf\n\ncard_drivers = cac; \n\nIf \"cac\" is not listed as a card driver, or there is no line returned for \"card_drivers\", this is a finding.", + "fix": "Configure RHEL 9 to load the CAC driver.\n\nAdd or modify the following line in the \"/etc/opensc.conf\" file:\n\ncard_drivers = cac;" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61862r926348_chk", + "severity": "medium", + "gid": "V-258121", + "rid": "SV-258121r926350_rule", + "stig_id": "RHEL-09-611160", + "gtitle": "SRG-OS-000104-GPOS-00051", + "fix_id": "F-61786r926349_fix", + "satisfies": [ + "SRG-OS-000104-GPOS-00051", + "SRG-OS-000106-GPOS-00053", + "SRG-OS-000107-GPOS-00054", + "SRG-OS-000109-GPOS-00056", + "SRG-OS-000108-GPOS-00055", + "SRG-OS-000112-GPOS-00057", + "SRG-OS-000113-GPOS-00058" + ], + "documentable": null, + "cci": [ + "CCI-000764", + "CCI-000766", + "CCI-000767", + "CCI-000768", + "CCI-000770", + "CCI-001941", + "CCI-001942" + ], + "nist": [ + "IA-2", + "IA-2 (2)", + "IA-2 (3)", + "IA-2 (4)", + "IA-2 (5)", + "IA-2 (8)", + "IA-2 (9)" + ] + } + }, + { + "id": "SV-258122", + "code": "control 'SV-258122' do\n title 'RHEL 8 must implement smart card logon for multifactor authentication\nfor access to interactive accounts.'\n desc 'Using an authentication device, such as a Common Access Card (CAC) or\ntoken that is separate from the information system, ensures that even if the\ninformation system is compromised, that compromise will not affect credentials\nstored on the authentication device.\n\n Multifactor solutions that require devices separate from information\nsystems gaining access include, for example, hardware tokens providing\ntime-based or challenge-response authenticators and smart cards such as the\nU.S. Government Personal Identity Verification card and the DoD CAC.\n\n There are various methods of implementing multifactor authentication for\nRHEL 8. Some methods include a local system multifactor account mapping or\njoining the system to a domain and utilizing a Red Hat idM server or Microsoft\nWindows Active Directory server. Any of these methods will require that the\nclient operating system handle the multifactor authentication correctly.'\n desc 'check', 'Verify RHEL 8 uses multifactor authentication for local access to accounts.\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\nCheck that the \"pam_cert_auth\" setting is set to \"true\" in the \"/etc/sssd/sssd.conf\" file.\n\nCheck that the \"try_cert_auth\" or \"require_cert_auth\" options are configured in both \"/etc/pam.d/system-auth\" and \"/etc/pam.d/smartcard-auth\" files with the following command:\n\n $ sudo grep -ir cert_auth /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf /etc/pam.d/*\n /etc/sssd/sssd.conf:pam_cert_auth = True\n /etc/pam.d/smartcard-auth:auth sufficient pam_sss.so try_cert_auth\n /etc/pam.d/system-auth:auth [success=done authinfo_unavail=ignore ignore=ignore default=die] pam_sss.so try_cert_auth\n\nIf \"pam_cert_auth\" is not set to \"true\" in \"/etc/sssd/sssd.conf\", this is a finding.\n\nIf \"pam_sss.so\" is not set to \"try_cert_auth\" or \"require_cert_auth\" in both the \"/etc/pam.d/smartcard-auth\" and \"/etc/pam.d/system-auth\" files, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to use multifactor authentication for local access to\naccounts.\n\n Add or update the \"pam_cert_auth\" setting in the \"/etc/sssd/sssd.conf\"\nfile to match the following line:\n\n [pam]\n pam_cert_auth = True\n\n Add or update \"pam_sss.so\" with \"try_cert_auth\" or\n\"require_cert_auth\" in the \"/etc/pam.d/system-auth\" and\n\"/etc/pam.d/smartcard-auth\" files based on the following examples:\n\n /etc/pam.d/smartcard-auth:auth sufficient pam_sss.so try_cert_auth\n\n /etc/pam.d/system-auth:auth [success=done authinfo_unavail=ignore\nignore=ignore default=die] pam_sss.so try_cert_auth\n\n The \"sssd\" service must be restarted for the changes to take effect. To\nrestart the \"sssd\" service, run the following command:\n\n $ sudo systemctl restart sssd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000105-GPOS-00052'\n tag satisfies: ['SRG-OS-000105-GPOS-00052', 'SRG-OS-000106-GPOS-00053', 'SRG-OS-000107-GPOS-00054', 'SRG-OS-000108-GPOS-00055']\n tag gid: 'V-230372'\n tag rid: 'SV-258122r942945_rule'\n tag stig_id: 'RHEL-08-020250'\n tag fix_id: 'F-33016r942944_fix'\n tag cci: ['CCI-000765']\n tag nist: ['IA-2 (1)']\n tag 'host'\n\n only_if('If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.', impact: 0.0) {\n input('smart_card_enabled')\n }\n\n sssd_conf_files = input('sssd_conf_files')\n sssd_conf_contents = ini({ command: \"cat #{input('sssd_conf_files').join(' ')}\" })\n\n pam_auth_files = input('pam_auth_files')\n\n describe 'SSSD' do\n it 'should be installed and enabled' do\n expect(service('sssd')).to be_installed.and be_enabled\n expect(sssd_conf_contents.params).to_not be_empty, \"SSSD configuration files not found or have no content; files checked:\\n\\t- #{sssd_conf_files.join(\"\\n\\t- \")}\"\n end\n if sssd_conf_contents.params.nil?\n it 'should configure pam_cert_auth' do\n expect(sssd_conf_contents.sssd.pam_cert_auth).to eq(true)\n end\n end\n end\n\n [pam_auth_files['system-auth'], pam_auth_files['smartcard-auth']].each do |path|\n describe pam(path) do\n its('lines') { should match_pam_rule('.* .* pam_sss.so (try_cert_auth|require_cert_auth)') }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258122.rb" + }, + "title": "RHEL 8 must implement smart card logon for multifactor authentication\nfor access to interactive accounts.", + "desc": "Using an authentication device, such as a Common Access Card (CAC) or\ntoken that is separate from the information system, ensures that even if the\ninformation system is compromised, that compromise will not affect credentials\nstored on the authentication device.\n\n Multifactor solutions that require devices separate from information\nsystems gaining access include, for example, hardware tokens providing\ntime-based or challenge-response authenticators and smart cards such as the\nU.S. Government Personal Identity Verification card and the DoD CAC.\n\n There are various methods of implementing multifactor authentication for\nRHEL 8. Some methods include a local system multifactor account mapping or\njoining the system to a domain and utilizing a Red Hat idM server or Microsoft\nWindows Active Directory server. Any of these methods will require that the\nclient operating system handle the multifactor authentication correctly.", + "descriptions": { + "default": "Using an authentication device, such as a Common Access Card (CAC) or\ntoken that is separate from the information system, ensures that even if the\ninformation system is compromised, that compromise will not affect credentials\nstored on the authentication device.\n\n Multifactor solutions that require devices separate from information\nsystems gaining access include, for example, hardware tokens providing\ntime-based or challenge-response authenticators and smart cards such as the\nU.S. Government Personal Identity Verification card and the DoD CAC.\n\n There are various methods of implementing multifactor authentication for\nRHEL 8. Some methods include a local system multifactor account mapping or\njoining the system to a domain and utilizing a Red Hat idM server or Microsoft\nWindows Active Directory server. Any of these methods will require that the\nclient operating system handle the multifactor authentication correctly.", + "check": "Verify RHEL 8 uses multifactor authentication for local access to accounts.\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\nCheck that the \"pam_cert_auth\" setting is set to \"true\" in the \"/etc/sssd/sssd.conf\" file.\n\nCheck that the \"try_cert_auth\" or \"require_cert_auth\" options are configured in both \"/etc/pam.d/system-auth\" and \"/etc/pam.d/smartcard-auth\" files with the following command:\n\n $ sudo grep -ir cert_auth /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf /etc/pam.d/*\n /etc/sssd/sssd.conf:pam_cert_auth = True\n /etc/pam.d/smartcard-auth:auth sufficient pam_sss.so try_cert_auth\n /etc/pam.d/system-auth:auth [success=done authinfo_unavail=ignore ignore=ignore default=die] pam_sss.so try_cert_auth\n\nIf \"pam_cert_auth\" is not set to \"true\" in \"/etc/sssd/sssd.conf\", this is a finding.\n\nIf \"pam_sss.so\" is not set to \"try_cert_auth\" or \"require_cert_auth\" in both the \"/etc/pam.d/smartcard-auth\" and \"/etc/pam.d/system-auth\" files, this is a finding.", + "fix": "Configure RHEL 8 to use multifactor authentication for local access to\naccounts.\n\n Add or update the \"pam_cert_auth\" setting in the \"/etc/sssd/sssd.conf\"\nfile to match the following line:\n\n [pam]\n pam_cert_auth = True\n\n Add or update \"pam_sss.so\" with \"try_cert_auth\" or\n\"require_cert_auth\" in the \"/etc/pam.d/system-auth\" and\n\"/etc/pam.d/smartcard-auth\" files based on the following examples:\n\n /etc/pam.d/smartcard-auth:auth sufficient pam_sss.so try_cert_auth\n\n /etc/pam.d/system-auth:auth [success=done authinfo_unavail=ignore\nignore=ignore default=die] pam_sss.so try_cert_auth\n\n The \"sssd\" service must be restarted for the changes to take effect. To\nrestart the \"sssd\" service, run the following command:\n\n $ sudo systemctl restart sssd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000105-GPOS-00052", + "satisfies": [ + "SRG-OS-000105-GPOS-00052", + "SRG-OS-000106-GPOS-00053", + "SRG-OS-000107-GPOS-00054", + "SRG-OS-000108-GPOS-00055" + ], + "gid": "V-230372", + "rid": "SV-258122r942945_rule", + "stig_id": "RHEL-08-020250", + "fix_id": "F-33016r942944_fix", + "cci": [ + "CCI-000765" + ], + "nist": [ + "IA-2 (1)" + ], + "host": null + } + }, + { + "id": "SV-258123", + "code": "control 'SV-258123' do\n title 'RHEL 8 must implement certificate status checking for multifactor authentication.'\n desc 'Using an authentication device, such as a DoD Common Access Card (CAC)\n or token that is separate from the information system, ensures that even if the\n information system is compromised, credentials stored on the authentication\n device will not be affected.\n\n Multifactor solutions that require devices separate from information\n systems gaining access include, for example, hardware tokens providing\n time-based or challenge-response authenticators and smart cards such as the\n U.S. Government Personal Identity Verification (PIV) card and the DoD CAC.\n\n RHEL 8 includes multiple options for configuring certificate status\nchecking, but for this requirement focuses on the System Security Services\nDaemon (SSSD). By default, sssd performs Online Certificate Status Protocol\n(OCSP) checking and certificate verification using a sha256 digest function.'\n desc 'check', 'Verify the operating system implements certificate status checking for multifactor authentication.\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\nCheck to see if Online Certificate Status Protocol (OCSP) is enabled and using the proper digest value on the system with the following command:\n\n$ sudo grep certificate_verification /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf | grep -v \"^#\"\n\ncertificate_verification = ocsp_dgst=sha1\n\nIf the certificate_verification line is missing from the [sssd] section, or is missing \"ocsp_dgst=sha1\", ask the administrator to indicate what type of multifactor authentication is being utilized and how the system implements certificate status checking. If there is no evidence of certificate status checking being used, this is a finding.'\n desc 'fix', 'Configure the operating system to implement certificate status checking for multifactor authentication.\n\nReview the \"/etc/sssd/sssd.conf\" file to determine if the system is configured to prevent OCSP or certificate verification.\n\nAdd the following line to the [sssd] section of the \"/etc/sssd/sssd.conf\" file:\n\ncertificate_verification = ocsp_dgst=sha1\n\nThe \"sssd\" service must be restarted for the changes to take effect. To restart the \"sssd\" service, run the following command:\n\n$ sudo systemctl restart sssd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000375-GPOS-00160'\n tag satisfies: ['SRG-OS-000375-GPOS-00160', 'SRG-OS-000377-GPOS-00162']\n tag gid: 'V-230274'\n tag rid: 'SV-258123r858741_rule'\n tag stig_id: 'RHEL-08-010400'\n tag fix_id: 'F-32918r809280_fix'\n tag cci: ['CCI-001948']\n tag nist: ['IA-2 (11)']\n tag 'host'\n\n only_if('This requirement is Not Applicable inside the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternate_mfa_method').nil?\n describe 'Manual Review' do\n skip \"Alternate MFA method selected:\\t\\nConsult with ISSO to determine that alternate MFA method is approved; manually review system to ensure alternate MFA method is functioning\"\n end\n else\n sssd_conf_files = input('sssd_conf_files')\n sssd_conf_contents = ini({ command: \"cat #{input('sssd_conf_files').join(' ')}\" })\n sssd_certificate_verification = input('sssd_certificate_verification')\n\n describe 'SSSD' do\n it 'should be installed and enabled' do\n expect(service('sssd')).to be_installed.and be_enabled\n expect(sssd_conf_contents.params).to_not be_empty, \"SSSD configuration files not found or have no content; files checked:\\n\\t- #{sssd_conf_files.join(\"\\n\\t- \")}\"\n end\n if sssd_conf_contents.params.nil?\n it \"should configure certificate_verification to be '#{sssd_certificate_verification}'\" do\n expect(sssd_conf_contents.sssd.certificate_verification).to eq(sssd_certificate_verification)\n end\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258123.rb" + }, + "title": "RHEL 8 must implement certificate status checking for multifactor authentication.", + "desc": "Using an authentication device, such as a DoD Common Access Card (CAC)\n or token that is separate from the information system, ensures that even if the\n information system is compromised, credentials stored on the authentication\n device will not be affected.\n\n Multifactor solutions that require devices separate from information\n systems gaining access include, for example, hardware tokens providing\n time-based or challenge-response authenticators and smart cards such as the\n U.S. Government Personal Identity Verification (PIV) card and the DoD CAC.\n\n RHEL 8 includes multiple options for configuring certificate status\nchecking, but for this requirement focuses on the System Security Services\nDaemon (SSSD). By default, sssd performs Online Certificate Status Protocol\n(OCSP) checking and certificate verification using a sha256 digest function.", + "descriptions": { + "default": "Using an authentication device, such as a DoD Common Access Card (CAC)\n or token that is separate from the information system, ensures that even if the\n information system is compromised, credentials stored on the authentication\n device will not be affected.\n\n Multifactor solutions that require devices separate from information\n systems gaining access include, for example, hardware tokens providing\n time-based or challenge-response authenticators and smart cards such as the\n U.S. Government Personal Identity Verification (PIV) card and the DoD CAC.\n\n RHEL 8 includes multiple options for configuring certificate status\nchecking, but for this requirement focuses on the System Security Services\nDaemon (SSSD). By default, sssd performs Online Certificate Status Protocol\n(OCSP) checking and certificate verification using a sha256 digest function.", + "check": "Verify the operating system implements certificate status checking for multifactor authentication.\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\nCheck to see if Online Certificate Status Protocol (OCSP) is enabled and using the proper digest value on the system with the following command:\n\n$ sudo grep certificate_verification /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf | grep -v \"^#\"\n\ncertificate_verification = ocsp_dgst=sha1\n\nIf the certificate_verification line is missing from the [sssd] section, or is missing \"ocsp_dgst=sha1\", ask the administrator to indicate what type of multifactor authentication is being utilized and how the system implements certificate status checking. If there is no evidence of certificate status checking being used, this is a finding.", + "fix": "Configure the operating system to implement certificate status checking for multifactor authentication.\n\nReview the \"/etc/sssd/sssd.conf\" file to determine if the system is configured to prevent OCSP or certificate verification.\n\nAdd the following line to the [sssd] section of the \"/etc/sssd/sssd.conf\" file:\n\ncertificate_verification = ocsp_dgst=sha1\n\nThe \"sssd\" service must be restarted for the changes to take effect. To restart the \"sssd\" service, run the following command:\n\n$ sudo systemctl restart sssd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000375-GPOS-00160", + "satisfies": [ + "SRG-OS-000375-GPOS-00160", + "SRG-OS-000377-GPOS-00162" + ], + "gid": "V-230274", + "rid": "SV-258123r858741_rule", + "stig_id": "RHEL-08-010400", + "fix_id": "F-32918r809280_fix", + "cci": [ + "CCI-001948" + ], + "nist": [ + "IA-2 (11)" + ], + "host": null + } + }, + { + "id": "SV-258124", + "code": "control 'SV-258124' do\n title 'RHEL 9 must have the pcsc-lite package installed.'\n desc 'The pcsc-lite package must be installed if it is to be available for multifactor authentication using smart cards.'\n desc 'check', 'Verify that RHEL 9 has the pcsc-lite package installed with the following command:\n\n$ sudo dnf list --installed pcsc-lite\n\nExample output:\n\npcsc-lite.x86_64 1.9.4-1.el9\n\nIf the \"pcsc-lite\" package is not installed, this is a finding.'\n desc 'fix', 'The pcsc-lite package can be installed with the following command:\n \n$ sudo dnf install pcsc-lite'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61865r926357_chk'\n tag severity: 'medium'\n tag gid: 'V-258124'\n tag rid: 'SV-258124r926359_rule'\n tag stig_id: 'RHEL-09-611175'\n tag gtitle: 'SRG-OS-000375-GPOS-00160'\n tag fix_id: 'F-61789r926358_fix'\n tag 'documentable'\n tag cci: ['CCI-001948']\n tag nist: ['IA-2 (11)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258124.rb" + }, + "title": "RHEL 9 must have the pcsc-lite package installed.", + "desc": "The pcsc-lite package must be installed if it is to be available for multifactor authentication using smart cards.", + "descriptions": { + "default": "The pcsc-lite package must be installed if it is to be available for multifactor authentication using smart cards.", + "check": "Verify that RHEL 9 has the pcsc-lite package installed with the following command:\n\n$ sudo dnf list --installed pcsc-lite\n\nExample output:\n\npcsc-lite.x86_64 1.9.4-1.el9\n\nIf the \"pcsc-lite\" package is not installed, this is a finding.", + "fix": "The pcsc-lite package can be installed with the following command:\n \n$ sudo dnf install pcsc-lite" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61865r926357_chk", + "severity": "medium", + "gid": "V-258124", + "rid": "SV-258124r926359_rule", + "stig_id": "RHEL-09-611175", + "gtitle": "SRG-OS-000375-GPOS-00160", + "fix_id": "F-61789r926358_fix", + "documentable": null, + "cci": [ + "CCI-001948" + ], + "nist": [ + "IA-2 (11)" + ] + } + }, + { + "id": "SV-258125", + "code": "control 'SV-258125' do\n title 'The pcscd service on RHEL 9 must be active.'\n desc 'The information system ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device.\n\nThe daemon program for pcsc-lite and the MuscleCard framework is pcscd. It is a resource manager that coordinates communications with smart card readers and smart cards and cryptographic tokens that are connected to the system.'\n desc 'check', 'Verify that the \"pcscd\" service is active with the following command:\n\n$ systemctl is-active pcscd\n\nactive\n\nIf the pcscdservice is not active, this is a finding.'\n desc 'fix', 'To enable the pcscd service run the following command:\n\n$ sudo systemctl enable --now pcscd'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61866r926360_chk'\n tag severity: 'medium'\n tag gid: 'V-258125'\n tag rid: 'SV-258125r926362_rule'\n tag stig_id: 'RHEL-09-611180'\n tag gtitle: 'SRG-OS-000375-GPOS-00160'\n tag fix_id: 'F-61790r926361_fix'\n tag 'documentable'\n tag cci: ['CCI-001948']\n tag nist: ['IA-2 (11)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258125.rb" + }, + "title": "The pcscd service on RHEL 9 must be active.", + "desc": "The information system ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device.\n\nThe daemon program for pcsc-lite and the MuscleCard framework is pcscd. It is a resource manager that coordinates communications with smart card readers and smart cards and cryptographic tokens that are connected to the system.", + "descriptions": { + "default": "The information system ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device.\n\nThe daemon program for pcsc-lite and the MuscleCard framework is pcscd. It is a resource manager that coordinates communications with smart card readers and smart cards and cryptographic tokens that are connected to the system.", + "check": "Verify that the \"pcscd\" service is active with the following command:\n\n$ systemctl is-active pcscd\n\nactive\n\nIf the pcscdservice is not active, this is a finding.", + "fix": "To enable the pcscd service run the following command:\n\n$ sudo systemctl enable --now pcscd" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61866r926360_chk", + "severity": "medium", + "gid": "V-258125", + "rid": "SV-258125r926362_rule", + "stig_id": "RHEL-09-611180", + "gtitle": "SRG-OS-000375-GPOS-00160", + "fix_id": "F-61790r926361_fix", + "documentable": null, + "cci": [ + "CCI-001948" + ], + "nist": [ + "IA-2 (11)" + ] + } + }, + { + "id": "SV-258126", + "code": "control 'SV-258126' do\n title 'RHEL 9 must have the opensc package installed.'\n desc 'The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access.\n\nThe DOD has mandated the use of the Common Access Card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems.\n\n'\n desc 'check', 'Verify that RHEL 9 has the opensc package installed with the following command:\n\n$ sudo dnf list --installed opensc\n\nExample output:\n\nopensc.x86_64 0.22.0-2.el9\n\nIf the \"opensc\" package is not installed, this is a finding.'\n desc 'fix', 'The opensc package can be installed with the following command:\n \n$ sudo dnf install opensc'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61867r926363_chk'\n tag severity: 'medium'\n tag gid: 'V-258126'\n tag rid: 'SV-258126r926365_rule'\n tag stig_id: 'RHEL-09-611185'\n tag gtitle: 'SRG-OS-000375-GPOS-00160'\n tag fix_id: 'F-61791r926364_fix'\n tag satisfies: ['SRG-OS-000375-GPOS-00160', 'SRG-OS-000376-GPOS-00161']\n tag 'documentable'\n tag cci: ['CCI-001948', 'CCI-001953']\n tag nist: ['IA-2 (11)', 'IA-2 (12)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258126.rb" + }, + "title": "RHEL 9 must have the opensc package installed.", + "desc": "The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access.\n\nThe DOD has mandated the use of the Common Access Card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems.\n\n", + "descriptions": { + "default": "The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access.\n\nThe DOD has mandated the use of the Common Access Card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems.\n\n", + "check": "Verify that RHEL 9 has the opensc package installed with the following command:\n\n$ sudo dnf list --installed opensc\n\nExample output:\n\nopensc.x86_64 0.22.0-2.el9\n\nIf the \"opensc\" package is not installed, this is a finding.", + "fix": "The opensc package can be installed with the following command:\n \n$ sudo dnf install opensc" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61867r926363_chk", + "severity": "medium", + "gid": "V-258126", + "rid": "SV-258126r926365_rule", + "stig_id": "RHEL-09-611185", + "gtitle": "SRG-OS-000375-GPOS-00160", + "fix_id": "F-61791r926364_fix", + "satisfies": [ + "SRG-OS-000375-GPOS-00160", + "SRG-OS-000376-GPOS-00161" + ], + "documentable": null, + "cci": [ + "CCI-001948", + "CCI-001953" + ], + "nist": [ + "IA-2 (11)", + "IA-2 (12)" + ] + } + }, + { + "id": "SV-258127", + "code": "control 'SV-258127' do\n title 'RHEL 8, for certificate-based authentication, must enforce authorized\naccess to the corresponding private key.'\n desc 'If an unauthorized user obtains access to a private key without a\npasscode, that user would have unauthorized access to any system where the\nassociated public key has been installed.'\n desc 'check', 'Verify the SSH private key files have a passcode.\n\nFor each private key stored on the system, use the following command:\n\n$ sudo ssh-keygen -y -f /path/to/file\n\nIf the contents of the key are displayed, this is a finding.'\n desc 'fix', 'Create a new private and public key pair that utilizes a passcode with the\nfollowing command:\n\n $ sudo ssh-keygen -n [passphrase]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000067-GPOS-00035'\n tag gid: 'V-230230'\n tag rid: 'SV-258127r627750_rule'\n tag stig_id: 'RHEL-08-010100'\n tag fix_id: 'F-32874r567437_fix'\n tag cci: ['CCI-000186']\n tag nist: ['IA-5 (2) (b)', 'IA-5 (2) (a) (1)']\n tag 'host'\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'N/A' do\n skip 'Control not applicable within a container'\n end\n elsif input('private_key_files').empty?\n impact 0.0\n describe 'N/A' do\n skip 'No private key files were given in the input, this control is Not Applicable'\n end\n elsif input('private_key_files').map { |kf| file(kf).exist? }.uniq.first == false\n describe 'no files found' do\n skip 'No private key files given in the input were found on the system; please check the input accurately lists all private keys on this system'\n end\n else\n passwordless_keys = input('private_key_files').select { |kf|\n file(kf).exist? &&\n !inspec.command(\"ssh-keygen -y -P '' -f #{kf}\").stderr.match('incorrect passphrase supplied to decrypt private key')\n }\n describe 'Private key files' do\n it 'should all have passwords set' do\n expect(passwordless_keys).to be_empty, \"Passwordless key files:\\n\\t- #{passwordless_keys.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258127.rb" + }, + "title": "RHEL 8, for certificate-based authentication, must enforce authorized\naccess to the corresponding private key.", + "desc": "If an unauthorized user obtains access to a private key without a\npasscode, that user would have unauthorized access to any system where the\nassociated public key has been installed.", + "descriptions": { + "default": "If an unauthorized user obtains access to a private key without a\npasscode, that user would have unauthorized access to any system where the\nassociated public key has been installed.", + "check": "Verify the SSH private key files have a passcode.\n\nFor each private key stored on the system, use the following command:\n\n$ sudo ssh-keygen -y -f /path/to/file\n\nIf the contents of the key are displayed, this is a finding.", + "fix": "Create a new private and public key pair that utilizes a passcode with the\nfollowing command:\n\n $ sudo ssh-keygen -n [passphrase]" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000067-GPOS-00035", + "gid": "V-230230", + "rid": "SV-258127r627750_rule", + "stig_id": "RHEL-08-010100", + "fix_id": "F-32874r567437_fix", + "cci": [ + "CCI-000186" + ], + "nist": [ + "IA-5 (2) (b)", + "IA-5 (2) (a) (1)" + ], + "host": null + } + }, + { + "id": "SV-258128", + "code": "control 'SV-258128' do\n title 'RHEL 8 operating systems must require authentication upon booting into\nemergency mode.'\n desc 'If the system does not require valid root authentication before it\nboots into emergency or rescue mode, anyone who invokes emergency or rescue\nmode is granted privileged access to all files on the system.'\n desc 'check', 'Check to see if the system requires authentication for emergency mode with\nthe following command:\n\n $ sudo grep sulogin-shell /usr/lib/systemd/system/emergency.service\n\n ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency\n\n If the \"ExecStart\" line is configured for anything other than\n\"/usr/lib/systemd/systemd-sulogin-shell emergency\", commented out, or\nmissing, this is a finding.'\n desc 'fix', 'Configure the system to require authentication upon booting into emergency\nmode by adding the following line to the\n\"/usr/lib/systemd/system/emergency.service\" file.\n\n ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000080-GPOS-00048'\n tag gid: 'V-244523'\n tag rid: 'SV-258128r743818_rule'\n tag stig_id: 'RHEL-08-010152'\n tag fix_id: 'F-47755r743817_fix'\n tag cci: ['CCI-000213']\n tag nist: ['AC-3']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe service('emergency') do\n its('params.ExecStart') { should include '/usr/lib/systemd/systemd-sulogin-shell emergency' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258128.rb" + }, + "title": "RHEL 8 operating systems must require authentication upon booting into\nemergency mode.", + "desc": "If the system does not require valid root authentication before it\nboots into emergency or rescue mode, anyone who invokes emergency or rescue\nmode is granted privileged access to all files on the system.", + "descriptions": { + "default": "If the system does not require valid root authentication before it\nboots into emergency or rescue mode, anyone who invokes emergency or rescue\nmode is granted privileged access to all files on the system.", + "check": "Check to see if the system requires authentication for emergency mode with\nthe following command:\n\n $ sudo grep sulogin-shell /usr/lib/systemd/system/emergency.service\n\n ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency\n\n If the \"ExecStart\" line is configured for anything other than\n\"/usr/lib/systemd/systemd-sulogin-shell emergency\", commented out, or\nmissing, this is a finding.", + "fix": "Configure the system to require authentication upon booting into emergency\nmode by adding the following line to the\n\"/usr/lib/systemd/system/emergency.service\" file.\n\n ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000080-GPOS-00048", + "gid": "V-244523", + "rid": "SV-258128r743818_rule", + "stig_id": "RHEL-08-010152", + "fix_id": "F-47755r743817_fix", + "cci": [ + "CCI-000213" + ], + "nist": [ + "AC-3" + ], + "host": null + } + }, + { + "id": "SV-258129", + "code": "control 'SV-258129' do\n title 'RHEL 9 must require authentication to access single-user mode.'\n desc 'To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement.\n\nThis requirement prevents attackers with physical access from trivially bypassing security on the machine and gaining root access. Such accesses are further prevented by configuring the bootloader password.'\n desc 'check', 'Verify that RHEL 9 requires authentication for single-user mode with the following command:\n\n$ grep sulogin /usr/lib/systemd/system/rescue.service \n\nExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue\n\nIf this line is not returned, or is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to require authentication for single-user mode.\n\nAdd or modify the following line in the \"/usr/lib/systemd/system/rescue.service\" file:\n\nExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61870r926372_chk'\n tag severity: 'medium'\n tag gid: 'V-258129'\n tag rid: 'SV-258129r926374_rule'\n tag stig_id: 'RHEL-09-611200'\n tag gtitle: 'SRG-OS-000080-GPOS-00048'\n tag fix_id: 'F-61794r926373_fix'\n tag 'documentable'\n tag cci: ['CCI-000213']\n tag nist: ['AC-3']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258129.rb" + }, + "title": "RHEL 9 must require authentication to access single-user mode.", + "desc": "To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement.\n\nThis requirement prevents attackers with physical access from trivially bypassing security on the machine and gaining root access. Such accesses are further prevented by configuring the bootloader password.", + "descriptions": { + "default": "To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement.\n\nThis requirement prevents attackers with physical access from trivially bypassing security on the machine and gaining root access. Such accesses are further prevented by configuring the bootloader password.", + "check": "Verify that RHEL 9 requires authentication for single-user mode with the following command:\n\n$ grep sulogin /usr/lib/systemd/system/rescue.service \n\nExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue\n\nIf this line is not returned, or is commented out, this is a finding.", + "fix": "Configure RHEL 9 to require authentication for single-user mode.\n\nAdd or modify the following line in the \"/usr/lib/systemd/system/rescue.service\" file:\n\nExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61870r926372_chk", + "severity": "medium", + "gid": "V-258129", + "rid": "SV-258129r926374_rule", + "stig_id": "RHEL-09-611200", + "gtitle": "SRG-OS-000080-GPOS-00048", + "fix_id": "F-61794r926373_fix", + "documentable": null, + "cci": [ + "CCI-000213" + ], + "nist": [ + "AC-3" + ] + } + }, + { + "id": "SV-258130", + "code": "control 'SV-258130' do\n title 'RHEL 8 must prevent system daemons from using Kerberos for\nauthentication.'\n desc 'Unapproved mechanisms that are used for authentication to the\ncryptographic module are not verified and therefore cannot be relied upon to\nprovide confidentiality or integrity, and DoD data may be compromised.\n\n RHEL 8 systems utilizing encryption are required to use FIPS-compliant\nmechanisms for authenticating to cryptographic modules.\n\n The key derivation function (KDF) in Kerberos is not FIPS compatible.\nEnsuring the system does not have any keytab files present prevents system\ndaemons from using Kerberos for authentication. A keytab is a file containing\npairs of Kerberos principals and encrypted keys.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD\nrequirements. This allows for Security Levels 1, 2, 3, or 4 for use on a\ngeneral-purpose computing system.'\n desc 'check', 'Verify that RHEL 8 prevents system daemons from using Kerberos for\nauthentication.\n\n If the system is a server utilizing krb5-server-1.17-18.el8.x86_64 or\nnewer, this requirement is not applicable.\n If the system is a workstation utilizing\nkrb5-workstation-1.17-18.el8.x86_64 or newer, this requirement is not\napplicable.\n\n Check if there are available keytabs with the following command:\n\n $ sudo ls -al /etc/*.keytab\n\n If this command produces any file(s), this is a finding.'\n desc 'fix', 'Configure RHEL 8 to prevent system daemons from using Kerberos for\nauthentication.\n\n Remove any files with the .keytab extension from the operating system.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000120-GPOS-00061'\n tag gid: 'V-230238'\n tag rid: 'SV-258130r646862_rule'\n tag stig_id: 'RHEL-08-010161'\n tag fix_id: 'F-32882r567461_fix'\n tag cci: ['CCI-000803']\n tag nist: ['IA-7']\n tag 'host'\n tag 'container'\n\n krb5_server = package('krb5-server')\n krb5_workstation = package('krb5-workstation')\n\n if (krb5_server.installed? && krb5_server.version >= '1.17-18.el8') || (krb5_workstation.installed? && krb5_workstation.version >= '1.17-18.el8')\n impact 0.0\n describe 'The system has krb5-workstation and server version 1.17-18 or higher' do\n skip 'The system has krb5-workstation and server version 1.17-18 or higner, this requirement is Not Applicable.'\n end\n else\n keytabs = command('ls /etc/*.keytab').stdout.split\n describe 'The system' do\n it 'should not have keytab files for Kerberos' do\n expect(keytabs).to be_empty, \"Keytab files:\\n\\t- #{keytabs.join(\"\\n\\t- \")}\"\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258130.rb" + }, + "title": "RHEL 8 must prevent system daemons from using Kerberos for\nauthentication.", + "desc": "Unapproved mechanisms that are used for authentication to the\ncryptographic module are not verified and therefore cannot be relied upon to\nprovide confidentiality or integrity, and DoD data may be compromised.\n\n RHEL 8 systems utilizing encryption are required to use FIPS-compliant\nmechanisms for authenticating to cryptographic modules.\n\n The key derivation function (KDF) in Kerberos is not FIPS compatible.\nEnsuring the system does not have any keytab files present prevents system\ndaemons from using Kerberos for authentication. A keytab is a file containing\npairs of Kerberos principals and encrypted keys.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD\nrequirements. This allows for Security Levels 1, 2, 3, or 4 for use on a\ngeneral-purpose computing system.", + "descriptions": { + "default": "Unapproved mechanisms that are used for authentication to the\ncryptographic module are not verified and therefore cannot be relied upon to\nprovide confidentiality or integrity, and DoD data may be compromised.\n\n RHEL 8 systems utilizing encryption are required to use FIPS-compliant\nmechanisms for authenticating to cryptographic modules.\n\n The key derivation function (KDF) in Kerberos is not FIPS compatible.\nEnsuring the system does not have any keytab files present prevents system\ndaemons from using Kerberos for authentication. A keytab is a file containing\npairs of Kerberos principals and encrypted keys.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD\nrequirements. This allows for Security Levels 1, 2, 3, or 4 for use on a\ngeneral-purpose computing system.", + "check": "Verify that RHEL 8 prevents system daemons from using Kerberos for\nauthentication.\n\n If the system is a server utilizing krb5-server-1.17-18.el8.x86_64 or\nnewer, this requirement is not applicable.\n If the system is a workstation utilizing\nkrb5-workstation-1.17-18.el8.x86_64 or newer, this requirement is not\napplicable.\n\n Check if there are available keytabs with the following command:\n\n $ sudo ls -al /etc/*.keytab\n\n If this command produces any file(s), this is a finding.", + "fix": "Configure RHEL 8 to prevent system daemons from using Kerberos for\nauthentication.\n\n Remove any files with the .keytab extension from the operating system." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000120-GPOS-00061", + "gid": "V-230238", + "rid": "SV-258130r646862_rule", + "stig_id": "RHEL-08-010161", + "fix_id": "F-32882r567461_fix", + "cci": [ + "CCI-000803" + ], + "nist": [ + "IA-7" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258131", + "code": "control 'SV-258131' do\n title 'RHEL 8, for PKI-based authentication, must validate certificates by\nconstructing a certification path (which includes status information) to an\naccepted trust anchor.'\n desc 'Without path validation, an informed trust decision by the relying\nparty cannot be made when presented with any certificate not already explicitly\ntrusted.\n\n A trust anchor is an authoritative entity represented via a public key and\nassociated data. It is used in the context of public key infrastructures, X.509\ndigital certificates, and DNSSEC.\n\n When there is a chain of trust, usually the top entity to be trusted\nbecomes the trust anchor; it can be, for example, a Certification Authority\n(CA). A certification path starts with the subject certificate and proceeds\nthrough a number of intermediate certificates up to a trusted root certificate,\ntypically issued by a trusted CA.\n\n This requirement verifies that a certification path to an accepted trust\nanchor is used for certificate validation and that the path includes status\ninformation. Path validation is necessary for a relying party to make an\ninformed trust decision when presented with any certificate not already\nexplicitly trusted. Status information for certification paths includes\ncertificate revocation lists or online certificate status protocol responses.\nValidation of the certificate status information is out of scope for this\nrequirement.'\n desc 'check', 'Verify RHEL 8 for PKI-based authentication has valid certificates by constructing a certification path (which includes status information) to an accepted trust anchor.\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\nCheck that the system has a valid DoD root CA installed with the following command:\n\n$ sudo openssl x509 -text -in /etc/sssd/pki/sssd_auth_ca_db.pem\n\nCertificate:\n Data:\n Version: 3 (0x2)\n Serial Number: 1 (0x1)\n Signature Algorithm: sha256WithRSAEncryption\n Issuer: C = US, O = U.S. Government, OU = DoD, OU = PKI, CN = DoD Root CA 3\n Validity\n Not Before: Mar 20 18:46:41 2012 GMT\n Not After : Dec 30 18:46:41 2029 GMT\n Subject: C = US, O = U.S. Government, OU = DoD, OU = PKI, CN = DoD Root CA 3\n Subject Public Key Info:\n Public Key Algorithm: rsaEncryption\n\nIf the root ca file is not a DoD-issued certificate with a valid date and installed in the /etc/sssd/pki/sssd_auth_ca_db.pem location, this is a finding.'\n desc 'fix', 'Configure RHEL 8, for PKI-based authentication, to validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.\n\nObtain a valid copy of the DoD root CA file from the PKI CA certificate bundle at cyber.mil and copy into the following file:\n\n/etc/sssd/pki/sssd_auth_ca_db.pem'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000066-GPOS-00034'\n tag satisfies: ['SRG-OS-000066-GPOS-00034', 'SRG-OS-000384-GPOS-00167']\n tag gid: 'V-230229'\n tag rid: 'SV-258131r858739_rule'\n tag stig_id: 'RHEL-08-010090'\n tag fix_id: 'F-32873r809269_fix'\n tag cci: ['CCI-000185']\n tag nist: ['IA-5 (2) (a)', 'IA-5 (2) (b) (1)']\n tag 'host'\n tag 'container'\n\n only_if('If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.', impact: 0.0) {\n !input('smart_card_enabled')\n }\n\n root_ca_file = input('root_ca_file')\n describe file(root_ca_file) do\n it { should exist }\n end\n\n describe 'Ensure the RootCA is a DoD-issued certificate with a valid date' do\n if file(root_ca_file).exist?\n subject { x509_certificate(root_ca_file) }\n it 'has the correct issuer_dn' do\n expect(subject.issuer_dn).to match('/C=US/O=U.S. Government/OU=DoD/OU=PKI/CN=DoD Root CA 3')\n end\n it 'has the correct subject_dn' do\n expect(subject.subject_dn).to match('/C=US/O=U.S. Government/OU=DoD/OU=PKI/CN=DoD Root CA 3')\n end\n it 'is valid' do\n expect(subject.validity_in_days).to be > 0\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258131.rb" + }, + "title": "RHEL 8, for PKI-based authentication, must validate certificates by\nconstructing a certification path (which includes status information) to an\naccepted trust anchor.", + "desc": "Without path validation, an informed trust decision by the relying\nparty cannot be made when presented with any certificate not already explicitly\ntrusted.\n\n A trust anchor is an authoritative entity represented via a public key and\nassociated data. It is used in the context of public key infrastructures, X.509\ndigital certificates, and DNSSEC.\n\n When there is a chain of trust, usually the top entity to be trusted\nbecomes the trust anchor; it can be, for example, a Certification Authority\n(CA). A certification path starts with the subject certificate and proceeds\nthrough a number of intermediate certificates up to a trusted root certificate,\ntypically issued by a trusted CA.\n\n This requirement verifies that a certification path to an accepted trust\nanchor is used for certificate validation and that the path includes status\ninformation. Path validation is necessary for a relying party to make an\ninformed trust decision when presented with any certificate not already\nexplicitly trusted. Status information for certification paths includes\ncertificate revocation lists or online certificate status protocol responses.\nValidation of the certificate status information is out of scope for this\nrequirement.", + "descriptions": { + "default": "Without path validation, an informed trust decision by the relying\nparty cannot be made when presented with any certificate not already explicitly\ntrusted.\n\n A trust anchor is an authoritative entity represented via a public key and\nassociated data. It is used in the context of public key infrastructures, X.509\ndigital certificates, and DNSSEC.\n\n When there is a chain of trust, usually the top entity to be trusted\nbecomes the trust anchor; it can be, for example, a Certification Authority\n(CA). A certification path starts with the subject certificate and proceeds\nthrough a number of intermediate certificates up to a trusted root certificate,\ntypically issued by a trusted CA.\n\n This requirement verifies that a certification path to an accepted trust\nanchor is used for certificate validation and that the path includes status\ninformation. Path validation is necessary for a relying party to make an\ninformed trust decision when presented with any certificate not already\nexplicitly trusted. Status information for certification paths includes\ncertificate revocation lists or online certificate status protocol responses.\nValidation of the certificate status information is out of scope for this\nrequirement.", + "check": "Verify RHEL 8 for PKI-based authentication has valid certificates by constructing a certification path (which includes status information) to an accepted trust anchor.\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\nCheck that the system has a valid DoD root CA installed with the following command:\n\n$ sudo openssl x509 -text -in /etc/sssd/pki/sssd_auth_ca_db.pem\n\nCertificate:\n Data:\n Version: 3 (0x2)\n Serial Number: 1 (0x1)\n Signature Algorithm: sha256WithRSAEncryption\n Issuer: C = US, O = U.S. Government, OU = DoD, OU = PKI, CN = DoD Root CA 3\n Validity\n Not Before: Mar 20 18:46:41 2012 GMT\n Not After : Dec 30 18:46:41 2029 GMT\n Subject: C = US, O = U.S. Government, OU = DoD, OU = PKI, CN = DoD Root CA 3\n Subject Public Key Info:\n Public Key Algorithm: rsaEncryption\n\nIf the root ca file is not a DoD-issued certificate with a valid date and installed in the /etc/sssd/pki/sssd_auth_ca_db.pem location, this is a finding.", + "fix": "Configure RHEL 8, for PKI-based authentication, to validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.\n\nObtain a valid copy of the DoD root CA file from the PKI CA certificate bundle at cyber.mil and copy into the following file:\n\n/etc/sssd/pki/sssd_auth_ca_db.pem" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000066-GPOS-00034", + "satisfies": [ + "SRG-OS-000066-GPOS-00034", + "SRG-OS-000384-GPOS-00167" + ], + "gid": "V-230229", + "rid": "SV-258131r858739_rule", + "stig_id": "RHEL-08-010090", + "fix_id": "F-32873r809269_fix", + "cci": [ + "CCI-000185" + ], + "nist": [ + "IA-5 (2) (a)", + "IA-5 (2) (b) (1)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258132", + "code": "control 'SV-258132' do\n title 'RHEL 8 must map the authenticated identity to the user or group\naccount for PKI-based authentication.'\n desc 'Without mapping the certificate used to authenticate to the user\naccount, the ability to determine the identity of the individual user or group\nwill not be available for forensic analysis.\n\n There are various methods of mapping certificates to user/group accounts\nfor RHEL 8. For the purposes of this requirement, the check and fix will\naccount for Active Directory mapping. Some of the other possible methods\ninclude joining the system to a domain and utilizing a Red Hat idM server, or a\nlocal system mapping, where the system is not part of a domain.'\n desc 'check', 'Verify the certificate of the user or group is mapped to the corresponding user or group in the \"sssd.conf\" file with the following command:\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\n$ sudo cat /etc/sssd/sssd.conf\n\n[sssd]\nconfig_file_version = 2\nservices = pam, sudo, ssh\ndomains = testing.test\n\n[pam]\npam_cert_auth = True\n\n[domain/testing.test]\nid_provider = ldap\n\n[certmap/testing.test/rule_name]\nmatchrule =.*EDIPI@mil\nmaprule = (userCertificate;binary={cert!bin})\ndomains = testing.test\n\nIf the certmap section does not exist, ask the System Administrator to indicate how certificates are mapped to accounts. If there is no evidence of certificate mapping, this is a finding.'\n desc 'fix', 'Configure the operating system to map the authenticated identity to the user or group account by adding or modifying the certmap section of the \"/etc/sssd/sssd.conf file based on the following example:\n\n[certmap/testing.test/rule_name]\nmatchrule =.*EDIPI@mil\nmaprule = (userCertificate;binary={cert!bin})\ndomains = testing.test\n\nThe \"sssd\" service must be restarted for the changes to take effect. To restart the \"sssd\" service, run the following command:\n\n$ sudo systemctl restart sssd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000068-GPOS-00036'\n tag gid: 'V-230355'\n tag rid: 'SV-258132r858743_rule'\n tag stig_id: 'RHEL-08-020090'\n tag fix_id: 'F-32999r818835_fix'\n tag cci: ['CCI-000187']\n tag nist: ['IA-5 (2) (c)', 'IA-5 (2) (a) (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe file('/etc/sssd/sssd.conf') do\n it { should exist }\n its('content') { should match(/^\\s*\\[certmap.*\\]\\s*$/) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258132.rb" + }, + "title": "RHEL 8 must map the authenticated identity to the user or group\naccount for PKI-based authentication.", + "desc": "Without mapping the certificate used to authenticate to the user\naccount, the ability to determine the identity of the individual user or group\nwill not be available for forensic analysis.\n\n There are various methods of mapping certificates to user/group accounts\nfor RHEL 8. For the purposes of this requirement, the check and fix will\naccount for Active Directory mapping. Some of the other possible methods\ninclude joining the system to a domain and utilizing a Red Hat idM server, or a\nlocal system mapping, where the system is not part of a domain.", + "descriptions": { + "default": "Without mapping the certificate used to authenticate to the user\naccount, the ability to determine the identity of the individual user or group\nwill not be available for forensic analysis.\n\n There are various methods of mapping certificates to user/group accounts\nfor RHEL 8. For the purposes of this requirement, the check and fix will\naccount for Active Directory mapping. Some of the other possible methods\ninclude joining the system to a domain and utilizing a Red Hat idM server, or a\nlocal system mapping, where the system is not part of a domain.", + "check": "Verify the certificate of the user or group is mapped to the corresponding user or group in the \"sssd.conf\" file with the following command:\n\nNote: If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.\n\n$ sudo cat /etc/sssd/sssd.conf\n\n[sssd]\nconfig_file_version = 2\nservices = pam, sudo, ssh\ndomains = testing.test\n\n[pam]\npam_cert_auth = True\n\n[domain/testing.test]\nid_provider = ldap\n\n[certmap/testing.test/rule_name]\nmatchrule =.*EDIPI@mil\nmaprule = (userCertificate;binary={cert!bin})\ndomains = testing.test\n\nIf the certmap section does not exist, ask the System Administrator to indicate how certificates are mapped to accounts. If there is no evidence of certificate mapping, this is a finding.", + "fix": "Configure the operating system to map the authenticated identity to the user or group account by adding or modifying the certmap section of the \"/etc/sssd/sssd.conf file based on the following example:\n\n[certmap/testing.test/rule_name]\nmatchrule =.*EDIPI@mil\nmaprule = (userCertificate;binary={cert!bin})\ndomains = testing.test\n\nThe \"sssd\" service must be restarted for the changes to take effect. To restart the \"sssd\" service, run the following command:\n\n$ sudo systemctl restart sssd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000068-GPOS-00036", + "gid": "V-230355", + "rid": "SV-258132r858743_rule", + "stig_id": "RHEL-08-020090", + "fix_id": "F-32999r818835_fix", + "cci": [ + "CCI-000187" + ], + "nist": [ + "IA-5 (2) (c)", + "IA-5 (2) (a) (2)" + ], + "host": null + } + }, + { + "id": "SV-258133", + "code": "control 'SV-258133' do\n title 'RHEL 8 must prohibit the use of cached authentications after one day.'\n desc 'If cached authentication information is out-of-date, the validity of\nthe authentication information may be questionable.\n\nRHEL 8 includes multiple options for configuring authentication, but this\nrequirement will be focus on the System Security Services Daemon (SSSD). By\ndefault sssd does not cache credentials.'\n desc 'check', 'Verify that the SSSD prohibits the use of cached authentications after one day.\n\nNote: If smart card authentication is not being used on the system this item is Not Applicable.\n\nCheck that SSSD allows cached authentications with the following command:\n\n $ sudo grep -ir cache_credentials /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf\n cache_credentials = true\n\nIf \"cache_credentials\" is set to \"false\" or missing from the configuration file, this is not a finding and no further checks are required.\n\nIf \"cache_credentials\" is set to \"true\", check that SSSD prohibits the use of cached authentications after one day with the following command:\n\n $ sudo grep -ir offline_credentials_expiration /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf\n offline_credentials_expiration = 1\n\nIf \"offline_credentials_expiration\" is not set to a value of \"1\", this is a finding.'\n desc 'fix', 'Configure the SSSD to prohibit the use of cached authentications\nafter one day.\n\nAdd or change the following line in \"/etc/sssd/sssd.conf\" just below the\nline \"[pam]\".\n\noffline_credentials_expiration = 1'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000383-GPOS-00166'\n tag gid: 'V-230376'\n tag rid: 'SV-258133r942948_rule'\n tag stig_id: 'RHEL-08-020290'\n tag fix_id: 'F-33020r942947_fix'\n tag cci: ['CCI-002007']\n tag nist: ['IA-5 (13)']\n tag 'host'\n\n sssd_config = parse_config_file('/etc/sssd/sssd.conf')\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('smart_card_enabled')\n impact 0.0\n describe 'The system is not utilizing smart card authentication' do\n skip 'The system is not utilizing smart card authentication, this control\n is Not Applicable.'\n end\n else\n describe.one do\n describe 'Cache credentials enabled' do\n subject { sssd_config.content }\n it { should_not match(/cache_credentials\\s*=\\s*true/) }\n end\n describe 'Offline credentials expiration' do\n subject { sssd_config }\n its('pam.offline_credentials_expiration') { should cmp '1' }\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258133.rb" + }, + "title": "RHEL 8 must prohibit the use of cached authentications after one day.", + "desc": "If cached authentication information is out-of-date, the validity of\nthe authentication information may be questionable.\n\nRHEL 8 includes multiple options for configuring authentication, but this\nrequirement will be focus on the System Security Services Daemon (SSSD). By\ndefault sssd does not cache credentials.", + "descriptions": { + "default": "If cached authentication information is out-of-date, the validity of\nthe authentication information may be questionable.\n\nRHEL 8 includes multiple options for configuring authentication, but this\nrequirement will be focus on the System Security Services Daemon (SSSD). By\ndefault sssd does not cache credentials.", + "check": "Verify that the SSSD prohibits the use of cached authentications after one day.\n\nNote: If smart card authentication is not being used on the system this item is Not Applicable.\n\nCheck that SSSD allows cached authentications with the following command:\n\n $ sudo grep -ir cache_credentials /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf\n cache_credentials = true\n\nIf \"cache_credentials\" is set to \"false\" or missing from the configuration file, this is not a finding and no further checks are required.\n\nIf \"cache_credentials\" is set to \"true\", check that SSSD prohibits the use of cached authentications after one day with the following command:\n\n $ sudo grep -ir offline_credentials_expiration /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf\n offline_credentials_expiration = 1\n\nIf \"offline_credentials_expiration\" is not set to a value of \"1\", this is a finding.", + "fix": "Configure the SSSD to prohibit the use of cached authentications\nafter one day.\n\nAdd or change the following line in \"/etc/sssd/sssd.conf\" just below the\nline \"[pam]\".\n\noffline_credentials_expiration = 1" + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000383-GPOS-00166", + "gid": "V-230376", + "rid": "SV-258133r942948_rule", + "stig_id": "RHEL-08-020290", + "fix_id": "F-33020r942947_fix", + "cci": [ + "CCI-002007" + ], + "nist": [ + "IA-5 (13)" + ], + "host": null + } + }, + { + "id": "SV-258134", + "code": "control 'SV-258134' do\n title 'The RHEL 8 operating system must use a file integrity tool to verify correct operation of all security functions.'\n desc 'Without verification of the security functions, security functions may not operate correctly, and the failure may go unnoticed.\n Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the\n system security policy and supporting the isolation of code and data on which the protection is based. Security functionality\n includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges),\n setting events to be audited, and setting intrusion detection parameters.\n\n This requirement applies to the RHEL 8 operating system performing security function verification/testing and/or systems and\n environments that require this functionality.'\n desc 'check', %q(Verify that Advanced Intrusion Detection Environment (AIDE) is installed and verifies the correct operation of all\n security functions.\n\n Check that the AIDE package is installed with the following command:\n $ sudo rpm -q aide\n\n aide-0.16-14.el8_5.1.x86_64\n\n If AIDE is not installed, ask the System Administrator how file integrity checks are performed on the system.\n\n If there is no application installed to perform integrity checks, this is a finding.\n\n If AIDE is installed, check if it has been initialized with the following command:\n $ sudo /usr/sbin/aide --check\n\n If the output is \"Couldn't open file /var/lib/aide/aide.db.gz for reading\", this is a finding.)\n desc 'fix', 'Install AIDE, initialize it, and perform a manual check.\n\n Install AIDE:\n $ sudo yum install aide\n\n Initialize it:\n $ sudo /usr/sbin/aide --init\n\n Example output:\n Number of entries: 48623\n\n ---------------------------------------------------\n The attributes of the (uncompressed) database(s):\n ---------------------------------------------------\n\n /var/lib/aide/aide.db.new.gz\n SHA1 : LTAVQ8tFJthsrf4m9gfRpnf1vyc=\n SHA256 : NJ9+uzRQKSwmLQ8A6IpKNvYjVKGbhSjt\n BeJBVcmOVrI=\n SHA512 : 7d8I/F6A1b07E4ZuGeilZjefRgJJ/F20\n eC2xoag1OsOVpctt3Mi7Jjjf3vFW4xoY\n 5mdS6/ImQpm0xtlTLOPeQQ==\n\n End timestamp: 2022-10-20 10:50:52 -0700 (run time: 0m 46s)\n\n The new database will need to be renamed to be read by AIDE:\n $ sudo mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz\n\n Perform a manual check:\n $ sudo /usr/sbin/aide --check\n\n Example output:\n Start timestamp: 2022-10-20 11:03:16 -0700 (AIDE 0.16)\n AIDE found differences between database and filesystem!!\n ...\n\n Done.'\n impact 0.5\n tag check_id: 'C-55147r880728_chk'\n tag severity: 'medium'\n tag gid: 'V-251710'\n tag rid: 'SV-258134r880730_rule'\n tag stig_id: 'RHEL-08-010359'\n tag gtitle: 'SRG-OS-000445-GPOS-00199'\n tag fix_id: 'F-55101r880729_fix'\n tag 'documentable'\n tag cci: ['CCI-002696']\n tag nist: ['SI-6 a']\n tag 'host'\n\n file_integrity_tool = input('file_integrity_tool')\n\n only_if('Control not applicable within a container', impact: 0.0) do\n !virtualization.system.eql?('docker')\n end\n\n if file_integrity_tool == 'aide'\n describe command('/usr/sbin/aide --check') do\n its('stdout') { should_not include \"Couldn't open file\" }\n end\n end\n\n describe package(file_integrity_tool) do\n it { should be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258134.rb" + }, + "title": "The RHEL 8 operating system must use a file integrity tool to verify correct operation of all security functions.", + "desc": "Without verification of the security functions, security functions may not operate correctly, and the failure may go unnoticed.\n Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the\n system security policy and supporting the isolation of code and data on which the protection is based. Security functionality\n includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges),\n setting events to be audited, and setting intrusion detection parameters.\n\n This requirement applies to the RHEL 8 operating system performing security function verification/testing and/or systems and\n environments that require this functionality.", + "descriptions": { + "default": "Without verification of the security functions, security functions may not operate correctly, and the failure may go unnoticed.\n Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the\n system security policy and supporting the isolation of code and data on which the protection is based. Security functionality\n includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges),\n setting events to be audited, and setting intrusion detection parameters.\n\n This requirement applies to the RHEL 8 operating system performing security function verification/testing and/or systems and\n environments that require this functionality.", + "check": "Verify that Advanced Intrusion Detection Environment (AIDE) is installed and verifies the correct operation of all\n security functions.\n\n Check that the AIDE package is installed with the following command:\n $ sudo rpm -q aide\n\n aide-0.16-14.el8_5.1.x86_64\n\n If AIDE is not installed, ask the System Administrator how file integrity checks are performed on the system.\n\n If there is no application installed to perform integrity checks, this is a finding.\n\n If AIDE is installed, check if it has been initialized with the following command:\n $ sudo /usr/sbin/aide --check\n\n If the output is \"Couldn't open file /var/lib/aide/aide.db.gz for reading\", this is a finding.", + "fix": "Install AIDE, initialize it, and perform a manual check.\n\n Install AIDE:\n $ sudo yum install aide\n\n Initialize it:\n $ sudo /usr/sbin/aide --init\n\n Example output:\n Number of entries: 48623\n\n ---------------------------------------------------\n The attributes of the (uncompressed) database(s):\n ---------------------------------------------------\n\n /var/lib/aide/aide.db.new.gz\n SHA1 : LTAVQ8tFJthsrf4m9gfRpnf1vyc=\n SHA256 : NJ9+uzRQKSwmLQ8A6IpKNvYjVKGbhSjt\n BeJBVcmOVrI=\n SHA512 : 7d8I/F6A1b07E4ZuGeilZjefRgJJ/F20\n eC2xoag1OsOVpctt3Mi7Jjjf3vFW4xoY\n 5mdS6/ImQpm0xtlTLOPeQQ==\n\n End timestamp: 2022-10-20 10:50:52 -0700 (run time: 0m 46s)\n\n The new database will need to be renamed to be read by AIDE:\n $ sudo mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz\n\n Perform a manual check:\n $ sudo /usr/sbin/aide --check\n\n Example output:\n Start timestamp: 2022-10-20 11:03:16 -0700 (AIDE 0.16)\n AIDE found differences between database and filesystem!!\n ...\n\n Done." + }, + "impact": 0.5, + "refs": [], + "tags": { + "check_id": "C-55147r880728_chk", + "severity": "medium", + "gid": "V-251710", + "rid": "SV-258134r880730_rule", + "stig_id": "RHEL-08-010359", + "gtitle": "SRG-OS-000445-GPOS-00199", + "fix_id": "F-55101r880729_fix", + "documentable": null, + "cci": [ + "CCI-002696" + ], + "nist": [ + "SI-6 a" + ], + "host": null + } + }, + { + "id": "SV-258135", + "code": "control 'SV-258135' do\n title 'RHEL 9 must routinely check the baseline configuration for unauthorized changes and notify the system administrator when anomalies in the operation of any security functions are discovered.'\n desc \"Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.\n\nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's information management officer (IMO)/information system security officer (ISSO) and system administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.\n\nNotifications provided by information systems include messages to local computer consoles, and/or hardware indications, such as lights.\n\nThis capability must take into account operational requirements for availability for selecting an appropriate response. The organization may choose to shut down or restart the information system upon security function anomaly detection.\n\n\"\n desc 'check', 'Verify that RHEL 9 routinely executes a file integrity scan for changes to the system baseline. The command used in the example will use a daily occurrence.\n\nCheck the cron directories for scripts controlling the execution and notification of results of the file integrity application. For example, if AIDE is installed on the system, use the following commands:\n\n$ ls -al /etc/cron.* | grep aide\n\n-rwxr-xr-x 1 root root 29 Nov 22 2015 aide\n\n$ grep aide /etc/crontab /var/spool/cron/root\n\n/etc/crontab: 30 04 * * * root usr/sbin/aide\n/var/spool/cron/root: 30 04 * * * root usr/sbin/aide\n\n$ sudo more /etc/cron.daily/aide\n\n#!/bin/bash\n/usr/sbin/aide --check | /bin/mail -s \"$HOSTNAME - Daily aide integrity check run\" root@sysname.mil\n\nIf the file integrity application does not exist, or a script file controlling the execution of the file integrity application does not exist, or the file integrity application does not notify designated personnel of changes, this is a finding.'\n desc 'fix', 'Configure the file integrity tool to run automatically on the system at least weekly and to notify designated personnel if baseline configurations are changed in an unauthorized manner. The AIDE tool can be configured to email designated personnel with the use of the cron system.\n \nThe following example output is generic. It will set cron to run AIDE daily and to send email at the completion of the analysis\n\n$ sudo more /etc/cron.daily/aide\n \n#!/bin/bash\n/usr/sbin/aide --check | /bin/mail -s \"$HOSTNAME - Daily aide integrity check run\" root@sysname.mil'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61876r926390_chk'\n tag severity: 'medium'\n tag gid: 'V-258135'\n tag rid: 'SV-258135r926392_rule'\n tag stig_id: 'RHEL-09-651015'\n tag gtitle: 'SRG-OS-000363-GPOS-00150'\n tag fix_id: 'F-61800r926391_fix'\n tag satisfies: ['SRG-OS-000363-GPOS-00150', 'SRG-OS-000446-GPOS-00200', 'SRG-OS-000447-GPOS-00201']\n tag 'documentable'\n tag cci: ['CCI-001744', 'CCI-002699', 'CCI-002702']\n tag nist: ['CM-3 (5)', 'SI-6 b', 'SI-6 d']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258135.rb" + }, + "title": "RHEL 9 must routinely check the baseline configuration for unauthorized changes and notify the system administrator when anomalies in the operation of any security functions are discovered.", + "desc": "Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.\n\nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's information management officer (IMO)/information system security officer (ISSO) and system administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.\n\nNotifications provided by information systems include messages to local computer consoles, and/or hardware indications, such as lights.\n\nThis capability must take into account operational requirements for availability for selecting an appropriate response. The organization may choose to shut down or restart the information system upon security function anomaly detection.\n\n", + "descriptions": { + "default": "Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security.\n\nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's information management officer (IMO)/information system security officer (ISSO) and system administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.\n\nNotifications provided by information systems include messages to local computer consoles, and/or hardware indications, such as lights.\n\nThis capability must take into account operational requirements for availability for selecting an appropriate response. The organization may choose to shut down or restart the information system upon security function anomaly detection.\n\n", + "check": "Verify that RHEL 9 routinely executes a file integrity scan for changes to the system baseline. The command used in the example will use a daily occurrence.\n\nCheck the cron directories for scripts controlling the execution and notification of results of the file integrity application. For example, if AIDE is installed on the system, use the following commands:\n\n$ ls -al /etc/cron.* | grep aide\n\n-rwxr-xr-x 1 root root 29 Nov 22 2015 aide\n\n$ grep aide /etc/crontab /var/spool/cron/root\n\n/etc/crontab: 30 04 * * * root usr/sbin/aide\n/var/spool/cron/root: 30 04 * * * root usr/sbin/aide\n\n$ sudo more /etc/cron.daily/aide\n\n#!/bin/bash\n/usr/sbin/aide --check | /bin/mail -s \"$HOSTNAME - Daily aide integrity check run\" root@sysname.mil\n\nIf the file integrity application does not exist, or a script file controlling the execution of the file integrity application does not exist, or the file integrity application does not notify designated personnel of changes, this is a finding.", + "fix": "Configure the file integrity tool to run automatically on the system at least weekly and to notify designated personnel if baseline configurations are changed in an unauthorized manner. The AIDE tool can be configured to email designated personnel with the use of the cron system.\n \nThe following example output is generic. It will set cron to run AIDE daily and to send email at the completion of the analysis\n\n$ sudo more /etc/cron.daily/aide\n \n#!/bin/bash\n/usr/sbin/aide --check | /bin/mail -s \"$HOSTNAME - Daily aide integrity check run\" root@sysname.mil" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61876r926390_chk", + "severity": "medium", + "gid": "V-258135", + "rid": "SV-258135r926392_rule", + "stig_id": "RHEL-09-651015", + "gtitle": "SRG-OS-000363-GPOS-00150", + "fix_id": "F-61800r926391_fix", + "satisfies": [ + "SRG-OS-000363-GPOS-00150", + "SRG-OS-000446-GPOS-00200", + "SRG-OS-000447-GPOS-00201" + ], + "documentable": null, + "cci": [ + "CCI-001744", + "CCI-002699", + "CCI-002702" + ], + "nist": [ + "CM-3 (5)", + "SI-6 b", + "SI-6 d" + ] + } + }, + { + "id": "SV-258136", + "code": "control 'SV-258136' do\n title 'RHEL 9 must use a file integrity tool that is configured to use FIPS 140-3-approved cryptographic hashes for validating file contents and directories.'\n desc 'RHEL 9 installation media ships with an optional file integrity tool called Advanced Intrusion Detection Environment (AIDE). AIDE is highly configurable at install time. This requirement assumes the \"aide.conf\" file is under the \"/etc\" directory.\n\nFile integrity tools use cryptographic hashes for verifying file contents and directories have not been altered. These hashes must be FIPS 140-2/140-3-approved cryptographic hashes.'\n desc 'check', 'Verify that AIDE is configured to use FIPS 140-2/140-3 file hashing with the following command:\n\n$ grep sha512 /etc/aide.conf \n\nAll=p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux\n\nIf the \"sha512\" rule is not being used on all uncommented selection lines in the \"/etc/aide.conf\" file, or another file integrity tool is not using FIPS 140-2/140-3-approved cryptographic hashes for validating file contents and directories, this is a finding.'\n desc 'fix', 'Configure the file integrity tool to use FIPS 140-2/140-3 cryptographic hashes for validating file and directory contents. \n\nIf AIDE is installed, ensure the \"sha512\" rule is present on all uncommented file and directory selection lists. Exclude any log files, or files expected to change frequently, to reduce unnecessary notifications.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61877r926393_chk'\n tag severity: 'medium'\n tag gid: 'V-258136'\n tag rid: 'SV-258136r926395_rule'\n tag stig_id: 'RHEL-09-651020'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61801r926394_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258136.rb" + }, + "title": "RHEL 9 must use a file integrity tool that is configured to use FIPS 140-3-approved cryptographic hashes for validating file contents and directories.", + "desc": "RHEL 9 installation media ships with an optional file integrity tool called Advanced Intrusion Detection Environment (AIDE). AIDE is highly configurable at install time. This requirement assumes the \"aide.conf\" file is under the \"/etc\" directory.\n\nFile integrity tools use cryptographic hashes for verifying file contents and directories have not been altered. These hashes must be FIPS 140-2/140-3-approved cryptographic hashes.", + "descriptions": { + "default": "RHEL 9 installation media ships with an optional file integrity tool called Advanced Intrusion Detection Environment (AIDE). AIDE is highly configurable at install time. This requirement assumes the \"aide.conf\" file is under the \"/etc\" directory.\n\nFile integrity tools use cryptographic hashes for verifying file contents and directories have not been altered. These hashes must be FIPS 140-2/140-3-approved cryptographic hashes.", + "check": "Verify that AIDE is configured to use FIPS 140-2/140-3 file hashing with the following command:\n\n$ grep sha512 /etc/aide.conf \n\nAll=p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux\n\nIf the \"sha512\" rule is not being used on all uncommented selection lines in the \"/etc/aide.conf\" file, or another file integrity tool is not using FIPS 140-2/140-3-approved cryptographic hashes for validating file contents and directories, this is a finding.", + "fix": "Configure the file integrity tool to use FIPS 140-2/140-3 cryptographic hashes for validating file and directory contents. \n\nIf AIDE is installed, ensure the \"sha512\" rule is present on all uncommented file and directory selection lists. Exclude any log files, or files expected to change frequently, to reduce unnecessary notifications." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61877r926393_chk", + "severity": "medium", + "gid": "V-258136", + "rid": "SV-258136r926395_rule", + "stig_id": "RHEL-09-651020", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61801r926394_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258137", + "code": "control 'SV-258137' do\n title 'RHEL 8 must use cryptographic mechanisms to protect the integrity of\naudit tools.'\n desc 'Protecting the integrity of the tools used for auditing purposes is a\ncritical step toward ensuring the integrity of audit information. Audit\ninformation includes all information (e.g., audit records, audit settings, and\naudit reports) needed to successfully audit information system activity.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.\n\n It is not uncommon for attackers to replace the audit tools or inject code\ninto the existing tools with the purpose of providing the capability to hide or\nerase system activity from the audit logs.\n\n To address this risk, audit tools must be cryptographically signed to\nprovide the capability to identify when the audit tools have been modified,\nmanipulated, or replaced. An example is a checksum hash of the file or files.'\n desc 'check', \"Verify that Advanced Intrusion Detection Environment (AIDE) is properly configured to use cryptographic mechanisms to protect the integrity of audit tools.\n\nIf AIDE is not installed, ask the System Administrator how file integrity checks are performed on the system.\n\nCheck the selection lines to ensure AIDE is configured to add/check with the following command:\n\n $ sudo grep -E '(\\\\/usr\\\\/sbin\\\\/(audit|au|rsys))' /etc/aide.conf\n\n /usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/rsyslogd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512\n\nIf any of the audit tools listed above do not have an appropriate selection line, ask the system administrator to indicate what cryptographic mechanisms are being used to protect the integrity of the audit tools. If there is no evidence of integrity protection, this is a finding.\"\n desc 'fix', 'Add or update the following lines to \"/etc/aide.conf\", to protect the\nintegrity of the audit tools.\n\n # Audit Tools\n /usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/rsyslogd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000278-GPOS-00108'\n tag gid: 'V-230475'\n tag rid: 'SV-258137r880722_rule'\n tag stig_id: 'RHEL-08-030650'\n tag fix_id: 'F-33119r568172_fix'\n tag cci: ['CCI-001496']\n tag nist: ['AU-9 (3)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_tools = %w[/usr/sbin/auditctl\n /usr/sbin/auditd\n /usr/sbin/ausearch\n /usr/sbin/aureport\n /usr/sbin/autrace\n /usr/sbin/rsyslogd\n /usr/sbin/augenrules]\n\n if package('aide').installed?\n audit_tools.each do |tool|\n describe \"selection_line: #{tool}\" do\n subject { aide_conf.where { selection_line.eql?(tool) } }\n its('rules.flatten') { should include 'p' }\n its('rules.flatten') { should include 'i' }\n its('rules.flatten') { should include 'n' }\n its('rules.flatten') { should include 'u' }\n its('rules.flatten') { should include 'g' }\n its('rules.flatten') { should include 's' }\n its('rules.flatten') { should include 'b' }\n its('rules.flatten') { should include 'acl' }\n its('rules.flatten') { should include 'xattrs' }\n its('rules.flatten') { should include 'sha512' }\n end\n end\n else\n describe 'The system is not utilizing Advanced Intrusion Detection Environment (AIDE)' do\n skip 'The system is not utilizing Advanced Intrusion Detection Environment (AIDE), manual review is required.'\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258137.rb" + }, + "title": "RHEL 8 must use cryptographic mechanisms to protect the integrity of\naudit tools.", + "desc": "Protecting the integrity of the tools used for auditing purposes is a\ncritical step toward ensuring the integrity of audit information. Audit\ninformation includes all information (e.g., audit records, audit settings, and\naudit reports) needed to successfully audit information system activity.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.\n\n It is not uncommon for attackers to replace the audit tools or inject code\ninto the existing tools with the purpose of providing the capability to hide or\nerase system activity from the audit logs.\n\n To address this risk, audit tools must be cryptographically signed to\nprovide the capability to identify when the audit tools have been modified,\nmanipulated, or replaced. An example is a checksum hash of the file or files.", + "descriptions": { + "default": "Protecting the integrity of the tools used for auditing purposes is a\ncritical step toward ensuring the integrity of audit information. Audit\ninformation includes all information (e.g., audit records, audit settings, and\naudit reports) needed to successfully audit information system activity.\n\n Audit tools include, but are not limited to, vendor-provided and open\nsource audit tools needed to successfully view and manipulate audit information\nsystem activity and records. Audit tools include custom queries and report\ngenerators.\n\n It is not uncommon for attackers to replace the audit tools or inject code\ninto the existing tools with the purpose of providing the capability to hide or\nerase system activity from the audit logs.\n\n To address this risk, audit tools must be cryptographically signed to\nprovide the capability to identify when the audit tools have been modified,\nmanipulated, or replaced. An example is a checksum hash of the file or files.", + "check": "Verify that Advanced Intrusion Detection Environment (AIDE) is properly configured to use cryptographic mechanisms to protect the integrity of audit tools.\n\nIf AIDE is not installed, ask the System Administrator how file integrity checks are performed on the system.\n\nCheck the selection lines to ensure AIDE is configured to add/check with the following command:\n\n $ sudo grep -E '(\\/usr\\/sbin\\/(audit|au|rsys))' /etc/aide.conf\n\n /usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/rsyslogd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512\n\nIf any of the audit tools listed above do not have an appropriate selection line, ask the system administrator to indicate what cryptographic mechanisms are being used to protect the integrity of the audit tools. If there is no evidence of integrity protection, this is a finding.", + "fix": "Add or update the following lines to \"/etc/aide.conf\", to protect the\nintegrity of the audit tools.\n\n # Audit Tools\n /usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/rsyslogd p+i+n+u+g+s+b+acl+xattrs+sha512\n /usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000278-GPOS-00108", + "gid": "V-230475", + "rid": "SV-258137r880722_rule", + "stig_id": "RHEL-08-030650", + "fix_id": "F-33119r568172_fix", + "cci": [ + "CCI-001496" + ], + "nist": [ + "AU-9 (3)" + ], + "host": null + } + }, + { + "id": "SV-258138", + "code": "control 'SV-258138' do\n title 'The RHEL 8 file integrity tool must be configured to verify Access\nControl Lists (ACLs).'\n desc 'ACLs can provide permissions beyond those permitted through the file\nmode and must be verified by file integrity tools.\n\n RHEL 8 installation media come with a file integrity tool, Advanced\nIntrusion Detection Environment (AIDE).'\n desc 'check', 'Verify the file integrity tool is configured to verify ACLs.\n\nNote: AIDE is highly configurable at install time. This requirement assumes the \"aide.conf\" file is under the \"/etc\" directory.\n\nIf AIDE is not installed, ask the System Administrator how file integrity checks are performed on the system.\n\nUse the following command to determine if the file is in a location other than \"/etc/aide/aide.conf\":\n\n $ sudo find / -name aide.conf\n\nCheck the \"aide.conf\" file to determine if the \"acl\" rule has been added to the rule list being applied to the files and directories selection lists with the following command:\n\n $ sudo grep -E \"[+]?acl\" /etc/aide.conf\n\n VarFile = OwnerMode+n+l+X+acl\n\nIf the \"acl\" rule is not being used on all selection lines in the \"/etc/aide.conf\" file, is commented out, or ACLs are not being checked by another file integrity tool, this is a finding.'\n desc 'fix', 'Configure the file integrity tool to check file and directory ACLs.\n\n If AIDE is installed, ensure the \"acl\" rule is present on all file and\ndirectory selection lists.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230552'\n tag rid: 'SV-258138r880724_rule'\n tag stig_id: 'RHEL-08-040310'\n tag fix_id: 'F-33196r568403_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe package('aide') do\n it { should be_installed }\n end\n\n findings = []\n aide_conf.where { !selection_line.start_with? '!' }.entries.each do |selection|\n findings.append(selection.selection_line) unless selection.rules.include? 'acl'\n end\n\n describe \"List of monitored files/directories without 'acl' rule\" do\n subject { findings }\n it { should be_empty }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258138.rb" + }, + "title": "The RHEL 8 file integrity tool must be configured to verify Access\nControl Lists (ACLs).", + "desc": "ACLs can provide permissions beyond those permitted through the file\nmode and must be verified by file integrity tools.\n\n RHEL 8 installation media come with a file integrity tool, Advanced\nIntrusion Detection Environment (AIDE).", + "descriptions": { + "default": "ACLs can provide permissions beyond those permitted through the file\nmode and must be verified by file integrity tools.\n\n RHEL 8 installation media come with a file integrity tool, Advanced\nIntrusion Detection Environment (AIDE).", + "check": "Verify the file integrity tool is configured to verify ACLs.\n\nNote: AIDE is highly configurable at install time. This requirement assumes the \"aide.conf\" file is under the \"/etc\" directory.\n\nIf AIDE is not installed, ask the System Administrator how file integrity checks are performed on the system.\n\nUse the following command to determine if the file is in a location other than \"/etc/aide/aide.conf\":\n\n $ sudo find / -name aide.conf\n\nCheck the \"aide.conf\" file to determine if the \"acl\" rule has been added to the rule list being applied to the files and directories selection lists with the following command:\n\n $ sudo grep -E \"[+]?acl\" /etc/aide.conf\n\n VarFile = OwnerMode+n+l+X+acl\n\nIf the \"acl\" rule is not being used on all selection lines in the \"/etc/aide.conf\" file, is commented out, or ACLs are not being checked by another file integrity tool, this is a finding.", + "fix": "Configure the file integrity tool to check file and directory ACLs.\n\n If AIDE is installed, ensure the \"acl\" rule is present on all file and\ndirectory selection lists." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230552", + "rid": "SV-258138r880724_rule", + "stig_id": "RHEL-08-040310", + "fix_id": "F-33196r568403_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258139", + "code": "control 'SV-258139' do\n title 'The RHEL 8 file integrity tool must be configured to verify extended\nattributes.'\n desc 'Extended attributes in file systems are used to contain arbitrary data\nand file metadata with security implications.\n\n RHEL 8 installation media come with a file integrity tool, Advanced\nIntrusion Detection Environment (AIDE).'\n desc 'check', 'Verify the file integrity tool is configured to verify extended attributes.\n\n If AIDE is not installed, ask the System Administrator how file integrity\nchecks are performed on the system.\n\n Note: AIDE is highly configurable at install time. This requirement assumes\nthe \"aide.conf\" file is under the \"/etc\" directory.\n\n Use the following command to determine if the file is in another location:\n\n $ sudo find / -name aide.conf\n\n Check the \"aide.conf\" file to determine if the \"xattrs\" rule has been\nadded to the rule list being applied to the files and directories selection\nlists.\n\n An example rule that includes the \"xattrs\" rule follows:\n\n All= p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux\n /bin All # apply the custom rule to the files in bin\n /sbin All # apply the same custom rule to the files in sbin\n\n If the \"xattrs\" rule is not being used on all uncommented selection lines\nin the \"/etc/aide.conf\" file, or extended attributes are not being checked by\nanother file integrity tool, this is a finding.'\n desc 'fix', 'Configure the file integrity tool to check file and directory extended\nattributes.\n\n If AIDE is installed, ensure the \"xattrs\" rule is present on all\nuncommented file and directory selection lists.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230551'\n tag rid: 'SV-258139r627750_rule'\n tag stig_id: 'RHEL-08-040300'\n tag fix_id: 'F-33195r568400_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe package('aide') do\n it { should be_installed }\n end\n\n findings = []\n aide_conf.where { !selection_line.start_with? '!' }.entries.each do |selection|\n findings.append(selection.selection_line) unless selection.rules.include? 'xattrs'\n end\n\n describe \"List of monitored files/directories without 'xattrs' rule\" do\n subject { findings }\n it { should be_empty }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258139.rb" + }, + "title": "The RHEL 8 file integrity tool must be configured to verify extended\nattributes.", + "desc": "Extended attributes in file systems are used to contain arbitrary data\nand file metadata with security implications.\n\n RHEL 8 installation media come with a file integrity tool, Advanced\nIntrusion Detection Environment (AIDE).", + "descriptions": { + "default": "Extended attributes in file systems are used to contain arbitrary data\nand file metadata with security implications.\n\n RHEL 8 installation media come with a file integrity tool, Advanced\nIntrusion Detection Environment (AIDE).", + "check": "Verify the file integrity tool is configured to verify extended attributes.\n\n If AIDE is not installed, ask the System Administrator how file integrity\nchecks are performed on the system.\n\n Note: AIDE is highly configurable at install time. This requirement assumes\nthe \"aide.conf\" file is under the \"/etc\" directory.\n\n Use the following command to determine if the file is in another location:\n\n $ sudo find / -name aide.conf\n\n Check the \"aide.conf\" file to determine if the \"xattrs\" rule has been\nadded to the rule list being applied to the files and directories selection\nlists.\n\n An example rule that includes the \"xattrs\" rule follows:\n\n All= p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux\n /bin All # apply the custom rule to the files in bin\n /sbin All # apply the same custom rule to the files in sbin\n\n If the \"xattrs\" rule is not being used on all uncommented selection lines\nin the \"/etc/aide.conf\" file, or extended attributes are not being checked by\nanother file integrity tool, this is a finding.", + "fix": "Configure the file integrity tool to check file and directory extended\nattributes.\n\n If AIDE is installed, ensure the \"xattrs\" rule is present on all\nuncommented file and directory selection lists." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230551", + "rid": "SV-258139r627750_rule", + "stig_id": "RHEL-08-040300", + "fix_id": "F-33195r568400_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258140", + "code": "control 'SV-258140' do\n title 'RHEL 8 must have the packages required for offloading audit logs\ninstalled.'\n desc 'Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.'\n desc 'check', 'Verify the operating system has the packages required for offloading audit\nlogs installed with the following commands:\n\n $ sudo yum list installed rsyslog\n\n rsyslog.x86_64 8.1911.0-3.el8 @AppStream\n\n If the \"rsyslog\" package is not installed, ask the administrator to\nindicate how audit logs are being offloaded and what packages are installed to\nsupport it. If there is no evidence of audit logs being offloaded, this is a\nfinding.'\n desc 'fix', 'Configure the operating system to offload audit logs by installing the\nrequired packages with the following command:\n\n $ sudo yum install rsyslog'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230477'\n tag rid: 'SV-258140r627750_rule'\n tag stig_id: 'RHEL-08-030670'\n tag fix_id: 'F-33121r568178_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe package('rsyslog') do\n it { should be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258140.rb" + }, + "title": "RHEL 8 must have the packages required for offloading audit logs\ninstalled.", + "desc": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.", + "descriptions": { + "default": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.", + "check": "Verify the operating system has the packages required for offloading audit\nlogs installed with the following commands:\n\n $ sudo yum list installed rsyslog\n\n rsyslog.x86_64 8.1911.0-3.el8 @AppStream\n\n If the \"rsyslog\" package is not installed, ask the administrator to\nindicate how audit logs are being offloaded and what packages are installed to\nsupport it. If there is no evidence of audit logs being offloaded, this is a\nfinding.", + "fix": "Configure the operating system to offload audit logs by installing the\nrequired packages with the following command:\n\n $ sudo yum install rsyslog" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230477", + "rid": "SV-258140r627750_rule", + "stig_id": "RHEL-08-030670", + "fix_id": "F-33121r568178_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258141", + "code": "control 'SV-258141' do\n title 'RHEL 8 must have the packages required for encrypting offloaded audit\nlogs installed.'\n desc 'Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"rsyslog-gnutls\" (which is a secure\ncommunications library implementing the SSL, TLS and DTLS protocols), and you\nhave a method to securely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.'\n desc 'check', 'Verify the operating system has the packages required for encrypting\noffloaded audit logs installed with the following commands:\n\n $ sudo yum list installed rsyslog-gnutls\n\n rsyslog-gnutls.x86_64 8.1911.0-3.el8 @AppStream\n\n If the \"rsyslog-gnutls\" package is not installed, ask the administrator\nto indicate how audit logs are being encrypted during offloading and what\npackages are installed to support it. If there is no evidence of audit logs\nbeing encrypted during offloading, this is a finding.'\n desc 'fix', 'Configure the operating system to encrypt offloaded audit logs by\ninstalling the required packages with the following command:\n\n $ sudo yum install rsyslog-gnutls'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230478'\n tag rid: 'SV-258141r744011_rule'\n tag stig_id: 'RHEL-08-030680'\n tag fix_id: 'F-33122r744010_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe package('rsyslog-gnutls') do\n it { should be_installed }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258141.rb" + }, + "title": "RHEL 8 must have the packages required for encrypting offloaded audit\nlogs installed.", + "desc": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"rsyslog-gnutls\" (which is a secure\ncommunications library implementing the SSL, TLS and DTLS protocols), and you\nhave a method to securely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.", + "descriptions": { + "default": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"rsyslog-gnutls\" (which is a secure\ncommunications library implementing the SSL, TLS and DTLS protocols), and you\nhave a method to securely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.", + "check": "Verify the operating system has the packages required for encrypting\noffloaded audit logs installed with the following commands:\n\n $ sudo yum list installed rsyslog-gnutls\n\n rsyslog-gnutls.x86_64 8.1911.0-3.el8 @AppStream\n\n If the \"rsyslog-gnutls\" package is not installed, ask the administrator\nto indicate how audit logs are being encrypted during offloading and what\npackages are installed to support it. If there is no evidence of audit logs\nbeing encrypted during offloading, this is a finding.", + "fix": "Configure the operating system to encrypt offloaded audit logs by\ninstalling the required packages with the following command:\n\n $ sudo yum install rsyslog-gnutls" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230478", + "rid": "SV-258141r744011_rule", + "stig_id": "RHEL-08-030680", + "fix_id": "F-33122r744010_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258142", + "code": "control 'SV-258142' do\n title 'The rsyslog service must be running in RHEL 8.'\n desc 'Configuring RHEL 8 to implement organization-wide security\nimplementation guides and security checklists ensures compliance with federal\nstandards and establishes a common security baseline across the DoD that\nreflects the most restrictive security posture consistent with operational\nrequirements.\n\n Configuration settings are the set of parameters that can be changed in\nhardware, software, or firmware components of the system that affect the\nsecurity posture and/or functionality of the system. Security-related\nparameters are those parameters impacting the security state of the system,\nincluding the parameters required to satisfy other security control\nrequirements. Security-related parameters include, for example: registry\nsettings; account, file, directory permission settings; and settings for\nfunctions, ports, protocols, services, and remote connections.'\n desc 'check', 'Verify the rsyslog service is enabled and active with the following\ncommands:\n\n $ sudo systemctl is-enabled rsyslog\n\n enabled\n\n $ sudo systemctl is-active rsyslog\n\n active\n\n If the service is not \"enabled\" and \"active\" this is a finding.'\n desc 'fix', 'Start the auditd service, and enable the rsyslog service with the following\ncommands:\n\n $ sudo systemctl start rsyslog.service\n\n $ sudo systemctl enable rsyslog.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230298'\n tag rid: 'SV-258142r627750_rule'\n tag stig_id: 'RHEL-08-010561'\n tag fix_id: 'F-32942r567641_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe service('rsyslog') do\n it { should be_enabled }\n it { should be_running }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258142.rb" + }, + "title": "The rsyslog service must be running in RHEL 8.", + "desc": "Configuring RHEL 8 to implement organization-wide security\nimplementation guides and security checklists ensures compliance with federal\nstandards and establishes a common security baseline across the DoD that\nreflects the most restrictive security posture consistent with operational\nrequirements.\n\n Configuration settings are the set of parameters that can be changed in\nhardware, software, or firmware components of the system that affect the\nsecurity posture and/or functionality of the system. Security-related\nparameters are those parameters impacting the security state of the system,\nincluding the parameters required to satisfy other security control\nrequirements. Security-related parameters include, for example: registry\nsettings; account, file, directory permission settings; and settings for\nfunctions, ports, protocols, services, and remote connections.", + "descriptions": { + "default": "Configuring RHEL 8 to implement organization-wide security\nimplementation guides and security checklists ensures compliance with federal\nstandards and establishes a common security baseline across the DoD that\nreflects the most restrictive security posture consistent with operational\nrequirements.\n\n Configuration settings are the set of parameters that can be changed in\nhardware, software, or firmware components of the system that affect the\nsecurity posture and/or functionality of the system. Security-related\nparameters are those parameters impacting the security state of the system,\nincluding the parameters required to satisfy other security control\nrequirements. Security-related parameters include, for example: registry\nsettings; account, file, directory permission settings; and settings for\nfunctions, ports, protocols, services, and remote connections.", + "check": "Verify the rsyslog service is enabled and active with the following\ncommands:\n\n $ sudo systemctl is-enabled rsyslog\n\n enabled\n\n $ sudo systemctl is-active rsyslog\n\n active\n\n If the service is not \"enabled\" and \"active\" this is a finding.", + "fix": "Start the auditd service, and enable the rsyslog service with the following\ncommands:\n\n $ sudo systemctl start rsyslog.service\n\n $ sudo systemctl enable rsyslog.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230298", + "rid": "SV-258142r627750_rule", + "stig_id": "RHEL-08-010561", + "fix_id": "F-32942r567641_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258143", + "code": "control 'SV-258143' do\n title 'RHEL 9 must be configured so that the rsyslog daemon does not accept log messages from other servers unless the server is being used for log aggregation.'\n desc \"Unintentionally running a rsyslog server accepting remote messages puts the system at increased risk. Malicious rsyslog messages sent to the server could exploit vulnerabilities in the server software itself, could introduce misleading information into the system's logs, or could fill the system's storage leading to a denial of service.\n\nIf the system is intended to be a log aggregation server, its use must be documented with the information system security officer (ISSO).\"\n desc 'check', 'Verify that RHEL 9 is not configured to receive remote logs using rsyslog with the following commands:\n\n$ grep -i modload /etc/rsyslog.conf /etc/rsyslog.d/*\n$ModLoad imtcp\n$ModLoad imrelp\n\n$ grep -i serverrun /etc/rsyslog.conf /etc/rsyslog.d/*\n$InputTCPServerRun 514\n$InputRELPServerRun 514\n\nNote: An error about no files or directories may be returned. This is not a finding.\n\nIf any lines are returned by the command, then rsyslog is configured to receive remote messages, and this is a finding.'\n desc 'fix', 'Configure RHEL 9 to not receive remote logs using rsyslog.\n\nRemove the lines in /etc/rsyslog.conf and any files in the /etc/rsyslog.d directory that match any of the following:\n\n$ModLoad imtcp\n$ModLoad imudp\n$ModLoad imrelp\n$InputTCPServerRun [0-9]*\n$UDPServerRun [0-9]*\n$InputRELPServerRun [0-9]*\n\nThe rsyslog daemon must be restarted for the changes to take effect:\n\n$ sudo systemctl restart rsyslog.service'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61884r926414_chk'\n tag severity: 'medium'\n tag gid: 'V-258143'\n tag rid: 'SV-258143r926416_rule'\n tag stig_id: 'RHEL-09-652025'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61808r926415_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258143.rb" + }, + "title": "RHEL 9 must be configured so that the rsyslog daemon does not accept log messages from other servers unless the server is being used for log aggregation.", + "desc": "Unintentionally running a rsyslog server accepting remote messages puts the system at increased risk. Malicious rsyslog messages sent to the server could exploit vulnerabilities in the server software itself, could introduce misleading information into the system's logs, or could fill the system's storage leading to a denial of service.\n\nIf the system is intended to be a log aggregation server, its use must be documented with the information system security officer (ISSO).", + "descriptions": { + "default": "Unintentionally running a rsyslog server accepting remote messages puts the system at increased risk. Malicious rsyslog messages sent to the server could exploit vulnerabilities in the server software itself, could introduce misleading information into the system's logs, or could fill the system's storage leading to a denial of service.\n\nIf the system is intended to be a log aggregation server, its use must be documented with the information system security officer (ISSO).", + "check": "Verify that RHEL 9 is not configured to receive remote logs using rsyslog with the following commands:\n\n$ grep -i modload /etc/rsyslog.conf /etc/rsyslog.d/*\n$ModLoad imtcp\n$ModLoad imrelp\n\n$ grep -i serverrun /etc/rsyslog.conf /etc/rsyslog.d/*\n$InputTCPServerRun 514\n$InputRELPServerRun 514\n\nNote: An error about no files or directories may be returned. This is not a finding.\n\nIf any lines are returned by the command, then rsyslog is configured to receive remote messages, and this is a finding.", + "fix": "Configure RHEL 9 to not receive remote logs using rsyslog.\n\nRemove the lines in /etc/rsyslog.conf and any files in the /etc/rsyslog.d directory that match any of the following:\n\n$ModLoad imtcp\n$ModLoad imudp\n$ModLoad imrelp\n$InputTCPServerRun [0-9]*\n$UDPServerRun [0-9]*\n$InputRELPServerRun [0-9]*\n\nThe rsyslog daemon must be restarted for the changes to take effect:\n\n$ sudo systemctl restart rsyslog.service" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61884r926414_chk", + "severity": "medium", + "gid": "V-258143", + "rid": "SV-258143r926416_rule", + "stig_id": "RHEL-09-652025", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61808r926415_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258144", + "code": "control 'SV-258144' do\n title 'All RHEL 8 remote access methods must be monitored.'\n desc 'Remote access services, such as those providing remote access to\nnetwork devices and information systems, which lack automated monitoring\ncapabilities, increase risk and make remote user access management difficult at\nbest.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n\n Automated monitoring of remote access sessions allows organizations to\ndetect cyber attacks and ensure ongoing compliance with remote access policies\nby auditing connection activities of remote access capabilities, such as Remote\nDesktop Protocol (RDP), on a variety of information system components (e.g.,\nservers, workstations, notebook computers, smartphones, and tablets).'\n desc 'check', %q(Verify that RHEL 8 monitors all remote access methods.\n\n Check that remote access methods are being logged by running the following\ncommand:\n\n $ sudo grep -E '(auth.*|authpriv.*|daemon.*)' /etc/rsyslog.conf\n\n auth.*;authpriv.*;daemon.* /var/log/secure\n\n If \"auth.*\", \"authpriv.*\" or \"daemon.*\" are not configured to be\nlogged, this is a finding.)\n desc 'fix', 'Configure RHEL 8 to monitor all remote access methods by installing rsyslog\nwith the following command:\n\n $ sudo yum install rsyslog\n\n Then add or update the following lines to the \"/etc/rsyslog.conf\" file:\n\n auth.*;authpriv.*;daemon.* /var/log/secure\n\n The \"rsyslog\" service must be restarted for the changes to take effect.\nTo restart the \"rsyslog\" service, run the following command:\n\n $ sudo systemctl restart rsyslog.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000032-GPOS-00013'\n tag gid: 'V-230228'\n tag rid: 'SV-258144r627750_rule'\n tag stig_id: 'RHEL-08-010070'\n tag fix_id: 'F-32872r567431_fix'\n tag cci: ['CCI-000067']\n tag nist: ['AC-17 (1)']\n tag 'host'\n tag 'container-conditional'\n\n only_if('Control not applicable; remote access not configured within containerized RHEL', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?)\n }\n\n rsyslog = file('/etc/rsyslog.conf')\n\n describe rsyslog do\n it { should exist }\n end\n\n if rsyslog.exist?\n\n auth_pattern = %r{^\\s*[a-z.;*]*auth(,[a-z,]+)*\\.\\*\\s*/*}\n authpriv_pattern = %r{^\\s*[a-z.;*]*authpriv(,[a-z,]+)*\\.\\*\\s*/*}\n daemon_pattern = %r{^\\s*[a-z.;*]*daemon(,[a-z,]+)*\\.\\*\\s*/*}\n\n rsyslog_conf = command('grep -E \\'(auth.*|authpriv.*|daemon.*)\\' /etc/rsyslog.conf')\n\n describe 'Logged remote access methods' do\n it 'should include auth.*' do\n expect(rsyslog_conf.stdout).to match(auth_pattern), 'auth.* not configured for logging'\n end\n it 'should include authpriv.*' do\n expect(rsyslog_conf.stdout).to match(authpriv_pattern), 'authpriv.* not configured for logging'\n end\n it 'should include daemon.*' do\n expect(rsyslog_conf.stdout).to match(daemon_pattern), 'daemon.* not configured for logging'\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258144.rb" + }, + "title": "All RHEL 8 remote access methods must be monitored.", + "desc": "Remote access services, such as those providing remote access to\nnetwork devices and information systems, which lack automated monitoring\ncapabilities, increase risk and make remote user access management difficult at\nbest.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n\n Automated monitoring of remote access sessions allows organizations to\ndetect cyber attacks and ensure ongoing compliance with remote access policies\nby auditing connection activities of remote access capabilities, such as Remote\nDesktop Protocol (RDP), on a variety of information system components (e.g.,\nservers, workstations, notebook computers, smartphones, and tablets).", + "descriptions": { + "default": "Remote access services, such as those providing remote access to\nnetwork devices and information systems, which lack automated monitoring\ncapabilities, increase risk and make remote user access management difficult at\nbest.\n\n Remote access is access to DoD nonpublic information systems by an\nauthorized user (or an information system) communicating through an external,\nnon-organization-controlled network. Remote access methods include, for\nexample, dial-up, broadband, and wireless.\n\n Automated monitoring of remote access sessions allows organizations to\ndetect cyber attacks and ensure ongoing compliance with remote access policies\nby auditing connection activities of remote access capabilities, such as Remote\nDesktop Protocol (RDP), on a variety of information system components (e.g.,\nservers, workstations, notebook computers, smartphones, and tablets).", + "check": "Verify that RHEL 8 monitors all remote access methods.\n\n Check that remote access methods are being logged by running the following\ncommand:\n\n $ sudo grep -E '(auth.*|authpriv.*|daemon.*)' /etc/rsyslog.conf\n\n auth.*;authpriv.*;daemon.* /var/log/secure\n\n If \"auth.*\", \"authpriv.*\" or \"daemon.*\" are not configured to be\nlogged, this is a finding.", + "fix": "Configure RHEL 8 to monitor all remote access methods by installing rsyslog\nwith the following command:\n\n $ sudo yum install rsyslog\n\n Then add or update the following lines to the \"/etc/rsyslog.conf\" file:\n\n auth.*;authpriv.*;daemon.* /var/log/secure\n\n The \"rsyslog\" service must be restarted for the changes to take effect.\nTo restart the \"rsyslog\" service, run the following command:\n\n $ sudo systemctl restart rsyslog.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000032-GPOS-00013", + "gid": "V-230228", + "rid": "SV-258144r627750_rule", + "stig_id": "RHEL-08-010070", + "fix_id": "F-32872r567431_fix", + "cci": [ + "CCI-000067" + ], + "nist": [ + "AC-17 (1)" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258145", + "code": "control 'SV-258145' do\n title 'RHEL 9 must be configured to offload audit records onto a different system from the system being audited via syslog.'\n desc 'The auditd service does not include the ability to send audit records to a centralized server for management directly. However, it can use a plug-in for audit event multiplexor (audispd) to pass audit records to the local syslog server.\n\n'\n desc 'check', 'Verify RHEL 9 is configured use the audisp-remote syslog service with the following command:\n\n$ sudo grep active /etc/audit/plugins.d/syslog.conf \n\nactive = yes\n\nIf the \"active\" keyword does not have a value of \"yes\", the line is commented out, or the line is missing, this is a finding.'\n desc 'fix', 'Edit the /etc/audit/plugins.d/syslog.conf file and add or update the \"active\" option:\n\nactive = yes\n\nThe audit daemon must be restarted for changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61886r926420_chk'\n tag severity: 'medium'\n tag gid: 'V-258145'\n tag rid: 'SV-258145r926422_rule'\n tag stig_id: 'RHEL-09-652035'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag fix_id: 'F-61810r926421_fix'\n tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224']\n tag 'documentable'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258145.rb" + }, + "title": "RHEL 9 must be configured to offload audit records onto a different system from the system being audited via syslog.", + "desc": "The auditd service does not include the ability to send audit records to a centralized server for management directly. However, it can use a plug-in for audit event multiplexor (audispd) to pass audit records to the local syslog server.\n\n", + "descriptions": { + "default": "The auditd service does not include the ability to send audit records to a centralized server for management directly. However, it can use a plug-in for audit event multiplexor (audispd) to pass audit records to the local syslog server.\n\n", + "check": "Verify RHEL 9 is configured use the audisp-remote syslog service with the following command:\n\n$ sudo grep active /etc/audit/plugins.d/syslog.conf \n\nactive = yes\n\nIf the \"active\" keyword does not have a value of \"yes\", the line is commented out, or the line is missing, this is a finding.", + "fix": "Edit the /etc/audit/plugins.d/syslog.conf file and add or update the \"active\" option:\n\nactive = yes\n\nThe audit daemon must be restarted for changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61886r926420_chk", + "severity": "medium", + "gid": "V-258145", + "rid": "SV-258145r926422_rule", + "stig_id": "RHEL-09-652035", + "gtitle": "SRG-OS-000342-GPOS-00133", + "fix_id": "F-61810r926421_fix", + "satisfies": [ + "SRG-OS-000342-GPOS-00133", + "SRG-OS-000479-GPOS-00224" + ], + "documentable": null, + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ] + } + }, + { + "id": "SV-258146", + "code": "control 'SV-258146' do\n title 'RHEL 8 must authenticate the remote logging server for off-loading\naudit logs.'\n desc 'Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n \"Rsyslog\" supported authentication modes include:\n anon - anonymous authentication\n x509/fingerprint - certificate fingerprint authentication\n x509/certvalid - certificate validation only\n x509/name - certificate validation and subject name authentication.'\n desc 'check', %q(Verify the operating system authenticates the remote logging server for\noff-loading audit logs with the following command:\n\n $ sudo grep -i '$ActionSendStreamDriverAuthMode' /etc/rsyslog.conf\n/etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:$ActionSendStreamDriverAuthMode x509/name\n\n If the value of the \"$ActionSendStreamDriverAuthMode\" option is not set\nto \"x509/name\" or the line is commented out, ask the System Administrator to\nindicate how the audit logs are off-loaded to a different system or media.\n\n If there is no evidence that the transfer of the audit logs being\noff-loaded to another system or media is encrypted, this is a finding.)\n desc 'fix', 'Configure the operating system to authenticate the remote logging server\nfor off-loading audit logs by setting the following option in\n\"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/[customfile].conf\":\n\n $ActionSendStreamDriverAuthMode x509/name'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224']\n tag gid: 'V-230482'\n tag rid: 'SV-258146r877390_rule'\n tag stig_id: 'RHEL-08-030720'\n tag fix_id: 'F-33126r568193_fix'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe 'rsyslog configuration' do\n subject {\n command(\"grep -i '^\\$ActionSendStreamDriverAuthMode' #{input('logging_conf_files').join(' ')} | awk -F ':' '{ print $2 }'\").stdout\n }\n it { should match %r{\\$ActionSendStreamDriverAuthMode\\s+x509/name} }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258146.rb" + }, + "title": "RHEL 8 must authenticate the remote logging server for off-loading\naudit logs.", + "desc": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n \"Rsyslog\" supported authentication modes include:\n anon - anonymous authentication\n x509/fingerprint - certificate fingerprint authentication\n x509/certvalid - certificate validation only\n x509/name - certificate validation and subject name authentication.", + "descriptions": { + "default": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n \"Rsyslog\" supported authentication modes include:\n anon - anonymous authentication\n x509/fingerprint - certificate fingerprint authentication\n x509/certvalid - certificate validation only\n x509/name - certificate validation and subject name authentication.", + "check": "Verify the operating system authenticates the remote logging server for\noff-loading audit logs with the following command:\n\n $ sudo grep -i '$ActionSendStreamDriverAuthMode' /etc/rsyslog.conf\n/etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:$ActionSendStreamDriverAuthMode x509/name\n\n If the value of the \"$ActionSendStreamDriverAuthMode\" option is not set\nto \"x509/name\" or the line is commented out, ask the System Administrator to\nindicate how the audit logs are off-loaded to a different system or media.\n\n If there is no evidence that the transfer of the audit logs being\noff-loaded to another system or media is encrypted, this is a finding.", + "fix": "Configure the operating system to authenticate the remote logging server\nfor off-loading audit logs by setting the following option in\n\"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/[customfile].conf\":\n\n $ActionSendStreamDriverAuthMode x509/name" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000342-GPOS-00133", + "satisfies": [ + "SRG-OS-000342-GPOS-00133", + "SRG-OS-000479-GPOS-00224" + ], + "gid": "V-230482", + "rid": "SV-258146r877390_rule", + "stig_id": "RHEL-08-030720", + "fix_id": "F-33126r568193_fix", + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ], + "host": null + } + }, + { + "id": "SV-258147", + "code": "control 'SV-258147' do\n title 'RHEL 8 must encrypt the transfer of audit records off-loaded onto a\ndifferent system or media from the system being audited.'\n desc 'Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.'\n desc 'check', %q(Verify the operating system encrypts audit records off-loaded onto a different system or media from the system being audited with the following commands:\n\n$ sudo grep -i '$DefaultNetstreamDriver' /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n/etc/rsyslog.conf:$DefaultNetstreamDriver gtls\n\nIf the value of the \"$DefaultNetstreamDriver\" option is not set to \"gtls\" or the line is commented out, this is a finding.\n\n$ sudo grep -i '$ActionSendStreamDriverMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n/etc/rsyslog.conf:$ActionSendStreamDriverMode 1\n\nIf the value of the \"$ActionSendStreamDriverMode\" option is not set to \"1\" or the line is commented out, this is a finding.\n\nIf neither of the definitions above are set, ask the System Administrator to indicate how the audit logs are off-loaded to a different system or media.\n\nIf there is no evidence that the transfer of the audit logs being off-loaded to another system or media is encrypted, this is a finding.)\n desc 'fix', 'Configure the operating system to encrypt off-loaded audit records by\nsetting the following options in \"/etc/rsyslog.conf\" or\n\"/etc/rsyslog.d/[customfile].conf\":\n\n $DefaultNetstreamDriver gtls\n $ActionSendStreamDriverMode 1'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224']\n tag gid: 'V-230481'\n tag rid: 'SV-258147r877390_rule'\n tag stig_id: 'RHEL-08-030710'\n tag fix_id: 'F-33125r568190_fix'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe 'rsyslog configuration' do\n subject {\n command(\"grep -i '^\\$DefaultNetstreamDriver' #{input('logging_conf_files').join(' ')} | awk -F ':' '{ print $2 }'\").stdout\n }\n it { should match(/\\$DefaultNetstreamDriver\\s+gtls/) }\n end\n\n describe 'rsyslog configuration' do\n subject {\n command(\"grep -i '^\\$ActionSendStreamDriverMode' #{input('logging_conf_files').join(' ')} | awk -F ':' '{ print $2 }'\").stdout\n }\n it { should match(/\\$ActionSendStreamDriverMode\\s+1/) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258147.rb" + }, + "title": "RHEL 8 must encrypt the transfer of audit records off-loaded onto a\ndifferent system or media from the system being audited.", + "desc": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.", + "descriptions": { + "default": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.", + "check": "Verify the operating system encrypts audit records off-loaded onto a different system or media from the system being audited with the following commands:\n\n$ sudo grep -i '$DefaultNetstreamDriver' /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n/etc/rsyslog.conf:$DefaultNetstreamDriver gtls\n\nIf the value of the \"$DefaultNetstreamDriver\" option is not set to \"gtls\" or the line is commented out, this is a finding.\n\n$ sudo grep -i '$ActionSendStreamDriverMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n/etc/rsyslog.conf:$ActionSendStreamDriverMode 1\n\nIf the value of the \"$ActionSendStreamDriverMode\" option is not set to \"1\" or the line is commented out, this is a finding.\n\nIf neither of the definitions above are set, ask the System Administrator to indicate how the audit logs are off-loaded to a different system or media.\n\nIf there is no evidence that the transfer of the audit logs being off-loaded to another system or media is encrypted, this is a finding.", + "fix": "Configure the operating system to encrypt off-loaded audit records by\nsetting the following options in \"/etc/rsyslog.conf\" or\n\"/etc/rsyslog.d/[customfile].conf\":\n\n $DefaultNetstreamDriver gtls\n $ActionSendStreamDriverMode 1" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000342-GPOS-00133", + "satisfies": [ + "SRG-OS-000342-GPOS-00133", + "SRG-OS-000479-GPOS-00224" + ], + "gid": "V-230481", + "rid": "SV-258147r877390_rule", + "stig_id": "RHEL-08-030710", + "fix_id": "F-33125r568190_fix", + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ], + "host": null + } + }, + { + "id": "SV-258148", + "code": "control 'SV-258148' do\n title 'RHEL 9 must encrypt via the gtls driver the transfer of audit records offloaded onto a different system or media from the system being audited via rsyslog.'\n desc 'Information stored in one location is vulnerable to accidental or incidental deletion or alteration.\n\nOffloading is a common process in information systems with limited audit storage capacity.\n\nRHEL 9 installation media provides \"rsyslogd\", a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Coupling this utility with \"gnutls\" (a secure communications library implementing the SSL, TLS and DTLS protocols) creates a method to securely encrypt and offload auditing.\n\n'\n desc 'check', %q(Verify RHEL 9 uses the gtls driver to encrypt audit records offloaded onto a different system or media from the system being audited with the following command:\n\n$ sudo grep -i '$DefaultNetstreamDriver' /etc/rsyslog.conf /etc/rsyslog.d/*.conf \n\n/etc/rsyslog.conf:$DefaultNetstreamDriver gtls \n\nIf the value of the \"$DefaultNetstreamDriver\" option is not set to \"gtls\" or the line is commented out, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to use the gtls driver to encrypt offloaded audit records by setting the following options in \"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/[customfile].conf\":\n\n$DefaultNetstreamDriver gtls'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61889r926429_chk'\n tag severity: 'medium'\n tag gid: 'V-258148'\n tag rid: 'SV-258148r926431_rule'\n tag stig_id: 'RHEL-09-652050'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag fix_id: 'F-61813r926430_fix'\n tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224']\n tag 'documentable'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258148.rb" + }, + "title": "RHEL 9 must encrypt via the gtls driver the transfer of audit records offloaded onto a different system or media from the system being audited via rsyslog.", + "desc": "Information stored in one location is vulnerable to accidental or incidental deletion or alteration.\n\nOffloading is a common process in information systems with limited audit storage capacity.\n\nRHEL 9 installation media provides \"rsyslogd\", a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Coupling this utility with \"gnutls\" (a secure communications library implementing the SSL, TLS and DTLS protocols) creates a method to securely encrypt and offload auditing.\n\n", + "descriptions": { + "default": "Information stored in one location is vulnerable to accidental or incidental deletion or alteration.\n\nOffloading is a common process in information systems with limited audit storage capacity.\n\nRHEL 9 installation media provides \"rsyslogd\", a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Coupling this utility with \"gnutls\" (a secure communications library implementing the SSL, TLS and DTLS protocols) creates a method to securely encrypt and offload auditing.\n\n", + "check": "Verify RHEL 9 uses the gtls driver to encrypt audit records offloaded onto a different system or media from the system being audited with the following command:\n\n$ sudo grep -i '$DefaultNetstreamDriver' /etc/rsyslog.conf /etc/rsyslog.d/*.conf \n\n/etc/rsyslog.conf:$DefaultNetstreamDriver gtls \n\nIf the value of the \"$DefaultNetstreamDriver\" option is not set to \"gtls\" or the line is commented out, this is a finding.", + "fix": "Configure RHEL 9 to use the gtls driver to encrypt offloaded audit records by setting the following options in \"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/[customfile].conf\":\n\n$DefaultNetstreamDriver gtls" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61889r926429_chk", + "severity": "medium", + "gid": "V-258148", + "rid": "SV-258148r926431_rule", + "stig_id": "RHEL-09-652050", + "gtitle": "SRG-OS-000342-GPOS-00133", + "fix_id": "F-61813r926430_fix", + "satisfies": [ + "SRG-OS-000342-GPOS-00133", + "SRG-OS-000479-GPOS-00224" + ], + "documentable": null, + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ] + } + }, + { + "id": "SV-258149", + "code": "control 'SV-258149' do\n title 'The RHEL 8 audit records must be off-loaded onto a different system or\nstorage media from the system being audited.'\n desc 'Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.'\n desc 'check', 'Verify the audit system offloads audit records onto a different system or media from the system being audited with the following command:\n\n $ sudo grep @@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:*.* @@[logaggregationserver.example.mil]:[port]\n\nIf a remote server is not configured, or the line is commented out, ask the system administrator to indicate how the audit logs are offloaded to a different system or media.\n\nIf there is no evidence that the audit logs are being offloaded to another system or media, this is a finding.'\n desc 'fix', 'Configure the operating system to offload audit records onto a different system or media from the system being audited by specifying the remote logging server in \"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/[customfile].conf\" with the name or IP address of the log aggregation server.\n\nFor UDP:\n *.* @[logaggregationserver.example.mil]:[port]\n\nFor TCP:\n *.* @@[logaggregationserver.example.mil]:[port]'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224']\n tag gid: 'V-230479'\n tag rid: 'SV-258149r917883_rule'\n tag stig_id: 'RHEL-08-030690'\n tag fix_id: 'F-33123r917882_fix'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe command(\"grep @@ #{input('logging_conf_files').join(' ')}\") do\n its('stdout') { should match(/^[^#]*:\\*\\.\\*\\s*@@[a-z.0-9]*:?[0-9]*?/) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258149.rb" + }, + "title": "The RHEL 8 audit records must be off-loaded onto a different system or\nstorage media from the system being audited.", + "desc": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.", + "descriptions": { + "default": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.\n\n Rsyslog provides three ways to forward message: the traditional UDP\ntransport, which is extremely lossy but standard; the plain TCP based\ntransport, which loses messages only during certain situations but is widely\navailable; and the RELP transport, which does not lose messages but is\ncurrently available only as part of the rsyslogd 3.15.0 and above.\n Examples of each configuration:\n UDP *.* @remotesystemname\n TCP *.* @@remotesystemname\n RELP *.* :omrelp:remotesystemname:2514\n Note that a port number was given as there is no standard port for RELP.", + "check": "Verify the audit system offloads audit records onto a different system or media from the system being audited with the following command:\n\n $ sudo grep @@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:*.* @@[logaggregationserver.example.mil]:[port]\n\nIf a remote server is not configured, or the line is commented out, ask the system administrator to indicate how the audit logs are offloaded to a different system or media.\n\nIf there is no evidence that the audit logs are being offloaded to another system or media, this is a finding.", + "fix": "Configure the operating system to offload audit records onto a different system or media from the system being audited by specifying the remote logging server in \"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/[customfile].conf\" with the name or IP address of the log aggregation server.\n\nFor UDP:\n *.* @[logaggregationserver.example.mil]:[port]\n\nFor TCP:\n *.* @@[logaggregationserver.example.mil]:[port]" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000342-GPOS-00133", + "satisfies": [ + "SRG-OS-000342-GPOS-00133", + "SRG-OS-000479-GPOS-00224" + ], + "gid": "V-230479", + "rid": "SV-258149r917883_rule", + "stig_id": "RHEL-08-030690", + "fix_id": "F-33123r917882_fix", + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ], + "host": null + } + }, + { + "id": "SV-258150", + "code": "control 'SV-258150' do\n title 'Cron logging must be implemented in RHEL 8.'\n desc 'Cron logging can be used to trace the successful or unsuccessful\nexecution of cron jobs. It can also be used to spot intrusions into the use of\nthe cron facility by unauthorized and malicious users.'\n desc 'check', 'Verify that \"rsyslog\" is configured to log cron events with the following\ncommand:\n\n Note: If another logging package is used, substitute the utility\nconfiguration file for \"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/*.conf\" files.\n\n $ sudo grep -s cron /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none\n /var/log/messages\n /etc/rsyslog.conf:# Log cron stuff\n /etc/rsyslog.conf:cron.*\n /var/log/cron\n\n If the command does not return a response, check for cron logging all\nfacilities with the following command.\n\n $ sudo grep -s /var/log/messages /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none\n /var/log/messages\n\n If \"rsyslog\" is not logging messages for the cron facility or all\nfacilities, this is a finding.'\n desc 'fix', 'Configure \"rsyslog\" to log all cron messages by adding or updating the\nfollowing line to \"/etc/rsyslog.conf\" or a configuration file in the\n/etc/rsyslog.d/ directory:\n\n cron.* /var/log/cron\n\n The rsyslog daemon must be restarted for the changes to take effect:\n $ sudo systemctl restart rsyslog.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230387'\n tag rid: 'SV-258150r743996_rule'\n tag stig_id: 'RHEL-08-030010'\n tag fix_id: 'F-33031r743995_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe.one do\n describe command(\"grep -hsv \\\"^#\\\" #{input('logging_conf_files').join(' ')} | grep ^cron\") do\n its('stdout') { should match %r{cron\\.\\*\\s*/var/log/cron} }\n end\n describe command(\"grep -hsv \\\"^#\\\" #{input('logging_conf_files').join(' ')} | grep /var/log/messages\") do\n its('stdout') { should match %r{\\*.info;mail.none;authpriv.none;cron.none\\s*/var/log/messages} }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258150.rb" + }, + "title": "Cron logging must be implemented in RHEL 8.", + "desc": "Cron logging can be used to trace the successful or unsuccessful\nexecution of cron jobs. It can also be used to spot intrusions into the use of\nthe cron facility by unauthorized and malicious users.", + "descriptions": { + "default": "Cron logging can be used to trace the successful or unsuccessful\nexecution of cron jobs. It can also be used to spot intrusions into the use of\nthe cron facility by unauthorized and malicious users.", + "check": "Verify that \"rsyslog\" is configured to log cron events with the following\ncommand:\n\n Note: If another logging package is used, substitute the utility\nconfiguration file for \"/etc/rsyslog.conf\" or \"/etc/rsyslog.d/*.conf\" files.\n\n $ sudo grep -s cron /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none\n /var/log/messages\n /etc/rsyslog.conf:# Log cron stuff\n /etc/rsyslog.conf:cron.*\n /var/log/cron\n\n If the command does not return a response, check for cron logging all\nfacilities with the following command.\n\n $ sudo grep -s /var/log/messages /etc/rsyslog.conf /etc/rsyslog.d/*.conf\n\n /etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none\n /var/log/messages\n\n If \"rsyslog\" is not logging messages for the cron facility or all\nfacilities, this is a finding.", + "fix": "Configure \"rsyslog\" to log all cron messages by adding or updating the\nfollowing line to \"/etc/rsyslog.conf\" or a configuration file in the\n/etc/rsyslog.d/ directory:\n\n cron.* /var/log/cron\n\n The rsyslog daemon must be restarted for the changes to take effect:\n $ sudo systemctl restart rsyslog.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230387", + "rid": "SV-258150r743996_rule", + "stig_id": "RHEL-08-030010", + "fix_id": "F-33031r743995_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258151", + "code": "control 'SV-258151' do\n title 'The RHEL 8 audit package must be installed.'\n desc 'Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Associating event types with detected events in RHEL 8 audit logs provides\na means of investigating an attack, recognizing resource utilization or\ncapacity thresholds, or identifying an improperly configured RHEL 8 system.'\n desc 'check', 'Verify the audit service is configured to produce audit records.\n\nCheck that the audit service is installed with the following command:\n\n$ sudo yum list installed audit\n\nIf the \"audit\" package is not installed, this is a finding.'\n desc 'fix', 'Configure the audit service to produce audit records containing the\ninformation needed to establish when (date and time) an event occurred.\n\n Install the audit service (if the audit service is not already installed)\nwith the following command:\n\n $ sudo yum install audit'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000254-GPOS-00095', 'SRG-OS-000255-GPOS-00096', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000358-GPOS-00145', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000475-GPOS-00220']\n tag gid: 'V-230411'\n tag rid: 'SV-258151r744000_rule'\n tag stig_id: 'RHEL-08-030180'\n tag fix_id: 'F-33055r646880_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe package('audit') do\n it { should be_installed }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258151.rb" + }, + "title": "The RHEL 8 audit package must be installed.", + "desc": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Associating event types with detected events in RHEL 8 audit logs provides\na means of investigating an attack, recognizing resource utilization or\ncapacity thresholds, or identifying an improperly configured RHEL 8 system.", + "descriptions": { + "default": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Associating event types with detected events in RHEL 8 audit logs provides\na means of investigating an attack, recognizing resource utilization or\ncapacity thresholds, or identifying an improperly configured RHEL 8 system.", + "check": "Verify the audit service is configured to produce audit records.\n\nCheck that the audit service is installed with the following command:\n\n$ sudo yum list installed audit\n\nIf the \"audit\" package is not installed, this is a finding.", + "fix": "Configure the audit service to produce audit records containing the\ninformation needed to establish when (date and time) an event occurred.\n\n Install the audit service (if the audit service is not already installed)\nwith the following command:\n\n $ sudo yum install audit" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000038-GPOS-00016", + "SRG-OS-000039-GPOS-00017", + "SRG-OS-000040-GPOS-00018", + "SRG-OS-000041-GPOS-00019", + "SRG-OS-000042-GPOS-00021", + "SRG-OS-000051-GPOS-00024", + "SRG-OS-000054-GPOS-00025", + "SRG-OS-000122-GPOS-00063", + "SRG-OS-000254-GPOS-00095", + "SRG-OS-000255-GPOS-00096", + "SRG-OS-000337-GPOS-00129", + "SRG-OS-000348-GPOS-00136", + "SRG-OS-000349-GPOS-00137", + "SRG-OS-000350-GPOS-00138", + "SRG-OS-000351-GPOS-00139", + "SRG-OS-000352-GPOS-00140", + "SRG-OS-000353-GPOS-00141", + "SRG-OS-000354-GPOS-00142", + "SRG-OS-000358-GPOS-00145", + "SRG-OS-000365-GPOS-00152", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000475-GPOS-00220" + ], + "gid": "V-230411", + "rid": "SV-258151r744000_rule", + "stig_id": "RHEL-08-030180", + "fix_id": "F-33055r646880_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258152", + "code": "control 'SV-258152' do\n title 'RHEL 8 audit records must contain information to establish what type\nof events occurred, the source of events, where events occurred, and the\noutcome of events.'\n desc 'Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Associating event types with detected events in RHEL 8 audit logs provides\na means of investigating an attack, recognizing resource utilization or\ncapacity thresholds, or identifying an improperly configured RHEL 8 system.'\n desc 'check', 'Verify the audit service is configured to produce audit records with the following command:\n\n$ sudo systemctl status auditd.service\n\nauditd.service - Security Auditing Service\nLoaded:loaded (/usr/lib/systemd/system/auditd.service; enabled; vendor preset: enabled)\nActive: active (running) since Tues 2020-12-11 12:56:56 EST; 4 weeks 0 days ago\n\nIf the audit service is not \"active\" and \"running\", this is a finding.'\n desc 'fix', 'Configure the audit service to produce audit records containing the\ninformation needed to establish when (date and time) an event occurred with the\nfollowing commands:\n\n $ sudo systemctl enable auditd.service\n\n $ sudo systemctl start auditd.service'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000254-GPOS-00095', 'SRG-OS-000255-GPOS-00096', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000358-GPOS-00145', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000475-GPOS-00220']\n tag gid: 'V-244542'\n tag rid: 'SV-258152r818838_rule'\n tag stig_id: 'RHEL-08-030181'\n tag fix_id: 'F-47774r743874_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe service('auditd') do\n it { should be_enabled }\n it { should be_running }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258152.rb" + }, + "title": "RHEL 8 audit records must contain information to establish what type\nof events occurred, the source of events, where events occurred, and the\noutcome of events.", + "desc": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Associating event types with detected events in RHEL 8 audit logs provides\na means of investigating an attack, recognizing resource utilization or\ncapacity thresholds, or identifying an improperly configured RHEL 8 system.", + "descriptions": { + "default": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Associating event types with detected events in RHEL 8 audit logs provides\na means of investigating an attack, recognizing resource utilization or\ncapacity thresholds, or identifying an improperly configured RHEL 8 system.", + "check": "Verify the audit service is configured to produce audit records with the following command:\n\n$ sudo systemctl status auditd.service\n\nauditd.service - Security Auditing Service\nLoaded:loaded (/usr/lib/systemd/system/auditd.service; enabled; vendor preset: enabled)\nActive: active (running) since Tues 2020-12-11 12:56:56 EST; 4 weeks 0 days ago\n\nIf the audit service is not \"active\" and \"running\", this is a finding.", + "fix": "Configure the audit service to produce audit records containing the\ninformation needed to establish when (date and time) an event occurred with the\nfollowing commands:\n\n $ sudo systemctl enable auditd.service\n\n $ sudo systemctl start auditd.service" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000038-GPOS-00016", + "SRG-OS-000039-GPOS-00017", + "SRG-OS-000040-GPOS-00018", + "SRG-OS-000041-GPOS-00019", + "SRG-OS-000042-GPOS-00021", + "SRG-OS-000051-GPOS-00024", + "SRG-OS-000054-GPOS-00025", + "SRG-OS-000122-GPOS-00063", + "SRG-OS-000254-GPOS-00095", + "SRG-OS-000255-GPOS-00096", + "SRG-OS-000337-GPOS-00129", + "SRG-OS-000348-GPOS-00136", + "SRG-OS-000349-GPOS-00137", + "SRG-OS-000350-GPOS-00138", + "SRG-OS-000351-GPOS-00139", + "SRG-OS-000352-GPOS-00140", + "SRG-OS-000353-GPOS-00141", + "SRG-OS-000354-GPOS-00142", + "SRG-OS-000358-GPOS-00145", + "SRG-OS-000365-GPOS-00152", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000475-GPOS-00220" + ], + "gid": "V-244542", + "rid": "SV-258152r818838_rule", + "stig_id": "RHEL-08-030181", + "fix_id": "F-47774r743874_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258153", + "code": "control 'SV-258153' do\n title 'The RHEL 8 System must take appropriate action when an audit\nprocessing failure occurs.'\n desc 'It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.'\n desc 'check', 'Verify RHEL 8 takes the appropriate action when an audit processing failure\noccurs.\n\n Check that RHEL 8 takes the appropriate action when an audit processing\nfailure occurs with the following command:\n\n $ sudo grep disk_error_action /etc/audit/auditd.conf\n\n disk_error_action = HALT\n\n If the value of the \"disk_error_action\" option is not \"SYSLOG\",\n\"SINGLE\", or \"HALT\", or the line is commented out, ask the system\nadministrator to indicate how the system takes appropriate action when an audit\nprocess failure occurs. If there is no evidence of appropriate action, this is\na finding.'\n desc 'fix', 'Configure RHEL 8 to shut down by default upon audit failure (unless\navailability is an overriding concern).\n\n Add or update the following line (depending on configuration\n\"disk_error_action\" can be set to \"SYSLOG\" or \"SINGLE\" depending on\nconfiguration) in \"/etc/audit/auditd.conf\" file:\n\n disk_error_action = HALT\n\n If availability has been determined to be more important, and this decision\nis documented with the ISSO, configure the operating system to notify system\nadministration staff and ISSO staff in the event of an audit processing failure\nby setting the \"disk_error_action\" to \"SYSLOG\".'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000047-GPOS-00023'\n tag gid: 'V-230390'\n tag rid: 'SV-258153r627750_rule'\n tag stig_id: 'RHEL-08-030040'\n tag fix_id: 'F-33034r567917_fix'\n tag cci: ['CCI-000140']\n tag nist: ['AU-5 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n disk_error_action = input('disk_error_action').map(&:upcase)\n\n describe auditd_conf do\n its('disk_error_action.upcase') { should be_in disk_error_action }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258153.rb" + }, + "title": "The RHEL 8 System must take appropriate action when an audit\nprocessing failure occurs.", + "desc": "It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.", + "descriptions": { + "default": "It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.", + "check": "Verify RHEL 8 takes the appropriate action when an audit processing failure\noccurs.\n\n Check that RHEL 8 takes the appropriate action when an audit processing\nfailure occurs with the following command:\n\n $ sudo grep disk_error_action /etc/audit/auditd.conf\n\n disk_error_action = HALT\n\n If the value of the \"disk_error_action\" option is not \"SYSLOG\",\n\"SINGLE\", or \"HALT\", or the line is commented out, ask the system\nadministrator to indicate how the system takes appropriate action when an audit\nprocess failure occurs. If there is no evidence of appropriate action, this is\na finding.", + "fix": "Configure RHEL 8 to shut down by default upon audit failure (unless\navailability is an overriding concern).\n\n Add or update the following line (depending on configuration\n\"disk_error_action\" can be set to \"SYSLOG\" or \"SINGLE\" depending on\nconfiguration) in \"/etc/audit/auditd.conf\" file:\n\n disk_error_action = HALT\n\n If availability has been determined to be more important, and this decision\nis documented with the ISSO, configure the operating system to notify system\nadministration staff and ISSO staff in the event of an audit processing failure\nby setting the \"disk_error_action\" to \"SYSLOG\"." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000047-GPOS-00023", + "gid": "V-230390", + "rid": "SV-258153r627750_rule", + "stig_id": "RHEL-08-030040", + "fix_id": "F-33034r567917_fix", + "cci": [ + "CCI-000140" + ], + "nist": [ + "AU-5 b" + ], + "host": null + } + }, + { + "id": "SV-258154", + "code": "control 'SV-258154' do\n title 'The RHEL 8 audit system must take appropriate action when the audit\nstorage volume is full.'\n desc 'It is critical that when RHEL 8 is at risk of failing to process audit\nlogs as required, it takes action to mitigate the failure. Audit processing\nfailures include software/hardware errors; failures in the audit capturing\nmechanisms; and audit storage capacity being reached or exceeded. Responses to\naudit failure depend upon the nature of the failure mode.\n\n When availability is an overriding concern, other approved actions in\nresponse to an audit failure are as follows:\n\n 1) If the failure was caused by the lack of audit record storage capacity,\nRHEL 8 must continue generating audit records if possible (automatically\nrestarting the audit service if necessary) and overwriting the oldest audit\nrecords in a first-in-first-out manner.\n\n 2) If audit records are sent to a centralized collection server and\ncommunication with this server is lost or the server fails, RHEL 8 must queue\naudit records locally until communication is restored or until the audit\nrecords are retrieved manually. Upon restoration of the connection to the\ncentralized collection server, action should be taken to synchronize the local\naudit data with the collection server.'\n desc 'check', 'Verify RHEL 8 takes the appropriate action when the audit storage volume is\nfull.\n\n Check that RHEL 8 takes the appropriate action when the audit storage\nvolume is full with the following command:\n\n $ sudo grep disk_full_action /etc/audit/auditd.conf\n\n disk_full_action = HALT\n\n If the value of the \"disk_full_action\" option is not \"SYSLOG\",\n\"SINGLE\", or \"HALT\", or the line is commented out, ask the system\nadministrator to indicate how the system takes appropriate action when an audit\nstorage volume is full. If there is no evidence of appropriate action, this is\na finding.'\n desc 'fix', 'Configure RHEL 8 to shut down by default upon audit failure (unless\navailability is an overriding concern).\n\n Add or update the following line (depending on configuration\n\"disk_full_action\" can be set to \"SYSLOG\" or \"SINGLE\" depending on\nconfiguration) in \"/etc/audit/auditd.conf\" file:\n\n disk_full_action = HALT\n\n If availability has been determined to be more important, and this decision\nis documented with the ISSO, configure the operating system to notify system\nadministration staff and ISSO staff in the event of an audit processing failure\nby setting the \"disk_full_action\" to \"SYSLOG\".'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000047-GPOS-00023'\n tag gid: 'V-230392'\n tag rid: 'SV-258154r627750_rule'\n tag stig_id: 'RHEL-08-030060'\n tag fix_id: 'F-33036r567923_fix'\n tag cci: ['CCI-000140']\n tag nist: ['AU-5 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n disk_full_action = input('disk_full_action').map(&:upcase)\n\n describe auditd_conf do\n its('disk_full_action.upcase') { should be_in disk_full_action }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258154.rb" + }, + "title": "The RHEL 8 audit system must take appropriate action when the audit\nstorage volume is full.", + "desc": "It is critical that when RHEL 8 is at risk of failing to process audit\nlogs as required, it takes action to mitigate the failure. Audit processing\nfailures include software/hardware errors; failures in the audit capturing\nmechanisms; and audit storage capacity being reached or exceeded. Responses to\naudit failure depend upon the nature of the failure mode.\n\n When availability is an overriding concern, other approved actions in\nresponse to an audit failure are as follows:\n\n 1) If the failure was caused by the lack of audit record storage capacity,\nRHEL 8 must continue generating audit records if possible (automatically\nrestarting the audit service if necessary) and overwriting the oldest audit\nrecords in a first-in-first-out manner.\n\n 2) If audit records are sent to a centralized collection server and\ncommunication with this server is lost or the server fails, RHEL 8 must queue\naudit records locally until communication is restored or until the audit\nrecords are retrieved manually. Upon restoration of the connection to the\ncentralized collection server, action should be taken to synchronize the local\naudit data with the collection server.", + "descriptions": { + "default": "It is critical that when RHEL 8 is at risk of failing to process audit\nlogs as required, it takes action to mitigate the failure. Audit processing\nfailures include software/hardware errors; failures in the audit capturing\nmechanisms; and audit storage capacity being reached or exceeded. Responses to\naudit failure depend upon the nature of the failure mode.\n\n When availability is an overriding concern, other approved actions in\nresponse to an audit failure are as follows:\n\n 1) If the failure was caused by the lack of audit record storage capacity,\nRHEL 8 must continue generating audit records if possible (automatically\nrestarting the audit service if necessary) and overwriting the oldest audit\nrecords in a first-in-first-out manner.\n\n 2) If audit records are sent to a centralized collection server and\ncommunication with this server is lost or the server fails, RHEL 8 must queue\naudit records locally until communication is restored or until the audit\nrecords are retrieved manually. Upon restoration of the connection to the\ncentralized collection server, action should be taken to synchronize the local\naudit data with the collection server.", + "check": "Verify RHEL 8 takes the appropriate action when the audit storage volume is\nfull.\n\n Check that RHEL 8 takes the appropriate action when the audit storage\nvolume is full with the following command:\n\n $ sudo grep disk_full_action /etc/audit/auditd.conf\n\n disk_full_action = HALT\n\n If the value of the \"disk_full_action\" option is not \"SYSLOG\",\n\"SINGLE\", or \"HALT\", or the line is commented out, ask the system\nadministrator to indicate how the system takes appropriate action when an audit\nstorage volume is full. If there is no evidence of appropriate action, this is\na finding.", + "fix": "Configure RHEL 8 to shut down by default upon audit failure (unless\navailability is an overriding concern).\n\n Add or update the following line (depending on configuration\n\"disk_full_action\" can be set to \"SYSLOG\" or \"SINGLE\" depending on\nconfiguration) in \"/etc/audit/auditd.conf\" file:\n\n disk_full_action = HALT\n\n If availability has been determined to be more important, and this decision\nis documented with the ISSO, configure the operating system to notify system\nadministration staff and ISSO staff in the event of an audit processing failure\nby setting the \"disk_full_action\" to \"SYSLOG\"." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000047-GPOS-00023", + "gid": "V-230392", + "rid": "SV-258154r627750_rule", + "stig_id": "RHEL-08-030060", + "fix_id": "F-33036r567923_fix", + "cci": [ + "CCI-000140" + ], + "nist": [ + "AU-5 b" + ], + "host": null + } + }, + { + "id": "SV-258155", + "code": "control 'SV-258155' do\n title 'RHEL 8 must allocate audit record storage capacity to store at least\none week of audit records, when audit records are not immediately sent to a\ncentral audit record storage facility.'\n desc 'To ensure RHEL 8 systems have a sufficient storage capacity in which\nto write the audit logs, RHEL 8 needs to be able to allocate audit record\nstorage capacity.\n\n The task of allocating audit record storage capacity is usually performed\nduring initial installation of RHEL 8.'\n desc 'check', 'Verify RHEL 8 allocates audit record storage capacity to store at least one week of audit records when audit records are not immediately sent to a central audit record storage facility.\n\nDetermine to which partition the audit records are being written with the following command:\n\n$ sudo grep -iw log_file /etc/audit/auditd.conf\nlog_file = /var/log/audit/audit.log\n\nCheck the size of the partition to which audit records are written (with the example being /var/log/audit/) with the following command:\n\n$ sudo df -h /var/log/audit/\n/dev/sda2 24G 10.4G 13.6G 43% /var/log/audit\n\nIf the audit records are not written to a partition made specifically for audit records (/var/log/audit is a separate partition), determine the amount of space being used by other files in the partition with the following command:\n\n$ sudo du -sh [audit_partition]\n1.8G /var/log/audit\n\nIf the audit record partition is not allocated for sufficient storage capacity, this is a finding.\n\nNote: The partition size needed to capture a week of audit records is based on the activity level of the system and the total storage capacity available. Typically 10.0 GB of storage space for audit records should be sufficient.'\n desc 'fix', 'Allocate enough storage capacity for at least one week of audit records\nwhen audit records are not immediately sent to a central audit record storage\nfacility.\n\n If audit records are stored on a partition made specifically for audit\nrecords, resize the partition with sufficient space to contain one week of\naudit records.\n\n If audit records are not stored on a partition made specifically for audit\nrecords, a new partition with sufficient space will need be to be created.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000341-GPOS-00132'\n tag gid: 'V-230476'\n tag rid: 'SV-258155r877391_rule'\n tag stig_id: 'RHEL-08-030660'\n tag fix_id: 'F-33120r568175_fix'\n tag cci: ['CCI-001849']\n tag nist: ['AU-4']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_log_dir = command(\"dirname #{auditd_conf.log_file}\").stdout.strip\n\n describe file(audit_log_dir) do\n it { should exist }\n it { should be_directory }\n end\n\n # Fetch partition sizes in 1K blocks for consistency\n partition_info = command(\"df -B 1K #{audit_log_dir}\").stdout.split(\"\\n\")\n partition_sz_arr = partition_info.last.gsub(/\\s+/m, ' ').strip.split(' ')\n\n # Get unused space percentage\n percentage_space_unused = (100 - partition_sz_arr[4].to_i)\n\n describe \"auditd_conf's space_left threshold\" do\n it 'should be under the amount of space currently available (in 1K blocks) for the audit log directory' do\n expect(auditd_conf.space_left.to_i).to be <= percentage_space_unused\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258155.rb" + }, + "title": "RHEL 8 must allocate audit record storage capacity to store at least\none week of audit records, when audit records are not immediately sent to a\ncentral audit record storage facility.", + "desc": "To ensure RHEL 8 systems have a sufficient storage capacity in which\nto write the audit logs, RHEL 8 needs to be able to allocate audit record\nstorage capacity.\n\n The task of allocating audit record storage capacity is usually performed\nduring initial installation of RHEL 8.", + "descriptions": { + "default": "To ensure RHEL 8 systems have a sufficient storage capacity in which\nto write the audit logs, RHEL 8 needs to be able to allocate audit record\nstorage capacity.\n\n The task of allocating audit record storage capacity is usually performed\nduring initial installation of RHEL 8.", + "check": "Verify RHEL 8 allocates audit record storage capacity to store at least one week of audit records when audit records are not immediately sent to a central audit record storage facility.\n\nDetermine to which partition the audit records are being written with the following command:\n\n$ sudo grep -iw log_file /etc/audit/auditd.conf\nlog_file = /var/log/audit/audit.log\n\nCheck the size of the partition to which audit records are written (with the example being /var/log/audit/) with the following command:\n\n$ sudo df -h /var/log/audit/\n/dev/sda2 24G 10.4G 13.6G 43% /var/log/audit\n\nIf the audit records are not written to a partition made specifically for audit records (/var/log/audit is a separate partition), determine the amount of space being used by other files in the partition with the following command:\n\n$ sudo du -sh [audit_partition]\n1.8G /var/log/audit\n\nIf the audit record partition is not allocated for sufficient storage capacity, this is a finding.\n\nNote: The partition size needed to capture a week of audit records is based on the activity level of the system and the total storage capacity available. Typically 10.0 GB of storage space for audit records should be sufficient.", + "fix": "Allocate enough storage capacity for at least one week of audit records\nwhen audit records are not immediately sent to a central audit record storage\nfacility.\n\n If audit records are stored on a partition made specifically for audit\nrecords, resize the partition with sufficient space to contain one week of\naudit records.\n\n If audit records are not stored on a partition made specifically for audit\nrecords, a new partition with sufficient space will need be to be created." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000341-GPOS-00132", + "gid": "V-230476", + "rid": "SV-258155r877391_rule", + "stig_id": "RHEL-08-030660", + "fix_id": "F-33120r568175_fix", + "cci": [ + "CCI-001849" + ], + "nist": [ + "AU-4" + ], + "host": null + } + }, + { + "id": "SV-258156", + "code": "control 'SV-258156' do\n title 'RHEL 8 must take action when allocated audit record storage volume\n reaches 75 percent of the repository maximum audit record storage capacity.'\n desc 'If security personnel are not notified immediately when storage volume\n reaches 75 percent utilization, they are unable to plan for audit record\n storage capacity expansion.'\n desc 'check', 'Verify RHEL 8 takes action when allocated audit record storage\n volume reaches 75 percent of the repository maximum audit record storage\n capacity with the following commands:\n\n $ sudo grep -w space_left /etc/audit/auditd.conf\n\n space_left = 25%\n\n If the value of the \"space_left\" keyword is not set to \"25%\" or if the\n line is commented out, ask the System Administrator to indicate how the system\n is providing real-time alerts to the SA and ISSO.\n\n If there is no evidence that real-time alerts are configured on the system,\n this is a finding.'\n desc 'fix', 'Configure the operating system to initiate an action to notify the\n SA and ISSO (at a minimum) when allocated audit record storage volume reaches\n 75 percent of the repository maximum audit record storage capacity by\n adding/modifying the following line in the /etc/audit/auditd.conf file.\n\n space_left = 25%\n\n Note: Option names and values in the auditd.conf file are case insensitive.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000343-GPOS-00134'\n tag gid: 'V-230483'\n tag rid: 'SV-258156r877389_rule'\n tag stig_id: 'RHEL-08-030730'\n tag fix_id: 'F-33127r744013_fix'\n tag cci: ['CCI-001855']\n tag nist: ['AU-5 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe auditd_conf do\n its('space_left.to_i') { should cmp >= input('audit_storage_threshold') }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258156.rb" + }, + "title": "RHEL 8 must take action when allocated audit record storage volume\n reaches 75 percent of the repository maximum audit record storage capacity.", + "desc": "If security personnel are not notified immediately when storage volume\n reaches 75 percent utilization, they are unable to plan for audit record\n storage capacity expansion.", + "descriptions": { + "default": "If security personnel are not notified immediately when storage volume\n reaches 75 percent utilization, they are unable to plan for audit record\n storage capacity expansion.", + "check": "Verify RHEL 8 takes action when allocated audit record storage\n volume reaches 75 percent of the repository maximum audit record storage\n capacity with the following commands:\n\n $ sudo grep -w space_left /etc/audit/auditd.conf\n\n space_left = 25%\n\n If the value of the \"space_left\" keyword is not set to \"25%\" or if the\n line is commented out, ask the System Administrator to indicate how the system\n is providing real-time alerts to the SA and ISSO.\n\n If there is no evidence that real-time alerts are configured on the system,\n this is a finding.", + "fix": "Configure the operating system to initiate an action to notify the\n SA and ISSO (at a minimum) when allocated audit record storage volume reaches\n 75 percent of the repository maximum audit record storage capacity by\n adding/modifying the following line in the /etc/audit/auditd.conf file.\n\n space_left = 25%\n\n Note: Option names and values in the auditd.conf file are case insensitive." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000343-GPOS-00134", + "gid": "V-230483", + "rid": "SV-258156r877389_rule", + "stig_id": "RHEL-08-030730", + "fix_id": "F-33127r744013_fix", + "cci": [ + "CCI-001855" + ], + "nist": [ + "AU-5 (1)" + ], + "host": null + } + }, + { + "id": "SV-258157", + "code": "control 'SV-258157' do\n title 'RHEL 8 must notify the System Administrator (SA) and Information\nSystem Security Officer (ISSO) (at a minimum) when allocated audit record\nstorage volume 75 percent utilization.'\n desc 'If security personnel are not notified immediately when storage volume\nreaches 75 percent utilization, they are unable to plan for audit record\nstorage capacity expansion.'\n desc 'check', 'Verify RHEL 8 notifies the SA and ISSO (at a minimum) when allocated audit\nrecord storage volume reaches 75 percent of the repository maximum audit record\nstorage capacity with the following command:\n\n $ sudo grep -w space_left_action /etc/audit/auditd.conf\n\n space_left_action = email\n\n If the value of the \"space_left_action\" is not set to \"email\", or if\nthe line is commented out, ask the System Administrator to indicate how the\nsystem is providing real-time alerts to the SA and ISSO.\n\n If there is no evidence that real-time alerts are configured on the system,\nthis is a finding.'\n desc 'fix', 'Configure the operating system to initiate an action to notify the SA and\nISSO (at a minimum) when allocated audit record storage volume reaches 75\npercent of the repository maximum audit record storage capacity by\nadding/modifying the following line in the /etc/audit/auditd.conf file.\n\n space_left_action = email\n\n Note: Option names and values in the auditd.conf file are case insensitive.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000343-GPOS-00134'\n tag gid: 'V-244543'\n tag rid: 'SV-258157r877389_rule'\n tag stig_id: 'RHEL-08-030731'\n tag fix_id: 'F-47775r743877_fix'\n tag cci: ['CCI-001855']\n tag nist: ['AU-5 (1)']\n tag 'host'\n\n alert_method = input('alert_method')\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe auditd_conf do\n its('space_left_action.downcase') { should cmp alert_method }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258157.rb" + }, + "title": "RHEL 8 must notify the System Administrator (SA) and Information\nSystem Security Officer (ISSO) (at a minimum) when allocated audit record\nstorage volume 75 percent utilization.", + "desc": "If security personnel are not notified immediately when storage volume\nreaches 75 percent utilization, they are unable to plan for audit record\nstorage capacity expansion.", + "descriptions": { + "default": "If security personnel are not notified immediately when storage volume\nreaches 75 percent utilization, they are unable to plan for audit record\nstorage capacity expansion.", + "check": "Verify RHEL 8 notifies the SA and ISSO (at a minimum) when allocated audit\nrecord storage volume reaches 75 percent of the repository maximum audit record\nstorage capacity with the following command:\n\n $ sudo grep -w space_left_action /etc/audit/auditd.conf\n\n space_left_action = email\n\n If the value of the \"space_left_action\" is not set to \"email\", or if\nthe line is commented out, ask the System Administrator to indicate how the\nsystem is providing real-time alerts to the SA and ISSO.\n\n If there is no evidence that real-time alerts are configured on the system,\nthis is a finding.", + "fix": "Configure the operating system to initiate an action to notify the SA and\nISSO (at a minimum) when allocated audit record storage volume reaches 75\npercent of the repository maximum audit record storage capacity by\nadding/modifying the following line in the /etc/audit/auditd.conf file.\n\n space_left_action = email\n\n Note: Option names and values in the auditd.conf file are case insensitive." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000343-GPOS-00134", + "gid": "V-244543", + "rid": "SV-258157r877389_rule", + "stig_id": "RHEL-08-030731", + "fix_id": "F-47775r743877_fix", + "cci": [ + "CCI-001855" + ], + "nist": [ + "AU-5 (1)" + ], + "host": null + } + }, + { + "id": "SV-258158", + "code": "control 'SV-258158' do\n title 'RHEL 9 must take action when allocated audit record storage volume reaches 95 percent of the audit record storage capacity.'\n desc 'If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.'\n desc 'check', 'Verify RHEL 9 takes action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity with the following command:\n\n$ sudo grep -w admin_space_left /etc/audit/auditd.conf\n\nadmin_space_left = 5%\n\nIf the value of the \"admin_space_left\" keyword is not set to 5 percent of the storage volume allocated to audit logs, or if the line is commented out, ask the system administrator (SA) to indicate how the system is taking action if the allocated storage is about to reach capacity. If the \"space_left\" value is not configured to the correct value, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to initiate an action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity by adding/modifying the following line in the /etc/audit/auditd.conf file.\n\nadmin_space_left = 5%'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61899r926459_chk'\n tag severity: 'medium'\n tag gid: 'V-258158'\n tag rid: 'SV-258158r926461_rule'\n tag stig_id: 'RHEL-09-653045'\n tag gtitle: 'SRG-OS-000343-GPOS-00134'\n tag fix_id: 'F-61823r926460_fix'\n tag 'documentable'\n tag cci: ['CCI-001855']\n tag nist: ['AU-5 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258158.rb" + }, + "title": "RHEL 9 must take action when allocated audit record storage volume reaches 95 percent of the audit record storage capacity.", + "desc": "If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.", + "descriptions": { + "default": "If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.", + "check": "Verify RHEL 9 takes action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity with the following command:\n\n$ sudo grep -w admin_space_left /etc/audit/auditd.conf\n\nadmin_space_left = 5%\n\nIf the value of the \"admin_space_left\" keyword is not set to 5 percent of the storage volume allocated to audit logs, or if the line is commented out, ask the system administrator (SA) to indicate how the system is taking action if the allocated storage is about to reach capacity. If the \"space_left\" value is not configured to the correct value, this is a finding.", + "fix": "Configure RHEL 9 to initiate an action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity by adding/modifying the following line in the /etc/audit/auditd.conf file.\n\nadmin_space_left = 5%" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61899r926459_chk", + "severity": "medium", + "gid": "V-258158", + "rid": "SV-258158r926461_rule", + "stig_id": "RHEL-09-653045", + "gtitle": "SRG-OS-000343-GPOS-00134", + "fix_id": "F-61823r926460_fix", + "documentable": null, + "cci": [ + "CCI-001855" + ], + "nist": [ + "AU-5 (1)" + ] + } + }, + { + "id": "SV-258159", + "code": "control 'SV-258159' do\n title 'RHEL 9 must take action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity.'\n desc 'If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.'\n desc 'check', 'Verify that RHEL 9 is configured to take action in the event of allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity with the following command:\n\n$ sudo grep admin_space_left_action /etc/audit/auditd.conf\n\nadmin_space_left_action = single\n\nIf the value of the \"admin_space_left_action\" is not set to \"single\", or if the line is commented out, ask the system administrator (SA) to indicate how the system is providing real-time alerts to the SA and information system security officer (ISSO).\n\nIf there is no evidence that real-time alerts are configured on the system, this is a finding.'\n desc 'fix', 'Configure \"auditd\" service to take action in the event of allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity.\n\nEdit the following line in \"/etc/audit/auditd.conf\" to ensure that the system is forced into single user mode in the event the audit record storage volume is about to reach maximum capacity:\n\nadmin_space_left_action = single \n\nThe audit daemon must be restarted for changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61900r926462_chk'\n tag severity: 'medium'\n tag gid: 'V-258159'\n tag rid: 'SV-258159r926464_rule'\n tag stig_id: 'RHEL-09-653050'\n tag gtitle: 'SRG-OS-000343-GPOS-00134'\n tag fix_id: 'F-61824r926463_fix'\n tag 'documentable'\n tag cci: ['CCI-001855']\n tag nist: ['AU-5 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258159.rb" + }, + "title": "RHEL 9 must take action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity.", + "desc": "If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.", + "descriptions": { + "default": "If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.", + "check": "Verify that RHEL 9 is configured to take action in the event of allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity with the following command:\n\n$ sudo grep admin_space_left_action /etc/audit/auditd.conf\n\nadmin_space_left_action = single\n\nIf the value of the \"admin_space_left_action\" is not set to \"single\", or if the line is commented out, ask the system administrator (SA) to indicate how the system is providing real-time alerts to the SA and information system security officer (ISSO).\n\nIf there is no evidence that real-time alerts are configured on the system, this is a finding.", + "fix": "Configure \"auditd\" service to take action in the event of allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity.\n\nEdit the following line in \"/etc/audit/auditd.conf\" to ensure that the system is forced into single user mode in the event the audit record storage volume is about to reach maximum capacity:\n\nadmin_space_left_action = single \n\nThe audit daemon must be restarted for changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61900r926462_chk", + "severity": "medium", + "gid": "V-258159", + "rid": "SV-258159r926464_rule", + "stig_id": "RHEL-09-653050", + "gtitle": "SRG-OS-000343-GPOS-00134", + "fix_id": "F-61824r926463_fix", + "documentable": null, + "cci": [ + "CCI-001855" + ], + "nist": [ + "AU-5 (1)" + ] + } + }, + { + "id": "SV-258160", + "code": "control 'SV-258160' do\n title 'RHEL 9 audit system must take appropriate action when the audit files have reached maximum size.'\n desc 'It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode.'\n desc 'check', 'Verify that RHEL 9 takes the appropriate action when the audit files have reached maximum size with the following command:\n\n$ sudo grep max_log_file_action /etc/audit/auditd.conf\n\nmax_log_file_action = ROTATE\n\nIf the value of the \"max_log_file_action\" option is not \"ROTATE\", \"SINGLE\", or the line is commented out, ask the system administrator (SA)to indicate how the system takes appropriate action when an audit storage volume is full. If there is no evidence of appropriate action, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to rotate the audit log when it reaches maximum size.\n\nAdd or update the following line in \"/etc/audit/auditd.conf\" file:\n\nmax_log_file_action = ROTATE'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61901r926465_chk'\n tag severity: 'medium'\n tag gid: 'V-258160'\n tag rid: 'SV-258160r926467_rule'\n tag stig_id: 'RHEL-09-653055'\n tag gtitle: 'SRG-OS-000047-GPOS-00023'\n tag fix_id: 'F-61825r926466_fix'\n tag 'documentable'\n tag cci: ['CCI-000140']\n tag nist: ['AU-5 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258160.rb" + }, + "title": "RHEL 9 audit system must take appropriate action when the audit files have reached maximum size.", + "desc": "It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode.", + "descriptions": { + "default": "It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode.", + "check": "Verify that RHEL 9 takes the appropriate action when the audit files have reached maximum size with the following command:\n\n$ sudo grep max_log_file_action /etc/audit/auditd.conf\n\nmax_log_file_action = ROTATE\n\nIf the value of the \"max_log_file_action\" option is not \"ROTATE\", \"SINGLE\", or the line is commented out, ask the system administrator (SA)to indicate how the system takes appropriate action when an audit storage volume is full. If there is no evidence of appropriate action, this is a finding.", + "fix": "Configure RHEL 9 to rotate the audit log when it reaches maximum size.\n\nAdd or update the following line in \"/etc/audit/auditd.conf\" file:\n\nmax_log_file_action = ROTATE" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61901r926465_chk", + "severity": "medium", + "gid": "V-258160", + "rid": "SV-258160r926467_rule", + "stig_id": "RHEL-09-653055", + "gtitle": "SRG-OS-000047-GPOS-00023", + "fix_id": "F-61825r926466_fix", + "documentable": null, + "cci": [ + "CCI-000140" + ], + "nist": [ + "AU-5 b" + ] + } + }, + { + "id": "SV-258161", + "code": "control 'SV-258161' do\n title 'RHEL 8 must label all off-loaded audit logs before sending them to the\ncentral log server.'\n desc 'Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Enriched logging is needed to determine who, what, and when events occur on\na system. Without this, determining root cause of an event will be much more\ndifficult.\n\n When audit logs are not labeled before they are sent to a central log\nserver, the audit data will not be able to be analyzed and tied back to the\ncorrect system.'\n desc 'check', 'Verify the RHEL 8 Audit Daemon is configured to label all off-loaded audit\nlogs, with the following command:\n\n $ sudo grep \"name_format\" /etc/audit/auditd.conf\n\n name_format = hostname\n\n If the \"name_format\" option is not \"hostname\", \"fqd\", or \"numeric\",\nor the line is commented out, this is a finding.'\n desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the \"name_format\"\noption:\n\n name_format = hostname\n\n The audit daemon must be restarted for changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag gid: 'V-230394'\n tag rid: 'SV-258161r877390_rule'\n tag stig_id: 'RHEL-08-030062'\n tag fix_id: 'F-33038r567929_fix'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe parse_config_file('/etc/audit/auditd.conf') do\n its('name_format') { should match(/^hostname$|^fqd$|^numeric$/i) }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258161.rb" + }, + "title": "RHEL 8 must label all off-loaded audit logs before sending them to the\ncentral log server.", + "desc": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Enriched logging is needed to determine who, what, and when events occur on\na system. Without this, determining root cause of an event will be much more\ndifficult.\n\n When audit logs are not labeled before they are sent to a central log\nserver, the audit data will not be able to be analyzed and tied back to the\ncorrect system.", + "descriptions": { + "default": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Enriched logging is needed to determine who, what, and when events occur on\na system. Without this, determining root cause of an event will be much more\ndifficult.\n\n When audit logs are not labeled before they are sent to a central log\nserver, the audit data will not be able to be analyzed and tied back to the\ncorrect system.", + "check": "Verify the RHEL 8 Audit Daemon is configured to label all off-loaded audit\nlogs, with the following command:\n\n $ sudo grep \"name_format\" /etc/audit/auditd.conf\n\n name_format = hostname\n\n If the \"name_format\" option is not \"hostname\", \"fqd\", or \"numeric\",\nor the line is commented out, this is a finding.", + "fix": "Edit the /etc/audit/auditd.conf file and add or update the \"name_format\"\noption:\n\n name_format = hostname\n\n The audit daemon must be restarted for changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000342-GPOS-00133", + "gid": "V-230394", + "rid": "SV-258161r877390_rule", + "stig_id": "RHEL-08-030062", + "fix_id": "F-33038r567929_fix", + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ], + "host": null + } + }, + { + "id": "SV-258162", + "code": "control 'SV-258162' do\n title 'RHEL 8 must take appropriate action when the internal event queue is\nfull.'\n desc 'Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.'\n desc 'check', 'Verify the audit system is configured to take an appropriate action when\nthe internal event queue is full:\n\n $ sudo grep -i overflow_action /etc/audit/auditd.conf\n\n overflow_action = syslog\n\n If the value of the \"overflow_action\" option is not set to \"syslog\",\n\"single\", \"halt\", or the line is commented out, ask the System\nAdministrator to indicate how the audit logs are off-loaded to a different\nsystem or media.\n\n If there is no evidence that the transfer of the audit logs being\noff-loaded to another system or media takes appropriate action if the internal\nevent queue becomes full, this is a finding.'\n desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the\n\"overflow_action\" option:\n\n overflow_action = syslog\n\n The audit daemon must be restarted for changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag satisfies: ['SRG-OS-000342-GPOS-00133', 'SRG-OS-000479-GPOS-00224']\n tag gid: 'V-230480'\n tag rid: 'SV-258162r877390_rule'\n tag stig_id: 'RHEL-08-030700'\n tag fix_id: 'F-33124r568187_fix'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe parse_config_file('/etc/audit/auditd.conf') do\n its('overflow_action') { should match(/syslog$|single$|halt$/i) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258162.rb" + }, + "title": "RHEL 8 must take appropriate action when the internal event queue is\nfull.", + "desc": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.", + "descriptions": { + "default": "Information stored in one location is vulnerable to accidental or\nincidental deletion or alteration.\n\n Off-loading is a common process in information systems with limited audit\nstorage capacity.\n\n RHEL 8 installation media provides \"rsyslogd\". \"rsyslogd\" is a system\nutility providing support for message logging. Support for both internet and\nUNIX domain sockets enables this utility to support both local and remote\nlogging. Couple this utility with \"gnutls\" (which is a secure communications\nlibrary implementing the SSL, TLS and DTLS protocols), and you have a method to\nsecurely encrypt and off-load auditing.", + "check": "Verify the audit system is configured to take an appropriate action when\nthe internal event queue is full:\n\n $ sudo grep -i overflow_action /etc/audit/auditd.conf\n\n overflow_action = syslog\n\n If the value of the \"overflow_action\" option is not set to \"syslog\",\n\"single\", \"halt\", or the line is commented out, ask the System\nAdministrator to indicate how the audit logs are off-loaded to a different\nsystem or media.\n\n If there is no evidence that the transfer of the audit logs being\noff-loaded to another system or media takes appropriate action if the internal\nevent queue becomes full, this is a finding.", + "fix": "Edit the /etc/audit/auditd.conf file and add or update the\n\"overflow_action\" option:\n\n overflow_action = syslog\n\n The audit daemon must be restarted for changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000342-GPOS-00133", + "satisfies": [ + "SRG-OS-000342-GPOS-00133", + "SRG-OS-000479-GPOS-00224" + ], + "gid": "V-230480", + "rid": "SV-258162r877390_rule", + "stig_id": "RHEL-08-030700", + "fix_id": "F-33124r568187_fix", + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ], + "host": null + } + }, + { + "id": "SV-258163", + "code": "control 'SV-258163' do\n title 'The RHEL 8 System Administrator (SA) and Information System Security\nOfficer (ISSO) (at a minimum) must be alerted of an audit processing failure\nevent.'\n desc 'It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.'\n desc 'check', 'Verify that the SA and ISSO (at a minimum) are notified in the event of an\naudit processing failure.\n\n Check that RHEL 8 notifies the SA and ISSO (at a minimum) in the event of\nan audit processing failure with the following command:\n\n $ sudo grep action_mail_acct /etc/audit/auditd.conf\n\n action_mail_acct = root\n\n If the value of the \"action_mail_acct\" keyword is not set to \"root\"\nand/or other accounts for security personnel, the \"action_mail_acct\" keyword\nis missing, or the retuned line is commented out, ask the system administrator\nto indicate how they and the ISSO are notified of an audit process failure. If\nthere is no evidence of the proper personnel being notified of an audit\nprocessing failure, this is a finding.'\n desc 'fix', 'Configure \"auditd\" service to notify the SA and ISSO in the event of an\naudit processing failure.\n\n Edit the following line in \"/etc/audit/auditd.conf\" to ensure that\nadministrators are notified via email for those situations:\n\n action_mail_acct = root'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000046-GPOS-00022'\n tag gid: 'V-230388'\n tag rid: 'SV-258163r627750_rule'\n tag stig_id: 'RHEL-08-030020'\n tag fix_id: 'F-33032r567911_fix'\n tag cci: ['CCI-000139']\n tag nist: ['AU-5 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe auditd_conf do\n its('action_mail_acct') { should cmp 'root' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258163.rb" + }, + "title": "The RHEL 8 System Administrator (SA) and Information System Security\nOfficer (ISSO) (at a minimum) must be alerted of an audit processing failure\nevent.", + "desc": "It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.", + "descriptions": { + "default": "It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.", + "check": "Verify that the SA and ISSO (at a minimum) are notified in the event of an\naudit processing failure.\n\n Check that RHEL 8 notifies the SA and ISSO (at a minimum) in the event of\nan audit processing failure with the following command:\n\n $ sudo grep action_mail_acct /etc/audit/auditd.conf\n\n action_mail_acct = root\n\n If the value of the \"action_mail_acct\" keyword is not set to \"root\"\nand/or other accounts for security personnel, the \"action_mail_acct\" keyword\nis missing, or the retuned line is commented out, ask the system administrator\nto indicate how they and the ISSO are notified of an audit process failure. If\nthere is no evidence of the proper personnel being notified of an audit\nprocessing failure, this is a finding.", + "fix": "Configure \"auditd\" service to notify the SA and ISSO in the event of an\naudit processing failure.\n\n Edit the following line in \"/etc/audit/auditd.conf\" to ensure that\nadministrators are notified via email for those situations:\n\n action_mail_acct = root" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000046-GPOS-00022", + "gid": "V-230388", + "rid": "SV-258163r627750_rule", + "stig_id": "RHEL-08-030020", + "fix_id": "F-33032r567911_fix", + "cci": [ + "CCI-000139" + ], + "nist": [ + "AU-5 a" + ], + "host": null + } + }, + { + "id": "SV-258164", + "code": "control 'SV-258164' do\n title 'The RHEL 8 audit system must audit local events.'\n desc 'Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.'\n desc 'check', 'Verify the RHEL 8 Audit Daemon is configured to include local events, with\nthe following command:\n\n $ sudo grep local_events /etc/audit/auditd.conf\n\n local_events = yes\n\n If the value of the \"local_events\" option is not set to \"yes\", or the\nline is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to audit local events on the system.\n\nAdd or update the following line in \"/etc/audit/auditd.conf\" file:\n\nlocal_events = yes'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230393'\n tag rid: 'SV-258164r627750_rule'\n tag stig_id: 'RHEL-08-030061'\n tag fix_id: 'F-33037r567926_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe parse_config_file('/etc/audit/auditd.conf') do\n its('local_events') { should eq 'yes' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258164.rb" + }, + "title": "The RHEL 8 audit system must audit local events.", + "desc": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.", + "descriptions": { + "default": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.", + "check": "Verify the RHEL 8 Audit Daemon is configured to include local events, with\nthe following command:\n\n $ sudo grep local_events /etc/audit/auditd.conf\n\n local_events = yes\n\n If the value of the \"local_events\" option is not set to \"yes\", or the\nline is commented out, this is a finding.", + "fix": "Configure RHEL 8 to audit local events on the system.\n\nAdd or update the following line in \"/etc/audit/auditd.conf\" file:\n\nlocal_events = yes" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230393", + "rid": "SV-258164r627750_rule", + "stig_id": "RHEL-08-030061", + "fix_id": "F-33037r567926_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258165", + "code": "control 'SV-258165' do\n title 'RHEL 8 audit logs must be group-owned by root to prevent unauthorized\nread access.'\n desc 'Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 activity.'\n desc 'check', 'Verify the audit logs are group-owned by \"root\". First determine where\nthe audit logs are stored with the following command:\n\n $ sudo grep -iw log_file /etc/audit/auditd.conf\n\n log_file = /var/log/audit/audit.log\n\n Using the location of the audit log file, determine if the audit log is\ngroup-owned by \"root\" using the following command:\n\n $ sudo ls -al /var/log/audit/audit.log\n\n rw------- 2 root root 23 Jun 11 11:56 /var/log/audit/audit.log\n\n If the audit log is not group-owned by \"root\", this is a finding.'\n desc 'fix', 'Configure the audit log to be owned by root by configuring the log group in\nthe /etc/audit/auditd.conf file:\n\n log_group = root'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029']\n tag gid: 'V-230398'\n tag rid: 'SV-258165r627750_rule'\n tag stig_id: 'RHEL-08-030090'\n tag fix_id: 'F-33042r567941_fix'\n tag cci: ['CCI-000162']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe file(auditd_conf('/etc/audit/auditd.conf').log_file) do\n its('group') { should be_in input('var_log_audit_group') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258165.rb" + }, + "title": "RHEL 8 audit logs must be group-owned by root to prevent unauthorized\nread access.", + "desc": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 activity.", + "descriptions": { + "default": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 activity.", + "check": "Verify the audit logs are group-owned by \"root\". First determine where\nthe audit logs are stored with the following command:\n\n $ sudo grep -iw log_file /etc/audit/auditd.conf\n\n log_file = /var/log/audit/audit.log\n\n Using the location of the audit log file, determine if the audit log is\ngroup-owned by \"root\" using the following command:\n\n $ sudo ls -al /var/log/audit/audit.log\n\n rw------- 2 root root 23 Jun 11 11:56 /var/log/audit/audit.log\n\n If the audit log is not group-owned by \"root\", this is a finding.", + "fix": "Configure the audit log to be owned by root by configuring the log group in\nthe /etc/audit/auditd.conf file:\n\n log_group = root" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000057-GPOS-00027", + "satisfies": [ + "SRG-OS-000057-GPOS-00027", + "SRG-OS-000058-GPOS-00028", + "SRG-OS-000059-GPOS-00029" + ], + "gid": "V-230398", + "rid": "SV-258165r627750_rule", + "stig_id": "RHEL-08-030090", + "fix_id": "F-33042r567941_fix", + "cci": [ + "CCI-000162" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-258166", + "code": "control 'SV-258166' do\n title 'RHEL 8 audit log directory must be owned by root to prevent\nunauthorized read access.'\n desc 'Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 activity.'\n desc 'check', 'Verify the audit log directory is owned by \"root\" to prevent unauthorized\nread access.\n\n Determine where the audit logs are stored with the following command:\n\n $ sudo grep -iw log_file /etc/audit/auditd.conf\n\n log_file = /var/log/audit/audit.log\n\n Determine the owner of the audit log directory by using the output of the\nabove command (ex: \"/var/log/audit/\"). Run the following command with the\ncorrect audit log directory path:\n\n $ sudo ls -ld /var/log/audit\n\n drw------- 2 root root 23 Jun 11 11:56 /var/log/audit\n\n If the audit log directory is not owned by \"root\", this is a finding.'\n desc 'fix', 'Configure the audit log to be protected from unauthorized read access, by\nsetting the correct owner as \"root\" with the following command:\n\n $ sudo chown root [audit_log_directory]\n\n Replace \"[audit_log_directory]\" with the correct audit log directory\npath, by default this location is usually \"/var/log/audit\".'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029']\n tag gid: 'V-230399'\n tag rid: 'SV-258166r627750_rule'\n tag stig_id: 'RHEL-08-030100'\n tag fix_id: 'F-33043r567944_fix'\n tag cci: ['CCI-000162']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n log_dir = auditd_conf('/etc/audit/auditd.conf').log_file.split('/')[0..-2].join('/')\n describe directory(log_dir) do\n its('owner') { should eq 'root' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258166.rb" + }, + "title": "RHEL 8 audit log directory must be owned by root to prevent\nunauthorized read access.", + "desc": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 activity.", + "descriptions": { + "default": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 activity.", + "check": "Verify the audit log directory is owned by \"root\" to prevent unauthorized\nread access.\n\n Determine where the audit logs are stored with the following command:\n\n $ sudo grep -iw log_file /etc/audit/auditd.conf\n\n log_file = /var/log/audit/audit.log\n\n Determine the owner of the audit log directory by using the output of the\nabove command (ex: \"/var/log/audit/\"). Run the following command with the\ncorrect audit log directory path:\n\n $ sudo ls -ld /var/log/audit\n\n drw------- 2 root root 23 Jun 11 11:56 /var/log/audit\n\n If the audit log directory is not owned by \"root\", this is a finding.", + "fix": "Configure the audit log to be protected from unauthorized read access, by\nsetting the correct owner as \"root\" with the following command:\n\n $ sudo chown root [audit_log_directory]\n\n Replace \"[audit_log_directory]\" with the correct audit log directory\npath, by default this location is usually \"/var/log/audit\"." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000057-GPOS-00027", + "satisfies": [ + "SRG-OS-000057-GPOS-00027", + "SRG-OS-000058-GPOS-00028", + "SRG-OS-000059-GPOS-00029" + ], + "gid": "V-230399", + "rid": "SV-258166r627750_rule", + "stig_id": "RHEL-08-030100", + "fix_id": "F-33043r567944_fix", + "cci": [ + "CCI-000162" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-258167", + "code": "control 'SV-258167' do\n title 'RHEL 8 audit logs must have a mode of 0600 or less permissive to\nprevent unauthorized read access.'\n desc \"Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.\"\n desc 'check', 'Verify the audit logs have a mode of \"0600\" or less permissive.\n\n First, determine where the audit logs are stored with the following command:\n\n $ sudo grep -iw log_file /etc/audit/auditd.conf\n\n log_file = /var/log/audit/audit.log\n\n Using the location of the audit log file, check if the audit log has a mode\nof \"0600\" or less permissive with the following command:\n\n $ sudo stat -c \"%a %n\" /var/log/audit/audit.log\n\n 600 /var/log/audit/audit.log\n\n If the audit log has a mode more permissive than \"0600\", this is a\nfinding.'\n desc 'fix', 'Configure the audit log to be protected from unauthorized read access by setting the correct permissive mode with the following command:\n\n$ sudo chmod 0600 /var/log/audit/audit.log'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084']\n tag gid: 'V-230396'\n tag rid: 'SV-258167r902733_rule'\n tag stig_id: 'RHEL-08-030070'\n tag fix_id: 'F-33040r902732_fix'\n tag cci: ['CCI-000162']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n log_file = auditd_conf('/etc/audit/auditd.conf').log_file\n\n describe file(log_file) do\n it { should_not be_more_permissive_than('0600') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258167.rb" + }, + "title": "RHEL 8 audit logs must have a mode of 0600 or less permissive to\nprevent unauthorized read access.", + "desc": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "descriptions": { + "default": "Only authorized personnel should be aware of errors and the details of\nthe errors. Error messages are an indicator of an organization's operational\nstate or can identify the RHEL 8 system or platform. Additionally, Personally\nIdentifiable Information (PII) and operational information must not be revealed\nthrough error messages to unauthorized personnel or their designated\nrepresentatives.\n\n The structure and content of error messages must be carefully considered by\nthe organization and development team. The extent to which the information\nsystem is able to identify and handle error conditions is guided by\norganizational policy and operational requirements.", + "check": "Verify the audit logs have a mode of \"0600\" or less permissive.\n\n First, determine where the audit logs are stored with the following command:\n\n $ sudo grep -iw log_file /etc/audit/auditd.conf\n\n log_file = /var/log/audit/audit.log\n\n Using the location of the audit log file, check if the audit log has a mode\nof \"0600\" or less permissive with the following command:\n\n $ sudo stat -c \"%a %n\" /var/log/audit/audit.log\n\n 600 /var/log/audit/audit.log\n\n If the audit log has a mode more permissive than \"0600\", this is a\nfinding.", + "fix": "Configure the audit log to be protected from unauthorized read access by setting the correct permissive mode with the following command:\n\n$ sudo chmod 0600 /var/log/audit/audit.log" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000057-GPOS-00027", + "satisfies": [ + "SRG-OS-000057-GPOS-00027", + "SRG-OS-000058-GPOS-00028", + "SRG-OS-000059-GPOS-00029", + "SRG-OS-000206-GPOS-00084" + ], + "gid": "V-230396", + "rid": "SV-258167r902733_rule", + "stig_id": "RHEL-08-030070", + "fix_id": "F-33040r902732_fix", + "cci": [ + "CCI-000162" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-258168", + "code": "control 'SV-258168' do\n title 'RHEL 9 must periodically flush audit records to disk to prevent the loss of audit records.'\n desc 'If option \"freq\" is not set to a value that requires audit records being written to disk after a threshold number is reached, then audit records may be lost.'\n desc 'check', %q(Verify that audit system is configured to flush to disk after every 100 records with the following command:\n\n$ sudo grep freq /etc/audit/auditd.conf \n\nfreq = 100 \n\nIf \"freq\" isn't set to a value of \"100\" or greater, the value is missing, or the line is commented out, this is a finding.)\n desc 'fix', 'Configure RHEL 9 to flush audit to disk by adding or updating the following rule in \"/etc/audit/rules.d/audit.rules\":\n\nfreq = 100\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61909r926489_chk'\n tag severity: 'medium'\n tag gid: 'V-258168'\n tag rid: 'SV-258168r926491_rule'\n tag stig_id: 'RHEL-09-653095'\n tag gtitle: 'SRG-OS-000051-GPOS-00024'\n tag fix_id: 'F-61833r926490_fix'\n tag 'documentable'\n tag cci: ['CCI-000154']\n tag nist: ['AU-6 (4)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258168.rb" + }, + "title": "RHEL 9 must periodically flush audit records to disk to prevent the loss of audit records.", + "desc": "If option \"freq\" is not set to a value that requires audit records being written to disk after a threshold number is reached, then audit records may be lost.", + "descriptions": { + "default": "If option \"freq\" is not set to a value that requires audit records being written to disk after a threshold number is reached, then audit records may be lost.", + "check": "Verify that audit system is configured to flush to disk after every 100 records with the following command:\n\n$ sudo grep freq /etc/audit/auditd.conf \n\nfreq = 100 \n\nIf \"freq\" isn't set to a value of \"100\" or greater, the value is missing, or the line is commented out, this is a finding.", + "fix": "Configure RHEL 9 to flush audit to disk by adding or updating the following rule in \"/etc/audit/rules.d/audit.rules\":\n\nfreq = 100\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61909r926489_chk", + "severity": "medium", + "gid": "V-258168", + "rid": "SV-258168r926491_rule", + "stig_id": "RHEL-09-653095", + "gtitle": "SRG-OS-000051-GPOS-00024", + "fix_id": "F-61833r926490_fix", + "documentable": null, + "cci": [ + "CCI-000154" + ], + "nist": [ + "AU-6 (4)" + ] + } + }, + { + "id": "SV-258169", + "code": "control 'SV-258169' do\n title 'RHEL 8 must resolve audit information before writing to disk.'\n desc 'Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Enriched logging aids in making sense of who, what, and when events occur\non a system. Without this, determining root cause of an event will be much\nmore difficult.'\n desc 'check', 'Verify the RHEL 8 Audit Daemon is configured to resolve audit information\nbefore writing to disk, with the following command:\n\n $ sudo grep \"log_format\" /etc/audit/auditd.conf\n\n log_format = ENRICHED\n\n If the \"log_format\" option is not \"ENRICHED\", or the line is commented\nout, this is a finding.'\n desc 'fix', 'Edit the /etc/audit/auditd.conf file and add or update the \"log_format\"\noption:\n\n log_format = ENRICHED\n\n The audit daemon must be restarted for changes to take effect.'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-230395'\n tag rid: 'SV-258169r627750_rule'\n tag stig_id: 'RHEL-08-030063'\n tag fix_id: 'F-33039r567932_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe parse_config_file('/etc/audit/auditd.conf') do\n its('log_format') { should eq 'ENRICHED' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258169.rb" + }, + "title": "RHEL 8 must resolve audit information before writing to disk.", + "desc": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Enriched logging aids in making sense of who, what, and when events occur\non a system. Without this, determining root cause of an event will be much\nmore difficult.", + "descriptions": { + "default": "Without establishing what type of events occurred, the source of\nevents, where events occurred, and the outcome of events, it would be difficult\nto establish, correlate, and investigate the events leading up to an outage or\nattack.\n\n Audit record content that may be necessary to satisfy this requirement\nincludes, for example, time stamps, source and destination addresses,\nuser/process identifiers, event descriptions, success/fail indications,\nfilenames involved, and access control or flow control rules invoked.\n\n Enriched logging aids in making sense of who, what, and when events occur\non a system. Without this, determining root cause of an event will be much\nmore difficult.", + "check": "Verify the RHEL 8 Audit Daemon is configured to resolve audit information\nbefore writing to disk, with the following command:\n\n $ sudo grep \"log_format\" /etc/audit/auditd.conf\n\n log_format = ENRICHED\n\n If the \"log_format\" option is not \"ENRICHED\", or the line is commented\nout, this is a finding.", + "fix": "Edit the /etc/audit/auditd.conf file and add or update the \"log_format\"\noption:\n\n log_format = ENRICHED\n\n The audit daemon must be restarted for changes to take effect." + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000480-GPOS-00227", + "gid": "V-230395", + "rid": "SV-258169r627750_rule", + "stig_id": "RHEL-08-030063", + "fix_id": "F-33039r567932_fix", + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ], + "host": null + } + }, + { + "id": "SV-258170", + "code": "control 'SV-258170' do\n title 'RHEL 9 must write audit records to disk.'\n desc 'Audit data should be synchronously written to disk to ensure log integrity. This setting assures that all audit event data is written disk.'\n desc 'check', 'Verify that the audit system is configured to write logs to the disk with the following command:\n\n$ sudo grep write_logs /etc/audit/auditd.conf \n\nwrite_logs = yes \n\nIf \"write_logs\" does not have a value of \"yes\", the line is commented out, or the line is missing, this is a finding.'\n desc 'fix', 'Configure the audit system to write log files to the disk.\n\nEdit the /etc/audit/auditd.conf file and add or update the \"write_logs\" option to \"yes\":\n\nwrite_logs = yes \n\nThe audit daemon must be restarted for changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61911r926495_chk'\n tag severity: 'medium'\n tag gid: 'V-258170'\n tag rid: 'SV-258170r926497_rule'\n tag stig_id: 'RHEL-09-653105'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-61835r926496_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258170.rb" + }, + "title": "RHEL 9 must write audit records to disk.", + "desc": "Audit data should be synchronously written to disk to ensure log integrity. This setting assures that all audit event data is written disk.", + "descriptions": { + "default": "Audit data should be synchronously written to disk to ensure log integrity. This setting assures that all audit event data is written disk.", + "check": "Verify that the audit system is configured to write logs to the disk with the following command:\n\n$ sudo grep write_logs /etc/audit/auditd.conf \n\nwrite_logs = yes \n\nIf \"write_logs\" does not have a value of \"yes\", the line is commented out, or the line is missing, this is a finding.", + "fix": "Configure the audit system to write log files to the disk.\n\nEdit the /etc/audit/auditd.conf file and add or update the \"write_logs\" option to \"yes\":\n\nwrite_logs = yes \n\nThe audit daemon must be restarted for changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61911r926495_chk", + "severity": "medium", + "gid": "V-258170", + "rid": "SV-258170r926497_rule", + "stig_id": "RHEL-09-653105", + "gtitle": "SRG-OS-000480-GPOS-00227", + "fix_id": "F-61835r926496_fix", + "documentable": null, + "cci": [ + "CCI-000366" + ], + "nist": [ + "CM-6 b" + ] + } + }, + { + "id": "SV-258171", + "code": "control 'SV-258171' do\n title 'RHEL 8 must allow only the Information System Security Manager (ISSM)\n(or individuals or roles appointed by the ISSM) to select which auditable\nevents are to be audited.'\n desc \"Without the capability to restrict the roles and individuals that can\nselect which events are audited, unauthorized personnel may be able to prevent\nthe auditing of critical events. Misconfigured audits may degrade the system's\nperformance by overwhelming the audit log. Misconfigured audits may also make\nit more difficult to establish, correlate, and investigate the events relating\nto an incident or identify those responsible for one.\"\n desc 'check', 'Verify that the files in directory \"/etc/audit/rules.d/\" and\n\"/etc/audit/auditd.conf\" file have a mode of \"0640\" or less permissive by\nusing the following commands:\n\n $ sudo ls -al /etc/audit/rules.d/*.rules\n\n -rw-r----- 1 root root 1280 Feb 16 17:09 audit.rules\n\n $ sudo ls -l /etc/audit/auditd.conf\n\n -rw-r----- 1 root root 621 Sep 22 17:19 auditd.conf\n\n If the files in the \"/etc/audit/rules.d/\" directory or the\n\"/etc/audit/auditd.conf\" file have a mode more permissive than \"0640\", this\nis a finding.'\n desc 'fix', 'Configure the files in directory \"/etc/audit/rules.d/\" and the\n\"/etc/audit/auditd.conf\" file to have a mode of \"0640\" with the following\ncommands:\n\n $ sudo chmod 0640 /etc/audit/rules.d/audit.rules\n $ sudo chmod 0640 /etc/audit/rules.d/[customrulesfile].rules\n $ sudo chmod 0640 /etc/audit/auditd.conf'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000063-GPOS-00032'\n tag gid: 'V-230471'\n tag rid: 'SV-258171r627750_rule'\n tag stig_id: 'RHEL-08-030610'\n tag fix_id: 'F-33115r568160_fix'\n tag cci: ['CCI-000171']\n tag nist: ['AU-12 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n rules_files = bash('ls -d /etc/audit/rules.d/*.rules').stdout.strip.split.append('/etc/audit/auditd.conf')\n\n failing_files = rules_files.select { |rf| file(rf).more_permissive_than?(input('audit_conf_mode')) }\n\n describe 'Audit configuration files' do\n it \"should be no more permissive than '#{input('audit_conf_mode')}'\" do\n expect(failing_files).to be_empty, \"Failing files:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258171.rb" + }, + "title": "RHEL 8 must allow only the Information System Security Manager (ISSM)\n(or individuals or roles appointed by the ISSM) to select which auditable\nevents are to be audited.", + "desc": "Without the capability to restrict the roles and individuals that can\nselect which events are audited, unauthorized personnel may be able to prevent\nthe auditing of critical events. Misconfigured audits may degrade the system's\nperformance by overwhelming the audit log. Misconfigured audits may also make\nit more difficult to establish, correlate, and investigate the events relating\nto an incident or identify those responsible for one.", + "descriptions": { + "default": "Without the capability to restrict the roles and individuals that can\nselect which events are audited, unauthorized personnel may be able to prevent\nthe auditing of critical events. Misconfigured audits may degrade the system's\nperformance by overwhelming the audit log. Misconfigured audits may also make\nit more difficult to establish, correlate, and investigate the events relating\nto an incident or identify those responsible for one.", + "check": "Verify that the files in directory \"/etc/audit/rules.d/\" and\n\"/etc/audit/auditd.conf\" file have a mode of \"0640\" or less permissive by\nusing the following commands:\n\n $ sudo ls -al /etc/audit/rules.d/*.rules\n\n -rw-r----- 1 root root 1280 Feb 16 17:09 audit.rules\n\n $ sudo ls -l /etc/audit/auditd.conf\n\n -rw-r----- 1 root root 621 Sep 22 17:19 auditd.conf\n\n If the files in the \"/etc/audit/rules.d/\" directory or the\n\"/etc/audit/auditd.conf\" file have a mode more permissive than \"0640\", this\nis a finding.", + "fix": "Configure the files in directory \"/etc/audit/rules.d/\" and the\n\"/etc/audit/auditd.conf\" file to have a mode of \"0640\" with the following\ncommands:\n\n $ sudo chmod 0640 /etc/audit/rules.d/audit.rules\n $ sudo chmod 0640 /etc/audit/rules.d/[customrulesfile].rules\n $ sudo chmod 0640 /etc/audit/auditd.conf" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000063-GPOS-00032", + "gid": "V-230471", + "rid": "SV-258171r627750_rule", + "stig_id": "RHEL-08-030610", + "fix_id": "F-33115r568160_fix", + "cci": [ + "CCI-000171" + ], + "nist": [ + "AU-12 b" + ], + "host": null + } + }, + { + "id": "SV-258172", + "code": "control 'SV-258172' do\n title 'RHEL 9 /etc/audit/auditd.conf file must have 0640 or less permissive to prevent unauthorized access.'\n desc \"Without the capability to restrict the roles and individuals that can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. Misconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\"\n desc 'check', 'Verify the mode of /etc/audit/auditd.conf with the command:\n\n$ sudo stat -c \"%a %n\" /etc/audit/auditd.conf\n\n640 /etc/audit/auditd.conf\n\nIf \"/etc/audit/auditd.conf\" does not have a mode of \"0640\", this is a finding.'\n desc 'fix', 'Set the mode of /etc/audit/auditd.conf file to 0640 with the command:\n\n$ sudo chmod 0640 /etc/audit/auditd.conf'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61913r926501_chk'\n tag severity: 'medium'\n tag gid: 'V-258172'\n tag rid: 'SV-258172r926503_rule'\n tag stig_id: 'RHEL-09-653115'\n tag gtitle: 'SRG-OS-000063-GPOS-00032'\n tag fix_id: 'F-61837r926502_fix'\n tag 'documentable'\n tag cci: ['CCI-000171']\n tag nist: ['AU-12 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258172.rb" + }, + "title": "RHEL 9 /etc/audit/auditd.conf file must have 0640 or less permissive to prevent unauthorized access.", + "desc": "Without the capability to restrict the roles and individuals that can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. Misconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.", + "descriptions": { + "default": "Without the capability to restrict the roles and individuals that can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. Misconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.", + "check": "Verify the mode of /etc/audit/auditd.conf with the command:\n\n$ sudo stat -c \"%a %n\" /etc/audit/auditd.conf\n\n640 /etc/audit/auditd.conf\n\nIf \"/etc/audit/auditd.conf\" does not have a mode of \"0640\", this is a finding.", + "fix": "Set the mode of /etc/audit/auditd.conf file to 0640 with the command:\n\n$ sudo chmod 0640 /etc/audit/auditd.conf" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61913r926501_chk", + "severity": "medium", + "gid": "V-258172", + "rid": "SV-258172r926503_rule", + "stig_id": "RHEL-09-653115", + "gtitle": "SRG-OS-000063-GPOS-00032", + "fix_id": "F-61837r926502_fix", + "documentable": null, + "cci": [ + "CCI-000171" + ], + "nist": [ + "AU-12 b" + ] + } + }, + { + "id": "SV-258173", + "code": "control 'SV-258173' do\n title 'RHEL 8 must allocate an audit_backlog_limit of sufficient size to\ncapture processes that start prior to the audit daemon.'\n desc 'Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n Allocating an audit_backlog_limit of sufficient size is critical in\nmaintaining a stable boot process. With an insufficient limit allocated, the\nsystem is susceptible to boot failures and crashes.'\n desc 'check', 'Verify RHEL 8 allocates a sufficient audit_backlog_limit to capture processes that start prior to the audit daemon with the following commands:\n\n$ sudo grub2-editenv list | grep audit\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the \"audit_backlog_limit\" entry does not equal \"8192\" or greater, is missing, or the line is commented out, this is a finding.\n\nCheck the audit_backlog_limit is set to persist in kernel updates:\n\n$ sudo grep audit /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"audit_backlog_limit=8192\"\n\nIf \"audit_backlog_limit\" is not set to \"8192\" or greater, is missing or commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to allocate sufficient audit_backlog_limit to capture\nprocesses that start prior to the audit daemon with the following command:\n\n $ sudo grubby --update-kernel=ALL --args=\"audit_backlog_limit=8192\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"audit_backlog_limit=8192\"'\n impact 0.3\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000341-GPOS-00132'\n tag gid: 'V-230469'\n tag rid: 'SV-258173r877391_rule'\n tag stig_id: 'RHEL-08-030602'\n tag fix_id: 'F-33113r568154_fix'\n tag cci: ['CCI-001849']\n tag nist: ['AU-4']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n grub_config = command('grub2-editenv - list').stdout\n kernelopts = parse_config(grub_config)['kernelopts'].strip.gsub(' ', \"\\n\")\n grub_cmdline_linux = parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX'].strip.gsub(' ', \"\\n\").gsub('\"',\n '')\n\n expected_backlog_limit = input('expected_backlog_limit')\n\n describe 'kernelopts' do\n subject { parse_config(kernelopts) }\n its('audit_backlog_limit') { should cmp >= expected_backlog_limit }\n end\n\n describe 'persistant kernelopts' do\n subject { parse_config(grub_cmdline_linux) }\n its('audit_backlog_limit') { should cmp >= expected_backlog_limit }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258173.rb" + }, + "title": "RHEL 8 must allocate an audit_backlog_limit of sufficient size to\ncapture processes that start prior to the audit daemon.", + "desc": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n Allocating an audit_backlog_limit of sufficient size is critical in\nmaintaining a stable boot process. With an insufficient limit allocated, the\nsystem is susceptible to boot failures and crashes.", + "descriptions": { + "default": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n If auditing is enabled late in the startup process, the actions of some\nstartup processes may not be audited. Some audit systems also maintain state\ninformation only available if auditing is enabled before a given process is\ncreated.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n Allocating an audit_backlog_limit of sufficient size is critical in\nmaintaining a stable boot process. With an insufficient limit allocated, the\nsystem is susceptible to boot failures and crashes.", + "check": "Verify RHEL 8 allocates a sufficient audit_backlog_limit to capture processes that start prior to the audit daemon with the following commands:\n\n$ sudo grub2-editenv list | grep audit\n\nkernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the \"audit_backlog_limit\" entry does not equal \"8192\" or greater, is missing, or the line is commented out, this is a finding.\n\nCheck the audit_backlog_limit is set to persist in kernel updates:\n\n$ sudo grep audit /etc/default/grub\n\nGRUB_CMDLINE_LINUX=\"audit_backlog_limit=8192\"\n\nIf \"audit_backlog_limit\" is not set to \"8192\" or greater, is missing or commented out, this is a finding.", + "fix": "Configure RHEL 8 to allocate sufficient audit_backlog_limit to capture\nprocesses that start prior to the audit daemon with the following command:\n\n $ sudo grubby --update-kernel=ALL --args=\"audit_backlog_limit=8192\"\n\n Add or modify the following line in \"/etc/default/grub\" to ensure the\nconfiguration survives kernel updates:\n\n GRUB_CMDLINE_LINUX=\"audit_backlog_limit=8192\"" + }, + "impact": 0.3, + "refs": [], + "tags": { + "severity": "low", + "gtitle": "SRG-OS-000341-GPOS-00132", + "gid": "V-230469", + "rid": "SV-258173r877391_rule", + "stig_id": "RHEL-08-030602", + "fix_id": "F-33113r568154_fix", + "cci": [ + "CCI-001849" + ], + "nist": [ + "AU-4" + ], + "host": null + } + }, + { + "id": "SV-258174", + "code": "control 'SV-258174' do\n title 'The RHEL 8 Information System Security Officer (ISSO) and System\nAdministrator (SA) (at a minimum) must have mail aliases to be notified of an\naudit processing failure.'\n desc 'It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.'\n desc 'check', 'Verify that the administrators are notified in the event of an audit\nprocessing failure.\n\n Check that the \"/etc/aliases\" file has a defined value for \"root\".\n\n $ sudo grep \"postmaster:\\\\s*root$\" /etc/aliases\n\n If the command does not return a line, or the line is commented out, ask\nthe system administrator to indicate how they and the ISSO are notified of an\naudit process failure. If there is no evidence of the proper personnel being\nnotified of an audit processing failure, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to notify administrators in the event of an audit\nprocessing failure.\n\n Add/update the following line in \"/etc/aliases\":\n\n postmaster: root'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000046-GPOS-00022'\n tag gid: 'V-230389'\n tag rid: 'SV-258174r627750_rule'\n tag stig_id: 'RHEL-08-030030'\n tag fix_id: 'F-33033r567914_fix'\n tag cci: ['CCI-000139']\n tag nist: ['AU-5 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n alternative_logging = input('alternative_logging')\n\n if alternative_logging == true\n describe 'Alternative logging' do\n it 'should handle sysadmin and ISSO notification' do\n expect(alternative_logging).to eq(true)\n end\n end\n else\n describe command('grep \"postmaster:\\s*root$\" /etc/aliases') do\n its('stdout.strip') { should match(/postmaster:\\s*root/) }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258174.rb" + }, + "title": "The RHEL 8 Information System Security Officer (ISSO) and System\nAdministrator (SA) (at a minimum) must have mail aliases to be notified of an\naudit processing failure.", + "desc": "It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.", + "descriptions": { + "default": "It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.", + "check": "Verify that the administrators are notified in the event of an audit\nprocessing failure.\n\n Check that the \"/etc/aliases\" file has a defined value for \"root\".\n\n $ sudo grep \"postmaster:\\s*root$\" /etc/aliases\n\n If the command does not return a line, or the line is commented out, ask\nthe system administrator to indicate how they and the ISSO are notified of an\naudit process failure. If there is no evidence of the proper personnel being\nnotified of an audit processing failure, this is a finding.", + "fix": "Configure RHEL 8 to notify administrators in the event of an audit\nprocessing failure.\n\n Add/update the following line in \"/etc/aliases\":\n\n postmaster: root" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000046-GPOS-00022", + "gid": "V-230389", + "rid": "SV-258174r627750_rule", + "stig_id": "RHEL-08-030030", + "fix_id": "F-33033r567914_fix", + "cci": [ + "CCI-000139" + ], + "nist": [ + "AU-5 a" + ], + "host": null + } + }, + { + "id": "SV-258175", + "code": "control 'SV-258175' do\n title 'RHEL 9 audispd-plugins package must be installed.'\n desc '\"audispd-plugins\" provides plugins for the real-time interface to the audit subsystem, \"audispd\". These plugins can do things like relay events to remote machines or analyze events for suspicious behavior.'\n desc 'check', 'Verify that RHEL 9 has the audispd-plugins package for installed with the following command:\n\n$ sudo dnf list --installed audispd-plugins\n\nExample output:\n\naudispd-plugins.x86_64 3.0.7-101.el9_0.2\n\nIf the \"audispd-plugins\" package is not installed, this is a finding.'\n desc 'fix', 'The audispd-plugins package can be installed with the following command:\n \n$ sudo dnf install audispd-plugins'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61916r926510_chk'\n tag severity: 'medium'\n tag gid: 'V-258175'\n tag rid: 'SV-258175r926512_rule'\n tag stig_id: 'RHEL-09-653130'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag fix_id: 'F-61840r926511_fix'\n tag 'documentable'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258175.rb" + }, + "title": "RHEL 9 audispd-plugins package must be installed.", + "desc": "\"audispd-plugins\" provides plugins for the real-time interface to the audit subsystem, \"audispd\". These plugins can do things like relay events to remote machines or analyze events for suspicious behavior.", + "descriptions": { + "default": "\"audispd-plugins\" provides plugins for the real-time interface to the audit subsystem, \"audispd\". These plugins can do things like relay events to remote machines or analyze events for suspicious behavior.", + "check": "Verify that RHEL 9 has the audispd-plugins package for installed with the following command:\n\n$ sudo dnf list --installed audispd-plugins\n\nExample output:\n\naudispd-plugins.x86_64 3.0.7-101.el9_0.2\n\nIf the \"audispd-plugins\" package is not installed, this is a finding.", + "fix": "The audispd-plugins package can be installed with the following command:\n \n$ sudo dnf install audispd-plugins" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61916r926510_chk", + "severity": "medium", + "gid": "V-258175", + "rid": "SV-258175r926512_rule", + "stig_id": "RHEL-09-653130", + "gtitle": "SRG-OS-000342-GPOS-00133", + "fix_id": "F-61840r926511_fix", + "documentable": null, + "cci": [ + "CCI-001851" + ], + "nist": [ + "AU-4 (1)" + ] + } + }, + { + "id": "SV-258176", + "code": "control 'SV-258176' do\n title 'The RHEL 8 audit system must be configured to audit the execution of\nprivileged functions and prevent all software from executing at higher\nprivilege levels than users executing the software.'\n desc 'Misuse of privileged functions, either intentionally or\nunintentionally by authorized users, or by unauthorized external entities that\nhave compromised information system accounts, is a serious and ongoing concern\nand can have significant adverse impacts on organizations. Auditing the use of\nprivileged functions is one way to detect such misuse and identify the risk\nfrom insider threats and the advanced persistent threat.'\n desc 'check', 'Verify RHEL 8 audits the execution of privileged functions.\n\n Check if RHEL 8 is configured to audit the execution of the \"execve\"\nsystem call, by running the following command:\n\n $ sudo grep execve /etc/audit/audit.rules\n\n -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv\n\n -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv\n\n If the command does not return all lines, or the lines are commented out,\nthis is a finding.'\n desc 'fix', 'Configure RHEL 8 to audit the execution of the \"execve\" system call.\n\n Add or update the following file system rules to\n\"/etc/audit/rules.d/audit.rules\":\n\n -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv\n\n -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000326-GPOS-00126'\n tag satisfies: ['SRG-OS-000326-GPOS-00126', 'SRG-OS-000327-GPOS-00127']\n tag gid: 'V-230386'\n tag rid: 'SV-258176r854037_rule'\n tag stig_id: 'RHEL-08-030000'\n tag fix_id: 'F-33030r567905_fix'\n tag cci: ['CCI-002233']\n tag nist: ['AC-6 (8)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_syscalls = ['execve']\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('uid!=euid', 'gid!=egid', 'euid=0', 'egid=0')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258176.rb" + }, + "title": "The RHEL 8 audit system must be configured to audit the execution of\nprivileged functions and prevent all software from executing at higher\nprivilege levels than users executing the software.", + "desc": "Misuse of privileged functions, either intentionally or\nunintentionally by authorized users, or by unauthorized external entities that\nhave compromised information system accounts, is a serious and ongoing concern\nand can have significant adverse impacts on organizations. Auditing the use of\nprivileged functions is one way to detect such misuse and identify the risk\nfrom insider threats and the advanced persistent threat.", + "descriptions": { + "default": "Misuse of privileged functions, either intentionally or\nunintentionally by authorized users, or by unauthorized external entities that\nhave compromised information system accounts, is a serious and ongoing concern\nand can have significant adverse impacts on organizations. Auditing the use of\nprivileged functions is one way to detect such misuse and identify the risk\nfrom insider threats and the advanced persistent threat.", + "check": "Verify RHEL 8 audits the execution of privileged functions.\n\n Check if RHEL 8 is configured to audit the execution of the \"execve\"\nsystem call, by running the following command:\n\n $ sudo grep execve /etc/audit/audit.rules\n\n -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv\n\n -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv\n\n If the command does not return all lines, or the lines are commented out,\nthis is a finding.", + "fix": "Configure RHEL 8 to audit the execution of the \"execve\" system call.\n\n Add or update the following file system rules to\n\"/etc/audit/rules.d/audit.rules\":\n\n -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv\n\n -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv\n -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000326-GPOS-00126", + "satisfies": [ + "SRG-OS-000326-GPOS-00126", + "SRG-OS-000327-GPOS-00127" + ], + "gid": "V-230386", + "rid": "SV-258176r854037_rule", + "stig_id": "RHEL-08-030000", + "fix_id": "F-33030r567905_fix", + "cci": [ + "CCI-002233" + ], + "nist": [ + "AC-6 (8)" + ], + "host": null + } + }, + { + "id": "SV-258177", + "code": "control 'SV-258177' do\n title 'Successful/unsuccessful uses of the chmod, fchmod, and fchmodat system calls in RHEL 8 must generate an audit record.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"chmod\" system call changes the file mode bits of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits.\n\nThe \"fchmod\" system call is used to change permissions of a file.\nThe \"fchmodat\" system call is used to change permissions of a file relative to a directory file descriptor.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"chmod\", \"fchmod\", and \"fchmodat\" syscalls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep chmod /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n\nIf the command does not return an audit rule for \"chmod\", \"fchmod\", and \"fchmodat\", or any of the lines returned are commented out, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chmod\", \"fchmod\", and \"fchmodat\" syscalls by adding or updating the following line to \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-230456'\n tag rid: 'SV-258177r810462_rule'\n tag stig_id: 'RHEL-08-030490'\n tag fix_id: 'F-33100r809310_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_syscalls = ['chmod', 'fchmod', 'fchmodat']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258177.rb" + }, + "title": "Successful/unsuccessful uses of the chmod, fchmod, and fchmodat system calls in RHEL 8 must generate an audit record.", + "desc": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"chmod\" system call changes the file mode bits of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits.\n\nThe \"fchmod\" system call is used to change permissions of a file.\nThe \"fchmodat\" system call is used to change permissions of a file relative to a directory file descriptor.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"chmod\" system call changes the file mode bits of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new mode bits.\n\nThe \"fchmod\" system call is used to change permissions of a file.\nThe \"fchmodat\" system call is used to change permissions of a file relative to a directory file descriptor.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible.", + "check": "Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"chmod\", \"fchmod\", and \"fchmodat\" syscalls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep chmod /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n\nIf the command does not return an audit rule for \"chmod\", \"fchmod\", and \"fchmodat\", or any of the lines returned are commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chmod\", \"fchmod\", and \"fchmodat\" syscalls by adding or updating the following line to \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000064-GPOS-00033", + "SRG-OS-000466-GPOS-00210" + ], + "gid": "V-230456", + "rid": "SV-258177r810462_rule", + "stig_id": "RHEL-08-030490", + "fix_id": "F-33100r809310_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258178", + "code": "control 'SV-258178' do\n title 'Successful/unsuccessful uses of the chown, fchown, fchownat, and lchown system calls in RHEL 8 must generate an audit record.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"chown\" command is used to change file owner and group.\n\nThe \"fchown\" system call is used to change the ownership of a file referred to by the open file descriptor.\nThe \"fchownat\" system call is used to change ownership of a file relative to a directory file descriptor.\nThe \"lchown\" system call is used to change the ownership of the file specified by a path, which does not dereference symbolic links.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"chown\", \"fchown\", \"fchownat\" and \"lchown\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep chown /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n\nIf audit rules are not defined for \"chown\", \"fchown\", \"fchownat\", and \"lchown\" or any of the lines returned are commented out, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" system calls by adding or updating the following line to \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-230455'\n tag rid: 'SV-258178r810459_rule'\n tag stig_id: 'RHEL-08-030480'\n tag fix_id: 'F-33099r809307_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_syscalls = ['chown']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258178.rb" + }, + "title": "Successful/unsuccessful uses of the chown, fchown, fchownat, and lchown system calls in RHEL 8 must generate an audit record.", + "desc": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"chown\" command is used to change file owner and group.\n\nThe \"fchown\" system call is used to change the ownership of a file referred to by the open file descriptor.\nThe \"fchownat\" system call is used to change ownership of a file relative to a directory file descriptor.\nThe \"lchown\" system call is used to change the ownership of the file specified by a path, which does not dereference symbolic links.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"chown\" command is used to change file owner and group.\n\nThe \"fchown\" system call is used to change the ownership of a file referred to by the open file descriptor.\nThe \"fchownat\" system call is used to change ownership of a file relative to a directory file descriptor.\nThe \"lchown\" system call is used to change the ownership of the file specified by a path, which does not dereference symbolic links.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "check": "Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"chown\", \"fchown\", \"fchownat\" and \"lchown\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep chown /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n\nIf audit rules are not defined for \"chown\", \"fchown\", \"fchownat\", and \"lchown\" or any of the lines returned are commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" system calls by adding or updating the following line to \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000064-GPOS-00033", + "SRG-OS-000466-GPOS-00210" + ], + "gid": "V-230455", + "rid": "SV-258178r810459_rule", + "stig_id": "RHEL-08-030480", + "fix_id": "F-33099r809307_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258179", + "code": "control 'SV-258179' do\n title 'The RHEL 8 audit system must be configured to audit any usage of the setxattr, fsetxattr, lsetxattr, removexattr, fremovexattr, and lremovexattr system calls.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\n\"Setxattr\" is a system call used to set an extended attribute value.\n\"Fsetxattr\" is a system call used to set an extended attribute value. This is used to set extended attributes on a file.\n\"Lsetxattr\" is a system call used to set an extended attribute value. This is used to set extended attributes on a symbolic link.\n\"Removexattr\" is a system call that removes extended attributes.\n\"Fremovexattr\" is a system call that removes extended attributes. This is used for removal of extended attributes from a file.\n\"Lremovexattr\" is a system call that removes extended attributes. This is used for removal of extended attributes from symbolic links.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify if RHEL 8 is configured to audit the execution of the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls by running the following command:\n\n$ sudo grep xattr /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n\nIf the command does not return an audit rule for \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" or any of the lines returned are commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to audit the execution of the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls by adding or updating the following lines to \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000474-GPOS-00219', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-230413'\n tag rid: 'SV-258179r810463_rule'\n tag stig_id: 'RHEL-08-030200'\n tag fix_id: 'F-33057r809294_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_syscalls = ['setxattr', 'fsetxattr', 'lsetxattr', 'removexattr', 'fremovexattr', 'lremovexattr']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258179.rb" + }, + "title": "The RHEL 8 audit system must be configured to audit any usage of the setxattr, fsetxattr, lsetxattr, removexattr, fremovexattr, and lremovexattr system calls.", + "desc": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\n\"Setxattr\" is a system call used to set an extended attribute value.\n\"Fsetxattr\" is a system call used to set an extended attribute value. This is used to set extended attributes on a file.\n\"Lsetxattr\" is a system call used to set an extended attribute value. This is used to set extended attributes on a symbolic link.\n\"Removexattr\" is a system call that removes extended attributes.\n\"Fremovexattr\" is a system call that removes extended attributes. This is used for removal of extended attributes from a file.\n\"Lremovexattr\" is a system call that removes extended attributes. This is used for removal of extended attributes from symbolic links.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\n\"Setxattr\" is a system call used to set an extended attribute value.\n\"Fsetxattr\" is a system call used to set an extended attribute value. This is used to set extended attributes on a file.\n\"Lsetxattr\" is a system call used to set an extended attribute value. This is used to set extended attributes on a symbolic link.\n\"Removexattr\" is a system call that removes extended attributes.\n\"Fremovexattr\" is a system call that removes extended attributes. This is used for removal of extended attributes from a file.\n\"Lremovexattr\" is a system call that removes extended attributes. This is used for removal of extended attributes from symbolic links.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "check": "Verify if RHEL 8 is configured to audit the execution of the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls by running the following command:\n\n$ sudo grep xattr /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n\nIf the command does not return an audit rule for \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" or any of the lines returned are commented out, this is a finding.", + "fix": "Configure RHEL 8 to audit the execution of the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls by adding or updating the following lines to \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod\n\n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000458-GPOS-00203", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000463-GPOS-00207", + "SRG-OS-000468-GPOS-00212", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000474-GPOS-00219", + "SRG-OS-000466-GPOS-00210" + ], + "gid": "V-230413", + "rid": "SV-258179r810463_rule", + "stig_id": "RHEL-08-030200", + "fix_id": "F-33057r809294_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258180", + "code": "control 'SV-258180' do\n title 'RHEL 9 must audit all uses of umount system calls.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\nWhen a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.\n\n'\n desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the \"umount\" command with the following command:\n\n$ sudo auditctl -l | grep umount\n\n-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount\n\nIf the command does not return an audit rule for \"umount\" or any of the lines returned are commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the \"umount\" command by adding or updating the following rules in \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61921r926525_chk'\n tag severity: 'medium'\n tag gid: 'V-258180'\n tag rid: 'SV-258180r926527_rule'\n tag stig_id: 'RHEL-09-654030'\n tag gtitle: 'SRG-OS-000037-GPOS-00015'\n tag fix_id: 'F-61845r926526_fix'\n tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag 'documentable'\n tag cci: ['CCI-000130', 'CCI-000169', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-3 a', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258180.rb" + }, + "title": "RHEL 9 must audit all uses of umount system calls.", + "desc": "Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\nWhen a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.\n\n", + "descriptions": { + "default": "Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\nWhen a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.\n\n", + "check": "Verify that RHEL 9 is configured to audit the execution of the \"umount\" command with the following command:\n\n$ sudo auditctl -l | grep umount\n\n-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount\n\nIf the command does not return an audit rule for \"umount\" or any of the lines returned are commented out, this is a finding.", + "fix": "Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the \"umount\" command by adding or updating the following rules in \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61921r926525_chk", + "severity": "medium", + "gid": "V-258180", + "rid": "SV-258180r926527_rule", + "stig_id": "RHEL-09-654030", + "gtitle": "SRG-OS-000037-GPOS-00015", + "fix_id": "F-61845r926526_fix", + "satisfies": [ + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "documentable": null, + "cci": [ + "CCI-000130", + "CCI-000169", + "CCI-000172", + "CCI-002884" + ], + "nist": [ + "AU-3 a", + "AU-12 a", + "AU-12 c", + "MA-4 (1) (a)" + ] + } + }, + { + "id": "SV-258181", + "code": "control 'SV-258181' do\n title 'Successful/unsuccessful uses of the chacl command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chacl\" command is\nused to change the access control list of a file or directory.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"chacl\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chacl /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"chacl\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-230464'\n tag rid: 'SV-258181r627750_rule'\n tag stig_id: 'RHEL-08-030570'\n tag fix_id: 'F-33108r568139_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/chacl'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258181.rb" + }, + "title": "Successful/unsuccessful uses of the chacl command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chacl\" command is\nused to change the access control list of a file or directory.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chacl\" command is\nused to change the access control list of a file or directory.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"chacl\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chacl /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"chacl\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000466-GPOS-00210" + ], + "gid": "V-230464", + "rid": "SV-258181r627750_rule", + "stig_id": "RHEL-08-030570", + "fix_id": "F-33108r568139_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258182", + "code": "control 'SV-258182' do\n title 'Successful/unsuccessful uses of the setfacl command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"setfacl\" command is\nused to set file access control lists.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"setfacl\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w setfacl /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"setfacl\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230435'\n tag rid: 'SV-258182r627750_rule'\n tag stig_id: 'RHEL-08-030330'\n tag fix_id: 'F-33079r568052_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/setfacl'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258182.rb" + }, + "title": "Successful/unsuccessful uses of the setfacl command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"setfacl\" command is\nused to set file access control lists.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"setfacl\" command is\nused to set file access control lists.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"setfacl\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w setfacl /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"setfacl\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230435", + "rid": "SV-258182r627750_rule", + "stig_id": "RHEL-08-030330", + "fix_id": "F-33079r568052_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258183", + "code": "control 'SV-258183' do\n title 'Successful/unsuccessful uses of the chcon command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chcon\" command is\nused to change file SELinux security context.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"chcon\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chcon /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"chcon\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230419'\n tag rid: 'SV-258183r627750_rule'\n tag stig_id: 'RHEL-08-030260'\n tag fix_id: 'F-33063r568004_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/chcon'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258183.rb" + }, + "title": "Successful/unsuccessful uses of the chcon command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chcon\" command is\nused to change file SELinux security context.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chcon\" command is\nused to change file SELinux security context.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"chcon\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chcon /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"chcon\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F\nauid!=unset -k perm_mod\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000468-GPOS-00212", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230419", + "rid": "SV-258183r627750_rule", + "stig_id": "RHEL-08-030260", + "fix_id": "F-33063r568004_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258184", + "code": "control 'SV-258184' do\n title 'Successful/unsuccessful uses of semanage in RHEL 8 must generate an\naudit record.'\n desc 'Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"semanage\" command is used to configure certain elements of SELinux\npolicy without requiring modification to or recompilation from policy sources.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof \"semanage\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"semanage\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"semanage\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230429'\n tag rid: 'SV-258184r627750_rule'\n tag stig_id: 'RHEL-08-030313'\n tag fix_id: 'F-33073r568034_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/semanage'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258184.rb" + }, + "title": "Successful/unsuccessful uses of semanage in RHEL 8 must generate an\naudit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"semanage\" command is used to configure certain elements of SELinux\npolicy without requiring modification to or recompilation from policy sources.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"semanage\" command is used to configure certain elements of SELinux\npolicy without requiring modification to or recompilation from policy sources.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof \"semanage\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"semanage\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"semanage\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230429", + "rid": "SV-258184r627750_rule", + "stig_id": "RHEL-08-030313", + "fix_id": "F-33073r568034_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258185", + "code": "control 'SV-258185' do\n title 'Successful/unsuccessful uses of setfiles in RHEL 8 must generate an\naudit record.'\n desc 'Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"setfiles\" command is primarily used to initialize the security context\nfields (extended attributes) on one or more filesystems (or parts of them).\nUsually it is initially run as part of the SELinux installation process (a step\ncommonly known as labeling).\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof \"setfiles\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"setfiles\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/setfiles -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"setfiles\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/setfiles -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230430'\n tag rid: 'SV-258185r627750_rule'\n tag stig_id: 'RHEL-08-030314'\n tag fix_id: 'F-33074r568037_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/setfiles'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258185.rb" + }, + "title": "Successful/unsuccessful uses of setfiles in RHEL 8 must generate an\naudit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"setfiles\" command is primarily used to initialize the security context\nfields (extended attributes) on one or more filesystems (or parts of them).\nUsually it is initially run as part of the SELinux installation process (a step\ncommonly known as labeling).\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"setfiles\" command is primarily used to initialize the security context\nfields (extended attributes) on one or more filesystems (or parts of them).\nUsually it is initially run as part of the SELinux installation process (a step\ncommonly known as labeling).\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof \"setfiles\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"setfiles\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/setfiles -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"setfiles\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/setfiles -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230430", + "rid": "SV-258185r627750_rule", + "stig_id": "RHEL-08-030314", + "fix_id": "F-33074r568037_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258186", + "code": "control 'SV-258186' do\n title 'Successful/unsuccessful uses of setsebool in RHEL 8 must generate an\naudit record.'\n desc 'Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"setsebool\" command sets the current state of a particular SELinux\nboolean or a list of booleans to a given value.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof \"setsebool\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"setsebool\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"setsebool\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230432'\n tag rid: 'SV-258186r627750_rule'\n tag stig_id: 'RHEL-08-030316'\n tag fix_id: 'F-33076r568043_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/setsebool'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258186.rb" + }, + "title": "Successful/unsuccessful uses of setsebool in RHEL 8 must generate an\naudit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"setsebool\" command sets the current state of a particular SELinux\nboolean or a list of booleans to a given value.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"setsebool\" command sets the current state of a particular SELinux\nboolean or a list of booleans to a given value.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof \"setsebool\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"setsebool\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"setsebool\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230432", + "rid": "SV-258186r627750_rule", + "stig_id": "RHEL-08-030316", + "fix_id": "F-33076r568043_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258187", + "code": "control 'SV-258187' do\n title 'Successful/unsuccessful uses of the rename, unlink, rmdir, renameat, and unlinkat system calls in RHEL 8 must generate an audit record.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"rename\" system call will rename the specified files by replacing the first occurrence of expression in their name by replacement.\n\nThe \"unlink\" system call deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse.\nThe \"rmdir\" system call removes empty directories.\nThe \"renameat\" system call renames a file, moving it between directories if required.\nThe \"unlinkat\" system call operates in exactly the same way as either \"unlink\" or \"rmdir\" except for the differences described in the manual page.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible.'\n desc 'check', %q(Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"rename\", \"unlink\", \"rmdir\", \"renameat\", and \"unlinkat\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep 'rename\\|unlink\\|rmdir' /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n-a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n\nIf the command does not return an audit rule for \"rename\", \"unlink\", \"rmdir\", \"renameat\", and \"unlinkat\" or any of the lines returned are commented out, this is a finding.)\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"rename\", \"unlink\", \"rmdir\", \"renameat\", and \"unlinkat\" system calls by adding or updating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n-a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230439'\n tag rid: 'SV-258187r810465_rule'\n tag stig_id: 'RHEL-08-030361'\n tag fix_id: 'F-33083r809301_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_syscalls = ['rename', 'unlink', 'rmdir', 'renameat', 'unlinkat']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258187.rb" + }, + "title": "Successful/unsuccessful uses of the rename, unlink, rmdir, renameat, and unlinkat system calls in RHEL 8 must generate an audit record.", + "desc": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"rename\" system call will rename the specified files by replacing the first occurrence of expression in their name by replacement.\n\nThe \"unlink\" system call deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse.\nThe \"rmdir\" system call removes empty directories.\nThe \"renameat\" system call renames a file, moving it between directories if required.\nThe \"unlinkat\" system call operates in exactly the same way as either \"unlink\" or \"rmdir\" except for the differences described in the manual page.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"rename\" system call will rename the specified files by replacing the first occurrence of expression in their name by replacement.\n\nThe \"unlink\" system call deletes a name from the filesystem. If that name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made available for reuse.\nThe \"rmdir\" system call removes empty directories.\nThe \"renameat\" system call renames a file, moving it between directories if required.\nThe \"unlinkat\" system call operates in exactly the same way as either \"unlink\" or \"rmdir\" except for the differences described in the manual page.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. Performance can be helped, however, by combining syscalls into one rule whenever possible.", + "check": "Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"rename\", \"unlink\", \"rmdir\", \"renameat\", and \"unlinkat\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep 'rename\\|unlink\\|rmdir' /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n-a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n\nIf the command does not return an audit rule for \"rename\", \"unlink\", \"rmdir\", \"renameat\", and \"unlinkat\" or any of the lines returned are commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"rename\", \"unlink\", \"rmdir\", \"renameat\", and \"unlinkat\" system calls by adding or updating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n-a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230439", + "rid": "SV-258187r810465_rule", + "stig_id": "RHEL-08-030361", + "fix_id": "F-33083r809301_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258188", + "code": "control 'SV-258188' do\n title 'Successful/unsuccessful uses of the truncate, ftruncate, creat, open, openat, and open_by_handle_at system calls in RHEL 8 must generate an audit record.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"truncate\" and \"ftruncate\" functions are used to truncate a file to a specified length.\n\nThe \"creat\" system call is used to open and possibly create a file or device.\nThe \"open\" system call opens a file specified by a pathname. If the specified file does not exist, it may optionally be created by \"open\".\nThe \"openat\" system call opens a file specified by a relative pathname.\nThe \"name_to_handle_at\" and \"open_by_handle_at\" system calls split the functionality of \"openat\" into two parts: \"name_to_handle_at\" returns an opaque handle that corresponds to a specified file; \"open_by_handle_at\" opens the file corresponding to a handle returned by a previous call to \"name_to_handle_at\" and returns an open file descriptor.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.'\n desc 'check', %q(Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"truncate\", \"ftruncate\", \"creat\", \"open\", \"openat\", and \"open_by_handle_at\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep 'open\\|truncate\\|creat' /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n\nIf the output does not produce rules containing \"-F exit=-EPERM\", this is a finding.\nIf the output does not produce rules containing \"-F exit=-EACCES\", this is a finding.\nIf the command does not return an audit rule for \"truncate\", \"ftruncate\", \"creat\", \"open\", \"openat\", and \"open_by_handle_at\" or any of the lines returned are commented out, this is a finding.)\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"truncate\", \"ftruncate\", \"creat\", \"open\", \"openat\", and \"open_by_handle_at\" system calls by adding or updating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033']\n tag gid: 'V-230449'\n tag rid: 'SV-258188r810455_rule'\n tag stig_id: 'RHEL-08-030420'\n tag fix_id: 'F-33093r809304_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_syscalls = ['truncate', 'ftruncate', 'creat', 'open', 'openat', 'open_by_handle_at']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258188.rb" + }, + "title": "Successful/unsuccessful uses of the truncate, ftruncate, creat, open, openat, and open_by_handle_at system calls in RHEL 8 must generate an audit record.", + "desc": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"truncate\" and \"ftruncate\" functions are used to truncate a file to a specified length.\n\nThe \"creat\" system call is used to open and possibly create a file or device.\nThe \"open\" system call opens a file specified by a pathname. If the specified file does not exist, it may optionally be created by \"open\".\nThe \"openat\" system call opens a file specified by a relative pathname.\nThe \"name_to_handle_at\" and \"open_by_handle_at\" system calls split the functionality of \"openat\" into two parts: \"name_to_handle_at\" returns an opaque handle that corresponds to a specified file; \"open_by_handle_at\" opens the file corresponding to a handle returned by a previous call to \"name_to_handle_at\" and returns an open file descriptor.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"truncate\" and \"ftruncate\" functions are used to truncate a file to a specified length.\n\nThe \"creat\" system call is used to open and possibly create a file or device.\nThe \"open\" system call opens a file specified by a pathname. If the specified file does not exist, it may optionally be created by \"open\".\nThe \"openat\" system call opens a file specified by a relative pathname.\nThe \"name_to_handle_at\" and \"open_by_handle_at\" system calls split the functionality of \"openat\" into two parts: \"name_to_handle_at\" returns an opaque handle that corresponds to a specified file; \"open_by_handle_at\" opens the file corresponding to a handle returned by a previous call to \"name_to_handle_at\" and returns an open file descriptor.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "check": "Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"truncate\", \"ftruncate\", \"creat\", \"open\", \"openat\", and \"open_by_handle_at\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep 'open\\|truncate\\|creat' /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n\nIf the output does not produce rules containing \"-F exit=-EPERM\", this is a finding.\nIf the output does not produce rules containing \"-F exit=-EACCES\", this is a finding.\nIf the command does not return an audit rule for \"truncate\", \"ftruncate\", \"creat\", \"open\", \"openat\", and \"open_by_handle_at\" or any of the lines returned are commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"truncate\", \"ftruncate\", \"creat\", \"open\", \"openat\", and \"open_by_handle_at\" system calls by adding or updating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access\n\n-a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n-a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000064-GPOS-00033" + ], + "gid": "V-230449", + "rid": "SV-258188r810455_rule", + "stig_id": "RHEL-08-030420", + "fix_id": "F-33093r809304_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258189", + "code": "control 'SV-258189' do\n title 'Successful/unsuccessful uses of the delete_module command in RHEL 8\nmust generate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"delete_module\"\ncommand is used to unload a kernel module.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"delete_module\" command by performing the following\ncommand to check the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"delete_module\" /etc/audit/audit.rules\n\n -a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n -a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"delete_module\" command by adding or\nupdating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n -a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230446'\n tag rid: 'SV-258189r627750_rule'\n tag stig_id: 'RHEL-08-030390'\n tag fix_id: 'F-33090r568085_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_syscalls = ['delete_module']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258189.rb" + }, + "title": "Successful/unsuccessful uses of the delete_module command in RHEL 8\nmust generate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"delete_module\"\ncommand is used to unload a kernel module.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"delete_module\"\ncommand is used to unload a kernel module.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"delete_module\" command by performing the following\ncommand to check the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"delete_module\" /etc/audit/audit.rules\n\n -a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n -a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"delete_module\" command by adding or\nupdating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n -a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k\nmodule_chng\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230446", + "rid": "SV-258189r627750_rule", + "stig_id": "RHEL-08-030390", + "fix_id": "F-33090r568085_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258190", + "code": "control 'SV-258190' do\n title 'Successful/unsuccessful uses of the init_module and finit_module system calls in RHEL 8 must generate an audit record.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"init_module\" and \"finit_module\" system calls are used to load a kernel module.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"init_module\" and \"finit_module\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep init_module /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n\nIf the command does not return an audit rule for \"init_module\" and \"finit_module\" or any of the lines returned are commented out, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"init_module\" and \"finit_module\" system calls by adding or updating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230438'\n tag rid: 'SV-258190r810464_rule'\n tag stig_id: 'RHEL-08-030360'\n tag fix_id: 'F-33082r810448_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_syscalls = ['init_module', 'finit_module']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258190.rb" + }, + "title": "Successful/unsuccessful uses of the init_module and finit_module system calls in RHEL 8 must generate an audit record.", + "desc": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"init_module\" and \"finit_module\" system calls are used to load a kernel module.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter). The \"init_module\" and \"finit_module\" system calls are used to load a kernel module.\n\nWhen a user logs on, the AUID is set to the UID of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to \"-1\". The AUID representation is an unsigned 32-bit integer, which equals \"4294967295\". The audit system interprets \"-1\", \"4294967295\", and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each syscall made by all programs on the system. Therefore, it is very important to use syscall rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining syscalls into one rule whenever possible.", + "check": "Verify RHEL 8 generates an audit record upon successful/unsuccessful attempts to use the \"init_module\" and \"finit_module\" system calls by using the following command to check the file system rules in \"/etc/audit/audit.rules\":\n\n$ sudo grep init_module /etc/audit/audit.rules\n\n-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n\nIf the command does not return an audit rule for \"init_module\" and \"finit_module\" or any of the lines returned are commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"init_module\" and \"finit_module\" system calls by adding or updating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230438", + "rid": "SV-258190r810464_rule", + "stig_id": "RHEL-08-030360", + "fix_id": "F-33082r810448_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258191", + "code": "control 'SV-258191' do\n title 'Successful/unsuccessful uses of the chage command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chage\" command is\nused to change or view user password expiry information.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"chage\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chage /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-chage\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"chage\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-chage\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230418'\n tag rid: 'SV-258191r627750_rule'\n tag stig_id: 'RHEL-08-030250'\n tag fix_id: 'F-33062r568001_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/chage'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258191.rb" + }, + "title": "Successful/unsuccessful uses of the chage command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chage\" command is\nused to change or view user password expiry information.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chage\" command is\nused to change or view user password expiry information.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"chage\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chage /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-chage\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"chage\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-chage\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000468-GPOS-00212", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230418", + "rid": "SV-258191r627750_rule", + "stig_id": "RHEL-08-030250", + "fix_id": "F-33062r568001_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258192", + "code": "control 'SV-258192' do\n title 'Successful/unsuccessful uses of the chsh command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chsh\" command is\nused to change the login shell.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"chsh\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chsh /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"chsh\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230448'\n tag rid: 'SV-258192r627750_rule'\n tag stig_id: 'RHEL-08-030410'\n tag fix_id: 'F-33092r568091_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/chsh'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258192.rb" + }, + "title": "Successful/unsuccessful uses of the chsh command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chsh\" command is\nused to change the login shell.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"chsh\" command is\nused to change the login shell.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"chsh\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w chsh /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"chsh\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230448", + "rid": "SV-258192r627750_rule", + "stig_id": "RHEL-08-030410", + "fix_id": "F-33092r568091_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258193", + "code": "control 'SV-258193' do\n title 'Successful/unsuccessful uses of the crontab command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"crontab\" command is\nused to maintain crontab files for individual users. Crontab is the program\nused to install, remove, or list the tables used to drive the cron daemon. This\nis similar to the task scheduler used in other operating systems.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"crontab\" command by performing the following command to check the\nfile system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w crontab /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-crontab\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"crontab\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-crontab\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230447'\n tag rid: 'SV-258193r627750_rule'\n tag stig_id: 'RHEL-08-030400'\n tag fix_id: 'F-33091r568088_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/crontab'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258193.rb" + }, + "title": "Successful/unsuccessful uses of the crontab command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"crontab\" command is\nused to maintain crontab files for individual users. Crontab is the program\nused to install, remove, or list the tables used to drive the cron daemon. This\nis similar to the task scheduler used in other operating systems.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"crontab\" command is\nused to maintain crontab files for individual users. Crontab is the program\nused to install, remove, or list the tables used to drive the cron daemon. This\nis similar to the task scheduler used in other operating systems.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"crontab\" command by performing the following command to check the\nfile system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w crontab /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-crontab\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"crontab\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-crontab\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230447", + "rid": "SV-258193r627750_rule", + "stig_id": "RHEL-08-030400", + "fix_id": "F-33091r568088_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258194", + "code": "control 'SV-258194' do\n title 'Successful/unsuccessful uses of the gpasswd command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"gpasswd\" command is\nused to administer /etc/group and /etc/gshadow. Every group can have\nadministrators, members and a password.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"gpasswd\" command by performing the following command to check the\nfile system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w gpasswd /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-gpasswd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"gpasswd\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-gpasswd\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230444'\n tag rid: 'SV-258194r627750_rule'\n tag stig_id: 'RHEL-08-030370'\n tag fix_id: 'F-33088r568079_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/gpasswd'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258194.rb" + }, + "title": "Successful/unsuccessful uses of the gpasswd command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"gpasswd\" command is\nused to administer /etc/group and /etc/gshadow. Every group can have\nadministrators, members and a password.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"gpasswd\" command is\nused to administer /etc/group and /etc/gshadow. Every group can have\nadministrators, members and a password.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"gpasswd\" command by performing the following command to check the\nfile system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w gpasswd /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-gpasswd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"gpasswd\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-gpasswd\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230444", + "rid": "SV-258194r627750_rule", + "stig_id": "RHEL-08-030370", + "fix_id": "F-33088r568079_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258195", + "code": "control 'SV-258195' do\n title 'Successful/unsuccessful uses of the kmod command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"kmod\" command is\nused to control Linux Kernel modules.\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.'\n desc 'check', 'Verify if RHEL 8 is configured to audit the execution of the module\nmanagement program \"kmod\", by running the following command:\n\n $ sudo grep \"/usr/bin/kmod\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=unset\n-k modules\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to audit the execution of the module management program\n\"kmod\" by adding or updating the following line to\n\"/etc/audit/rules.d/audit.rules\":\n\n -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=unset\n-k modules\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222']\n tag gid: 'V-230465'\n tag rid: 'SV-258195r627750_rule'\n tag stig_id: 'RHEL-08-030580'\n tag fix_id: 'F-33109r568142_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/kmod'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258195.rb" + }, + "title": "Successful/unsuccessful uses of the kmod command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"kmod\" command is\nused to control Linux Kernel modules.\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "descriptions": { + "default": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"kmod\" command is\nused to control Linux Kernel modules.\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "check": "Verify if RHEL 8 is configured to audit the execution of the module\nmanagement program \"kmod\", by running the following command:\n\n $ sudo grep \"/usr/bin/kmod\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=unset\n-k modules\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to audit the execution of the module management program\n\"kmod\" by adding or updating the following line to\n\"/etc/audit/rules.d/audit.rules\":\n\n -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=unset\n-k modules\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000471-GPOS-00216", + "SRG-OS-000477-GPOS-00222" + ], + "gid": "V-230465", + "rid": "SV-258195r627750_rule", + "stig_id": "RHEL-08-030580", + "fix_id": "F-33109r568142_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258196", + "code": "control 'SV-258196' do\n title 'Successful/unsuccessful uses of the newgrp command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"newgrp\" command is\nused to change the current group ID during a login session.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"newgrp\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w newgrp /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F\nauid!=unset -k priv_cmd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"newgrp\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F\nauid!=unset -k priv_cmd\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230437'\n tag rid: 'SV-258196r627750_rule'\n tag stig_id: 'RHEL-08-030350'\n tag fix_id: 'F-33081r568058_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/newgrp'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258196.rb" + }, + "title": "Successful/unsuccessful uses of the newgrp command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"newgrp\" command is\nused to change the current group ID during a login session.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"newgrp\" command is\nused to change the current group ID during a login session.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"newgrp\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w newgrp /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F\nauid!=unset -k priv_cmd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"newgrp\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F\nauid!=unset -k priv_cmd\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230437", + "rid": "SV-258196r627750_rule", + "stig_id": "RHEL-08-030350", + "fix_id": "F-33081r568058_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258197", + "code": "control 'SV-258197' do\n title 'Successful/unsuccessful uses of the pam_timestamp_check command in\nRHEL 8 must generate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"pam_timestamp_check\"\ncommand is used to check if the default timestamp is valid.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"pam_timestamp_check\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w pam_timestamp_check /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-pam_timestamp_check\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"pam_timestamp_check\" command by adding\nor updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-pam_timestamp_check\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230436'\n tag rid: 'SV-258197r627750_rule'\n tag stig_id: 'RHEL-08-030340'\n tag fix_id: 'F-33080r568055_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/pam_timestamp_check'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258197.rb" + }, + "title": "Successful/unsuccessful uses of the pam_timestamp_check command in\nRHEL 8 must generate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"pam_timestamp_check\"\ncommand is used to check if the default timestamp is valid.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"pam_timestamp_check\"\ncommand is used to check if the default timestamp is valid.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"pam_timestamp_check\" command by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w pam_timestamp_check /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-pam_timestamp_check\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"pam_timestamp_check\" command by adding\nor updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-pam_timestamp_check\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230436", + "rid": "SV-258197r627750_rule", + "stig_id": "RHEL-08-030340", + "fix_id": "F-33080r568055_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258198", + "code": "control 'SV-258198' do\n title 'Successful/unsuccessful uses of the passwd command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"passwd\" command is\nused to change passwords for user accounts.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"passwd\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w passwd /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-passwd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"passwd\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-passwd\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230422'\n tag rid: 'SV-258198r627750_rule'\n tag stig_id: 'RHEL-08-030290'\n tag fix_id: 'F-33066r568013_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/passwd'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258198.rb" + }, + "title": "Successful/unsuccessful uses of the passwd command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"passwd\" command is\nused to change passwords for user accounts.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"passwd\" command is\nused to change passwords for user accounts.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"passwd\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w passwd /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-passwd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"passwd\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-passwd\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230422", + "rid": "SV-258198r627750_rule", + "stig_id": "RHEL-08-030290", + "fix_id": "F-33066r568013_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258199", + "code": "control 'SV-258199' do\n title 'Successful/unsuccessful uses of postdrop in RHEL 8 must generate an\naudit record.'\n desc 'Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"postdrop\" command creates a file in the maildrop directory and copies\nits standard input to the file.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof \"postdrop\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"postdrop\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"postdrop\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230427'\n tag rid: 'SV-258199r627750_rule'\n tag stig_id: 'RHEL-08-030311'\n tag fix_id: 'F-33071r568028_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/postdrop'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258199.rb" + }, + "title": "Successful/unsuccessful uses of postdrop in RHEL 8 must generate an\naudit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"postdrop\" command creates a file in the maildrop directory and copies\nits standard input to the file.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"postdrop\" command creates a file in the maildrop directory and copies\nits standard input to the file.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof \"postdrop\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"postdrop\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"postdrop\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230427", + "rid": "SV-258199r627750_rule", + "stig_id": "RHEL-08-030311", + "fix_id": "F-33071r568028_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258200", + "code": "control 'SV-258200' do\n title 'Successful/unsuccessful uses of postqueue in RHEL 8 must generate an\naudit record.'\n desc 'Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"postqueue\" command implements the Postfix user interface for queue\nmanagement.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof \"postqueue\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"postqueue\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"postqueue\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230428'\n tag rid: 'SV-258200r627750_rule'\n tag stig_id: 'RHEL-08-030312'\n tag fix_id: 'F-33072r568031_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/postqueue'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258200.rb" + }, + "title": "Successful/unsuccessful uses of postqueue in RHEL 8 must generate an\naudit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"postqueue\" command implements the Postfix user interface for queue\nmanagement.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"postqueue\" command implements the Postfix user interface for queue\nmanagement.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof \"postqueue\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"postqueue\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"postqueue\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230428", + "rid": "SV-258200r627750_rule", + "stig_id": "RHEL-08-030312", + "fix_id": "F-33072r568031_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258201", + "code": "control 'SV-258201' do\n title 'Successful/unsuccessful uses of the ssh-agent in RHEL 8 must generate\nan audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"ssh-agent\" is a\nprogram to hold private keys used for public key authentication.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"ssh-agent\" by performing the following command to check\nthe file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep ssh-agent /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-ssh\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"ssh-agent\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-ssh\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230421'\n tag rid: 'SV-258201r627750_rule'\n tag stig_id: 'RHEL-08-030280'\n tag fix_id: 'F-33065r568010_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/ssh-agent'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258201.rb" + }, + "title": "Successful/unsuccessful uses of the ssh-agent in RHEL 8 must generate\nan audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"ssh-agent\" is a\nprogram to hold private keys used for public key authentication.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"ssh-agent\" is a\nprogram to hold private keys used for public key authentication.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"ssh-agent\" by performing the following command to check\nthe file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep ssh-agent /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-ssh\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"ssh-agent\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-ssh\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230421", + "rid": "SV-258201r627750_rule", + "stig_id": "RHEL-08-030280", + "fix_id": "F-33065r568010_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258202", + "code": "control 'SV-258202' do\n title 'Successful/unsuccessful uses of the ssh-keysign in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"ssh-keysign\" program\nis an SSH helper program for host-based authentication.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"ssh-keysign\" by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep ssh-keysign /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-ssh\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"ssh-keysign\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-ssh\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230434'\n tag rid: 'SV-258202r744002_rule'\n tag stig_id: 'RHEL-08-030320'\n tag fix_id: 'F-33078r744001_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/libexec/openssh/ssh-keysign'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258202.rb" + }, + "title": "Successful/unsuccessful uses of the ssh-keysign in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"ssh-keysign\" program\nis an SSH helper program for host-based authentication.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"ssh-keysign\" program\nis an SSH helper program for host-based authentication.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nattempts to use the \"ssh-keysign\" by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep ssh-keysign /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-ssh\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"ssh-keysign\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F\nauid>=1000 -F auid!=unset -k privileged-ssh\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230434", + "rid": "SV-258202r744002_rule", + "stig_id": "RHEL-08-030320", + "fix_id": "F-33078r744001_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258203", + "code": "control 'SV-258203' do\n title 'Successful/unsuccessful uses of the su command in RHEL 8 must generate\nan audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"su\" command allows a\nuser to run commands with a substitute user and group ID.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify RHEL 8 generates audit records when successful/unsuccessful attempts\nto use the \"su\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w /usr/bin/su /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset\n-k privileged-priv_change\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records when successful/unsuccessful\nattempts to use the \"su\" command occur by adding or updating the following\nrule in \"/etc/audit/rules.d/audit.rules\":\n\n -a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset\n-k privileged-priv_change\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000064-GPOS-0003', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-230412'\n tag rid: 'SV-258203r627750_rule'\n tag stig_id: 'RHEL-08-030190'\n tag fix_id: 'F-33056r567983_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/su'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258203.rb" + }, + "title": "Successful/unsuccessful uses of the su command in RHEL 8 must generate\nan audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"su\" command allows a\nuser to run commands with a substitute user and group ID.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"su\" command allows a\nuser to run commands with a substitute user and group ID.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify RHEL 8 generates audit records when successful/unsuccessful attempts\nto use the \"su\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w /usr/bin/su /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset\n-k privileged-priv_change\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records when successful/unsuccessful\nattempts to use the \"su\" command occur by adding or updating the following\nrule in \"/etc/audit/rules.d/audit.rules\":\n\n -a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset\n-k privileged-priv_change\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000064-GPOS-0003", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000466-GPOS-00210" + ], + "gid": "V-230412", + "rid": "SV-258203r627750_rule", + "stig_id": "RHEL-08-030190", + "fix_id": "F-33056r567983_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258204", + "code": "control 'SV-258204' do\n title 'Successful/unsuccessful uses of the sudo command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"sudo\" command allows\na permitted user to execute a command as the superuser or another user, as\nspecified by the security policy.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"sudo\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w sudo /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"sudo\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-230462'\n tag rid: 'SV-258204r627750_rule'\n tag stig_id: 'RHEL-08-030550'\n tag fix_id: 'F-33106r568133_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/sudo'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258204.rb" + }, + "title": "Successful/unsuccessful uses of the sudo command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"sudo\" command allows\na permitted user to execute a command as the superuser or another user, as\nspecified by the security policy.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"sudo\" command allows\na permitted user to execute a command as the superuser or another user, as\nspecified by the security policy.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"sudo\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w sudo /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"sudo\" command by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset\n-k priv_cmd\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000466-GPOS-00210" + ], + "gid": "V-230462", + "rid": "SV-258204r627750_rule", + "stig_id": "RHEL-08-030550", + "fix_id": "F-33106r568133_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258205", + "code": "control 'SV-258205' do\n title 'RHEL 9 must audit all uses of the sudoedit command.'\n desc 'Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\nWhen a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.\n\n'\n desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the \"sudoedit\" command with the following command:\n\n$ sudo auditctl -l | grep /usr/bin/sudoedit\n\n-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd\n\nIf the command does not return a line, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the \"sudoedit\" command by adding or updating the following rule in \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61946r926600_chk'\n tag severity: 'medium'\n tag gid: 'V-258205'\n tag rid: 'SV-258205r926602_rule'\n tag stig_id: 'RHEL-09-654155'\n tag gtitle: 'SRG-OS-000037-GPOS-00015'\n tag fix_id: 'F-61870r926601_fix'\n tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag 'documentable'\n tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258205.rb" + }, + "title": "RHEL 9 must audit all uses of the sudoedit command.", + "desc": "Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\nWhen a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.\n\n", + "descriptions": { + "default": "Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\nAudit records can be generated from various components within the information system (e.g., module or policy filter).\n\nWhen a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and \"unset\" in the same way.\n\nThe system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible.\n\n", + "check": "Verify that RHEL 9 is configured to audit the execution of the \"sudoedit\" command with the following command:\n\n$ sudo auditctl -l | grep /usr/bin/sudoedit\n\n-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd\n\nIf the command does not return a line, or the line is commented out, this is a finding.", + "fix": "Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the \"sudoedit\" command by adding or updating the following rule in \"/etc/audit/rules.d/audit.rules\":\n\n-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61946r926600_chk", + "severity": "medium", + "gid": "V-258205", + "rid": "SV-258205r926602_rule", + "stig_id": "RHEL-09-654155", + "gtitle": "SRG-OS-000037-GPOS-00015", + "fix_id": "F-61870r926601_fix", + "satisfies": [ + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "documentable": null, + "cci": [ + "CCI-000130", + "CCI-000135", + "CCI-000169", + "CCI-000172", + "CCI-002884" + ], + "nist": [ + "AU-3 a", + "AU-3 (1)", + "AU-12 a", + "AU-12 c", + "MA-4 (1) (a)" + ] + } + }, + { + "id": "SV-258206", + "code": "control 'SV-258206' do\n title 'Successful/unsuccessful uses of unix_chkpwd in RHEL 8 must generate an\naudit record.'\n desc 'Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"unix_chkpwd\" command is a helper program for the pam_unix module that\nverifies the password of the current user. It also checks password and account\nexpiration dates in shadow. It is not intended to be run directly from the\ncommand line and logs a security violation if done so.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof \"unix_chkpwd\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"unix_chkpwd\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"unix_chkpwd\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230433'\n tag rid: 'SV-258206r627750_rule'\n tag stig_id: 'RHEL-08-030317'\n tag fix_id: 'F-33077r568046_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/unix_chkpwd'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258206.rb" + }, + "title": "Successful/unsuccessful uses of unix_chkpwd in RHEL 8 must generate an\naudit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"unix_chkpwd\" command is a helper program for the pam_unix module that\nverifies the password of the current user. It also checks password and account\nexpiration dates in shadow. It is not intended to be run directly from the\ncommand line and logs a security violation if done so.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"unix_chkpwd\" command is a helper program for the pam_unix module that\nverifies the password of the current user. It also checks password and account\nexpiration dates in shadow. It is not intended to be run directly from the\ncommand line and logs a security violation if done so.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof \"unix_chkpwd\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"unix_chkpwd\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"unix_chkpwd\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230433", + "rid": "SV-258206r627750_rule", + "stig_id": "RHEL-08-030317", + "fix_id": "F-33077r568046_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258207", + "code": "control 'SV-258207' do\n title 'Successful/unsuccessful uses of the unix_update in RHEL 8 must\ngenerate an audit record.'\n desc 'Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\n\"Unix_update\" is a helper program for the \"pam_unix\" module that updates\nthe password for a given user. It is not intended to be run directly from the\ncommand line and logs a security violation if done so.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"unix_update\" by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"unix_update\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/unix_update -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"unix_update\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/unix_update -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230426'\n tag rid: 'SV-258207r627750_rule'\n tag stig_id: 'RHEL-08-030310'\n tag fix_id: 'F-33070r568025_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/unix_update'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258207.rb" + }, + "title": "Successful/unsuccessful uses of the unix_update in RHEL 8 must\ngenerate an audit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\n\"Unix_update\" is a helper program for the \"pam_unix\" module that updates\nthe password for a given user. It is not intended to be run directly from the\ncommand line and logs a security violation if done so.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\n\"Unix_update\" is a helper program for the \"pam_unix\" module that updates\nthe password for a given user. It is not intended to be run directly from the\ncommand line and logs a security violation if done so.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"unix_update\" by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"unix_update\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/unix_update -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"unix_update\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/unix_update -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230426", + "rid": "SV-258207r627750_rule", + "stig_id": "RHEL-08-030310", + "fix_id": "F-33070r568025_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258208", + "code": "control 'SV-258208' do\n title 'Successful/unsuccessful uses of userhelper in RHEL 8 must generate an\naudit record.'\n desc %q(Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"userhelper\" command is not intended to be run interactively.\n\"Userhelper\" provides a basic interface to change a user's password, gecos\ninformation, and shell. The main difference between this program and its\ntraditional equivalents (passwd, chfn, chsh) is that prompts are written to\nstandard out to make it easy for a graphical user interface wrapper to\ninterface to it as a child process.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.)\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof \"userhelper\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"userhelper\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"userhelper\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230431'\n tag rid: 'SV-258208r627750_rule'\n tag stig_id: 'RHEL-08-030315'\n tag fix_id: 'F-33075r568040_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/userhelper'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258208.rb" + }, + "title": "Successful/unsuccessful uses of userhelper in RHEL 8 must generate an\naudit record.", + "desc": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"userhelper\" command is not intended to be run interactively.\n\"Userhelper\" provides a basic interface to change a user's password, gecos\ninformation, and shell. The main difference between this program and its\ntraditional equivalents (passwd, chfn, chsh) is that prompts are written to\nstandard out to make it easy for a graphical user interface wrapper to\ninterface to it as a child process.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Reconstruction of harmful events or forensic analysis is not possible\nif audit records do not contain enough information.\n\n At a minimum, the organization must audit the full-text recording of\nprivileged commands. The organization must maintain audit trails in sufficient\ndetail to reconstruct events to determine the cause and impact of compromise.\nThe \"userhelper\" command is not intended to be run interactively.\n\"Userhelper\" provides a basic interface to change a user's password, gecos\ninformation, and shell. The main difference between this program and its\ntraditional equivalents (passwd, chfn, chsh) is that prompts are written to\nstandard out to make it easy for a graphical user interface wrapper to\ninterface to it as a child process.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof \"userhelper\" by performing the following command to check the file system\nrules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w \"userhelper\" /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"userhelper\" by adding or updating the\nfollowing rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-unix-update\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230431", + "rid": "SV-258208r627750_rule", + "stig_id": "RHEL-08-030315", + "fix_id": "F-33075r568040_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258209", + "code": "control 'SV-258209' do\n title 'Successful/unsuccessful uses of the usermod command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"usermod\" command\nmodifies the system account files to reflect the changes that are specified on\nthe command line.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"usermod\" command by performing the following command to check the\nfile system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w usermod /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-usermod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"usermod\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-usermod\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-230463'\n tag rid: 'SV-258209r627750_rule'\n tag stig_id: 'RHEL-08-030560'\n tag fix_id: 'F-33107r568136_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/sbin/usermod'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258209.rb" + }, + "title": "Successful/unsuccessful uses of the usermod command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"usermod\" command\nmodifies the system account files to reflect the changes that are specified on\nthe command line.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"usermod\" command\nmodifies the system account files to reflect the changes that are specified on\nthe command line.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"usermod\" command by performing the following command to check the\nfile system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w usermod /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-usermod\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful uses of the \"usermod\" command by adding or updating\nthe following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-usermod\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000466-GPOS-00210" + ], + "gid": "V-230463", + "rid": "SV-258209r627750_rule", + "stig_id": "RHEL-08-030560", + "fix_id": "F-33107r568136_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258210", + "code": "control 'SV-258210' do\n title 'Successful/unsuccessful uses of the mount command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"mount\" command is\nused to mount a filesystem.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"mount\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w /usr/bin/mount /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"mount\" command by adding or updating the\nfollowing rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230423'\n tag rid: 'SV-258210r627750_rule'\n tag stig_id: 'RHEL-08-030300'\n tag fix_id: 'F-33067r568016_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/mount'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258210.rb" + }, + "title": "Successful/unsuccessful uses of the mount command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"mount\" command is\nused to mount a filesystem.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"mount\" command is\nused to mount a filesystem.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"mount\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w /usr/bin/mount /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"mount\" command by adding or updating the\nfollowing rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230423", + "rid": "SV-258210r627750_rule", + "stig_id": "RHEL-08-030300", + "fix_id": "F-33067r568016_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258211", + "code": "control 'SV-258211' do\n title 'Successful/unsuccessful uses of the init command in RHEL 9 must generate an audit record.'\n desc 'Misuse of the init command may cause availability issues for the system.'\n desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the \"init\" command with the following command:\n\n$ sudo auditctl -l | grep init\n\n-a always,exit -F path=/usr/sbin/init -F perm=x -F auid>=1000 -F auid!=unset -k privileged-init\n\nIf the command does not return a line, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"init\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/init -F perm=x -F auid>=1000 -F auid!=unset -k privileged-init\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61952r926618_chk'\n tag severity: 'medium'\n tag gid: 'V-258211'\n tag rid: 'SV-258211r926620_rule'\n tag stig_id: 'RHEL-09-654185'\n tag gtitle: 'SRG-OS-000477-GPOS-00222'\n tag fix_id: 'F-61876r926619_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258211.rb" + }, + "title": "Successful/unsuccessful uses of the init command in RHEL 9 must generate an audit record.", + "desc": "Misuse of the init command may cause availability issues for the system.", + "descriptions": { + "default": "Misuse of the init command may cause availability issues for the system.", + "check": "Verify that RHEL 9 is configured to audit the execution of the \"init\" command with the following command:\n\n$ sudo auditctl -l | grep init\n\n-a always,exit -F path=/usr/sbin/init -F perm=x -F auid>=1000 -F auid!=unset -k privileged-init\n\nIf the command does not return a line, or the line is commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"init\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/init -F perm=x -F auid>=1000 -F auid!=unset -k privileged-init\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61952r926618_chk", + "severity": "medium", + "gid": "V-258211", + "rid": "SV-258211r926620_rule", + "stig_id": "RHEL-09-654185", + "gtitle": "SRG-OS-000477-GPOS-00222", + "fix_id": "F-61876r926619_fix", + "documentable": null, + "cci": [ + "CCI-000172" + ], + "nist": [ + "AU-12 c" + ] + } + }, + { + "id": "SV-258212", + "code": "control 'SV-258212' do\n title 'Successful/unsuccessful uses of the poweroff command in RHEL 9 must generate an audit record.'\n desc 'Misuse of the poweroff command may cause availability issues for the system.'\n desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the \"poweroff\" command with the following command:\n\n$ sudo auditctl -l | grep poweroff\n\n-a always,exit -F path=/usr/sbin/poweroff -F perm=x -F auid>=1000 -F auid!=unset -k privileged-poweroff\n\nIf the command does not return a line, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"poweroff\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/poweroff -F perm=x -F auid>=1000 -F auid!=unset -k privileged-poweroff\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61953r926621_chk'\n tag severity: 'medium'\n tag gid: 'V-258212'\n tag rid: 'SV-258212r926623_rule'\n tag stig_id: 'RHEL-09-654190'\n tag gtitle: 'SRG-OS-000477-GPOS-00222'\n tag fix_id: 'F-61877r926622_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258212.rb" + }, + "title": "Successful/unsuccessful uses of the poweroff command in RHEL 9 must generate an audit record.", + "desc": "Misuse of the poweroff command may cause availability issues for the system.", + "descriptions": { + "default": "Misuse of the poweroff command may cause availability issues for the system.", + "check": "Verify that RHEL 9 is configured to audit the execution of the \"poweroff\" command with the following command:\n\n$ sudo auditctl -l | grep poweroff\n\n-a always,exit -F path=/usr/sbin/poweroff -F perm=x -F auid>=1000 -F auid!=unset -k privileged-poweroff\n\nIf the command does not return a line, or the line is commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"poweroff\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/poweroff -F perm=x -F auid>=1000 -F auid!=unset -k privileged-poweroff\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61953r926621_chk", + "severity": "medium", + "gid": "V-258212", + "rid": "SV-258212r926623_rule", + "stig_id": "RHEL-09-654190", + "gtitle": "SRG-OS-000477-GPOS-00222", + "fix_id": "F-61877r926622_fix", + "documentable": null, + "cci": [ + "CCI-000172" + ], + "nist": [ + "AU-12 c" + ] + } + }, + { + "id": "SV-258213", + "code": "control 'SV-258213' do\n title 'Successful/unsuccessful uses of the reboot command in RHEL 9 must generate an audit record.'\n desc 'Misuse of the reboot command may cause availability issues for the system.'\n desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the \"reboot\" command with the following command:\n\n$ sudo auditctl -l | grep reboot\n\n-a always,exit -F path=/usr/sbin/reboot -F perm=x -F auid>=1000 -F auid!=unset -k privileged-reboot\n\nIf the command does not return a line, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"reboot\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/reboot -F perm=x -F auid>=1000 -F auid!=unset -k privileged-reboot\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61954r926624_chk'\n tag severity: 'medium'\n tag gid: 'V-258213'\n tag rid: 'SV-258213r926626_rule'\n tag stig_id: 'RHEL-09-654195'\n tag gtitle: 'SRG-OS-000477-GPOS-00222'\n tag fix_id: 'F-61878r926625_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258213.rb" + }, + "title": "Successful/unsuccessful uses of the reboot command in RHEL 9 must generate an audit record.", + "desc": "Misuse of the reboot command may cause availability issues for the system.", + "descriptions": { + "default": "Misuse of the reboot command may cause availability issues for the system.", + "check": "Verify that RHEL 9 is configured to audit the execution of the \"reboot\" command with the following command:\n\n$ sudo auditctl -l | grep reboot\n\n-a always,exit -F path=/usr/sbin/reboot -F perm=x -F auid>=1000 -F auid!=unset -k privileged-reboot\n\nIf the command does not return a line, or the line is commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"reboot\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/reboot -F perm=x -F auid>=1000 -F auid!=unset -k privileged-reboot\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61954r926624_chk", + "severity": "medium", + "gid": "V-258213", + "rid": "SV-258213r926626_rule", + "stig_id": "RHEL-09-654195", + "gtitle": "SRG-OS-000477-GPOS-00222", + "fix_id": "F-61878r926625_fix", + "documentable": null, + "cci": [ + "CCI-000172" + ], + "nist": [ + "AU-12 c" + ] + } + }, + { + "id": "SV-258214", + "code": "control 'SV-258214' do\n title 'Successful/unsuccessful uses of the shutdown command in RHEL 9 must generate an audit record.'\n desc 'Misuse of the shutdown command may cause availability issues for the system.'\n desc 'check', 'Verify that RHEL 9 is configured to audit the execution of the \"shutdown\" command with the following command:\n\n$ sudo auditctl -l | grep shutdown\n\n-a always,exit -F path=/usr/sbin/shutdown -F perm=x -F auid>=1000 -F auid!=unset -k privileged-shutdown\n\nIf the command does not return a line, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"shutdown\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/shutdown -F perm=x -F auid>=1000 -F auid!=unset -k privileged-shutdown\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61955r926627_chk'\n tag severity: 'medium'\n tag gid: 'V-258214'\n tag rid: 'SV-258214r926629_rule'\n tag stig_id: 'RHEL-09-654200'\n tag gtitle: 'SRG-OS-000477-GPOS-00222'\n tag fix_id: 'F-61879r926628_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258214.rb" + }, + "title": "Successful/unsuccessful uses of the shutdown command in RHEL 9 must generate an audit record.", + "desc": "Misuse of the shutdown command may cause availability issues for the system.", + "descriptions": { + "default": "Misuse of the shutdown command may cause availability issues for the system.", + "check": "Verify that RHEL 9 is configured to audit the execution of the \"shutdown\" command with the following command:\n\n$ sudo auditctl -l | grep shutdown\n\n-a always,exit -F path=/usr/sbin/shutdown -F perm=x -F auid>=1000 -F auid!=unset -k privileged-shutdown\n\nIf the command does not return a line, or the line is commented out, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"shutdown\" command by adding or updating the following rule in the \"/etc/audit/rules.d/audit.rules\" file:\n\n-a always,exit -F path=/usr/sbin/shutdown -F perm=x -F auid>=1000 -F auid!=unset -k privileged-shutdown\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61955r926627_chk", + "severity": "medium", + "gid": "V-258214", + "rid": "SV-258214r926629_rule", + "stig_id": "RHEL-09-654200", + "gtitle": "SRG-OS-000477-GPOS-00222", + "fix_id": "F-61879r926628_fix", + "documentable": null, + "cci": [ + "CCI-000172" + ], + "nist": [ + "AU-12 c" + ] + } + }, + { + "id": "SV-258215", + "code": "control 'SV-258215' do\n title 'Successful/unsuccessful uses of the umount command in RHEL 8 must\ngenerate an audit record.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"umount\" command is\nused to unmount a filesystem.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use\nof the \"umount\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w /usr/bin/umount /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"umount\" command by adding or updating the\nfollowing rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-230424'\n tag rid: 'SV-258215r627750_rule'\n tag stig_id: 'RHEL-08-030301'\n tag fix_id: 'F-33068r568019_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/usr/bin/umount'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258215.rb" + }, + "title": "Successful/unsuccessful uses of the umount command in RHEL 8 must\ngenerate an audit record.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"umount\" command is\nused to unmount a filesystem.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter). The \"umount\" command is\nused to unmount a filesystem.\n\n When a user logs on, the AUID is set to the UID of the account that is\nbeing authenticated. Daemons are not user sessions and have the loginuid set to\n\"-1\". The AUID representation is an unsigned 32-bit integer, which equals\n\"4294967295\". The audit system interprets \"-1\", \"4294967295\", and\n\"unset\" in the same way.", + "check": "Verify that an audit event is generated for any successful/unsuccessful use\nof the \"umount\" command by performing the following command to check the file\nsystem rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w /usr/bin/umount /etc/audit/audit.rules\n\n -a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful use of the \"umount\" command by adding or updating the\nfollowing rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F\nauid!=unset -k privileged-mount\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "gid": "V-230424", + "rid": "SV-258215r627750_rule", + "stig_id": "RHEL-08-030301", + "fix_id": "F-33068r568019_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258216", + "code": "control 'SV-258216' do\n title 'Successful/unsuccessful uses of the umount2 system call in RHEL 9 must generate an audit record.'\n desc 'The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.\n\n'\n desc 'check', 'To determine if the system is configured to audit calls to the umount2 system call, run the following command:\n\n$ sudo grep \"umount2\" /etc/audit/audit.* \n\nIf the system is configured to audit this activity, it will return a line.\n\nIf no line is returned, this is a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"umount2\" system call by adding or updating the following rules in \"/etc/audit/audit.rules\" and adding the following rules to \"/etc/audit/rules.d/perm_mod.rules\" or updating the existing rules in files in the \"/etc/audit/rules.d/\" directory:\n\n-a always,exit -F arch=b32 -S umount2 -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S umount2 -F auid>=1000 -F auid!=unset -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61957r926633_chk'\n tag severity: 'medium'\n tag gid: 'V-258216'\n tag rid: 'SV-258216r926635_rule'\n tag stig_id: 'RHEL-09-654210'\n tag gtitle: 'SRG-OS-000037-GPOS-00015'\n tag fix_id: 'F-61881r926634_fix'\n tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag 'documentable'\n tag cci: ['CCI-000130', 'CCI-000169', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-3 a', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258216.rb" + }, + "title": "Successful/unsuccessful uses of the umount2 system call in RHEL 9 must generate an audit record.", + "desc": "The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.\n\n", + "descriptions": { + "default": "The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users.\n\n", + "check": "To determine if the system is configured to audit calls to the umount2 system call, run the following command:\n\n$ sudo grep \"umount2\" /etc/audit/audit.* \n\nIf the system is configured to audit this activity, it will return a line.\n\nIf no line is returned, this is a finding.", + "fix": "Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"umount2\" system call by adding or updating the following rules in \"/etc/audit/audit.rules\" and adding the following rules to \"/etc/audit/rules.d/perm_mod.rules\" or updating the existing rules in files in the \"/etc/audit/rules.d/\" directory:\n\n-a always,exit -F arch=b32 -S umount2 -F auid>=1000 -F auid!=unset -k perm_mod\n-a always,exit -F arch=b64 -S umount2 -F auid>=1000 -F auid!=unset -k perm_mod\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61957r926633_chk", + "severity": "medium", + "gid": "V-258216", + "rid": "SV-258216r926635_rule", + "stig_id": "RHEL-09-654210", + "gtitle": "SRG-OS-000037-GPOS-00015", + "fix_id": "F-61881r926634_fix", + "satisfies": [ + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215" + ], + "documentable": null, + "cci": [ + "CCI-000130", + "CCI-000169", + "CCI-000172", + "CCI-002884" + ], + "nist": [ + "AU-3 a", + "AU-12 a", + "AU-12 c", + "MA-4 (1) (a)" + ] + } + }, + { + "id": "SV-258217", + "code": "control 'SV-258217' do\n title 'RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/sudoers.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).'\n desc 'check', 'Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/sudoers\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/sudoers /etc/audit/audit.rules\n\n -w /etc/sudoers -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/sudoers\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/sudoers -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000304-GPOS-00121', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-230409'\n tag rid: 'SV-258217r627750_rule'\n tag stig_id: 'RHEL-08-030171'\n tag fix_id: 'F-33053r567974_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/sudoers'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258217.rb" + }, + "title": "RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/sudoers.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "check": "Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/sudoers\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/sudoers /etc/audit/audit.rules\n\n -w /etc/sudoers -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/sudoers\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/sudoers -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000004-GPOS-00004", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000239-GPOS-00089", + "SRG-OS-000240-GPOS-00090", + "SRG-OS-000241-GPOS-00091", + "SRG-OS-000303-GPOS-00120", + "SRG-OS-000304-GPOS-00121", + "CCI-002884", + "SRG-OS-000466-GPOS-00210", + "SRG-OS-000476-GPOS-00221" + ], + "gid": "V-230409", + "rid": "SV-258217r627750_rule", + "stig_id": "RHEL-08-030171", + "fix_id": "F-33053r567974_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258218", + "code": "control 'SV-258218' do\n title 'RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/sudoers.d/.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).'\n desc 'check', 'Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/sudoers.d/\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/sudoers.d/ /etc/audit/audit.rules\n\n -w /etc/sudoers.d/ -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/sudoers.d/\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/sudoers.d/ -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000304-GPOS-00121', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-230410'\n tag rid: 'SV-258218r627750_rule'\n tag stig_id: 'RHEL-08-030172'\n tag fix_id: 'F-33054r567977_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/sudoers.d'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258218.rb" + }, + "title": "RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/sudoers.d/.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "check": "Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/sudoers.d/\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/sudoers.d/ /etc/audit/audit.rules\n\n -w /etc/sudoers.d/ -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/sudoers.d/\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/sudoers.d/ -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000004-GPOS-00004", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000239-GPOS-00089", + "SRG-OS-000240-GPOS-00090", + "SRG-OS-000241-GPOS-00091", + "SRG-OS-000303-GPOS-00120", + "SRG-OS-000304-GPOS-00121", + "CCI-002884", + "SRG-OS-000466-GPOS-00210", + "SRG-OS-000476-GPOS-00221" + ], + "gid": "V-230410", + "rid": "SV-258218r627750_rule", + "stig_id": "RHEL-08-030172", + "fix_id": "F-33054r567977_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258219", + "code": "control 'SV-258219' do\n title 'RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/group.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).'\n desc 'check', 'Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/group\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/group /etc/audit/audit.rules\n\n -w /etc/group -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/group\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/group -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000304-GPOS-00121', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-230408'\n tag rid: 'SV-258219r627750_rule'\n tag stig_id: 'RHEL-08-030170'\n tag fix_id: 'F-33052r567971_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/group'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258219.rb" + }, + "title": "RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/group.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "check": "Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/group\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/group /etc/audit/audit.rules\n\n -w /etc/group -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/group\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/group -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000004-GPOS-00004", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000239-GPOS-00089", + "SRG-OS-000240-GPOS-00090", + "SRG-OS-000241-GPOS-00091", + "SRG-OS-000303-GPOS-00120", + "SRG-OS-000304-GPOS-00121", + "CCI-002884", + "SRG-OS-000466-GPOS-00210", + "SRG-OS-000476-GPOS-00221" + ], + "gid": "V-230408", + "rid": "SV-258219r627750_rule", + "stig_id": "RHEL-08-030170", + "fix_id": "F-33052r567971_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258220", + "code": "control 'SV-258220' do\n title 'RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/gshadow.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).'\n desc 'check', 'Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/gshadow\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/gshadow /etc/audit/audit.rules\n\n -w /etc/gshadow -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/gshadow\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/gshadow -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-230407'\n tag rid: 'SV-258220r627750_rule'\n tag stig_id: 'RHEL-08-030160'\n tag fix_id: 'F-33051r567968_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/gshadow'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258220.rb" + }, + "title": "RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/gshadow.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "check": "Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/gshadow\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/gshadow /etc/audit/audit.rules\n\n -w /etc/gshadow -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/gshadow\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/gshadow -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000004-GPOS-00004", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000239-GPOS-00089", + "SRG-OS-000240-GPOS-00090", + "SRG-OS-000241-GPOS-00091", + "SRG-OS-000303-GPOS-00120", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000466-GPOS-00210", + "SRG-OS-000476-GPOS-00221" + ], + "gid": "V-230407", + "rid": "SV-258220r627750_rule", + "stig_id": "RHEL-08-030160", + "fix_id": "F-33051r567968_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258221", + "code": "control 'SV-258221' do\n title 'RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect\n/etc/security/opasswd.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).'\n desc 'check', 'Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/security/opasswd\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/security/opasswd /etc/audit/audit.rules\n\n -w /etc/security/opasswd -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/security/opasswd\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/security/opasswd -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-230405'\n tag rid: 'SV-258221r627750_rule'\n tag stig_id: 'RHEL-08-030140'\n tag fix_id: 'F-33049r567962_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/security/opasswd'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258221.rb" + }, + "title": "RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect\n/etc/security/opasswd.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "check": "Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/security/opasswd\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/security/opasswd /etc/audit/audit.rules\n\n -w /etc/security/opasswd -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect\n\"/etc/security/opasswd\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/security/opasswd -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000004-GPOS-00004", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000239-GPOS-00089", + "SRG-OS-000240-GPOS-00090", + "SRG-OS-000241-GPOS-00091", + "SRG-OS-000303-GPOS-00120", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000476-GPOS-00221" + ], + "gid": "V-230405", + "rid": "SV-258221r627750_rule", + "stig_id": "RHEL-08-030140", + "fix_id": "F-33049r567962_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258222", + "code": "control 'SV-258222' do\n title 'RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/passwd.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).'\n desc 'check', 'Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/passwd\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/passwd /etc/audit/audit.rules\n\n -w /etc/passwd -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/passwd\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/passwd -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-230406'\n tag rid: 'SV-258222r627750_rule'\n tag stig_id: 'RHEL-08-030150'\n tag fix_id: 'F-33050r567965_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/passwd'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258222.rb" + }, + "title": "RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/passwd.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "check": "Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/passwd\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/passwd /etc/audit/audit.rules\n\n -w /etc/passwd -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/passwd\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/passwd -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000004-GPOS-00004", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000239-GPOS-00089", + "SRG-OS-000240-GPOS-00090", + "SRG-OS-000241-GPOS-00091", + "SRG-OS-000303-GPOS-00120", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000466-GPOS-00210", + "SRG-OS-000476-GPOS-00221" + ], + "gid": "V-230406", + "rid": "SV-258222r627750_rule", + "stig_id": "RHEL-08-030150", + "fix_id": "F-33050r567965_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258223", + "code": "control 'SV-258223' do\n title 'RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/shadow.'\n desc 'Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).'\n desc 'check', 'Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/shadow\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/shadow /etc/audit/audit.rules\n\n -w /etc/shadow -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/shadow\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/shadow -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-230404'\n tag rid: 'SV-258223r627750_rule'\n tag stig_id: 'RHEL-08-030130'\n tag fix_id: 'F-33048r567959_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/shadow'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258223.rb" + }, + "title": "RHEL 8 must generate audit records for all account creations,\nmodifications, disabling, and termination events that affect /etc/shadow.", + "desc": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "descriptions": { + "default": "Without generating audit records that are specific to the security and\nmission needs of the organization, it would be difficult to establish,\ncorrelate, and investigate the events relating to an incident or identify those\nresponsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).", + "check": "Verify RHEL 8 generates audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/shadow\".\n\n Check the auditing rules in \"/etc/audit/audit.rules\" with the following\ncommand:\n\n $ sudo grep /etc/shadow /etc/audit/audit.rules\n\n -w /etc/shadow -p wa -k identity\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure RHEL 8 to generate audit records for all account creations,\nmodifications, disabling, and termination events that affect \"/etc/shadow\".\n\n Add or update the following file system rule to\n\"/etc/audit/rules.d/audit.rules\":\n\n -w /etc/shadow -p wa -k identity\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000004-GPOS-00004", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000239-GPOS-00089", + "SRG-OS-000240-GPOS-00090", + "SRG-OS-000241-GPOS-00091", + "SRG-OS-000303-GPOS-00120", + "SRG-OS-000304-GPOS-00121", + "SRG-OS-000466-GPOS-00210", + "SRG-OS-000476-GPOS-00221" + ], + "gid": "V-230404", + "rid": "SV-258223r627750_rule", + "stig_id": "RHEL-08-030130", + "fix_id": "F-33048r567959_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258224", + "code": "control 'SV-258224' do\n title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/faillock.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\n'\n desc 'check', 'Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/faillock\" with the following command:\n\n$ sudo auditctl -l | grep /var/log/faillock\n\n-w /var/log/faillock -p wa -k logins\n\nIf the command does not return a line, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/faillock\".\n\nAdd or update the following file system rule to \"/etc/audit/rules.d/audit.rules\":\n\n-w /var/log/faillock -p wa -k logins\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61965r926657_chk'\n tag severity: 'medium'\n tag gid: 'V-258224'\n tag rid: 'SV-258224r926659_rule'\n tag stig_id: 'RHEL-09-654250'\n tag gtitle: 'SRG-OS-000392-GPOS-00172'\n tag fix_id: 'F-61889r926658_fix'\n tag satisfies: ['SRG-OS-000392-GPOS-00172', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000473-GPOS-00218']\n tag 'documentable'\n tag cci: ['CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 c', 'MA-4 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258224.rb" + }, + "title": "RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/faillock.", + "desc": "Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\n", + "descriptions": { + "default": "Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\n", + "check": "Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/faillock\" with the following command:\n\n$ sudo auditctl -l | grep /var/log/faillock\n\n-w /var/log/faillock -p wa -k logins\n\nIf the command does not return a line, or the line is commented out, this is a finding.", + "fix": "Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/faillock\".\n\nAdd or update the following file system rule to \"/etc/audit/rules.d/audit.rules\":\n\n-w /var/log/faillock -p wa -k logins\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61965r926657_chk", + "severity": "medium", + "gid": "V-258224", + "rid": "SV-258224r926659_rule", + "stig_id": "RHEL-09-654250", + "gtitle": "SRG-OS-000392-GPOS-00172", + "fix_id": "F-61889r926658_fix", + "satisfies": [ + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000473-GPOS-00218" + ], + "documentable": null, + "cci": [ + "CCI-000172", + "CCI-002884" + ], + "nist": [ + "AU-12 c", + "MA-4 (1) (a)" + ] + } + }, + { + "id": "SV-258225", + "code": "control 'SV-258225' do\n title 'Successful/unsuccessful modifications to the lastlog file in RHEL 8\nmust generate an audit record.'\n desc 'Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.'\n desc 'check', 'Verify RHEL 8 generates an audit record when successful/unsuccessful\nmodifications to the \"lastlog\" file by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w lastlog /etc/audit/audit.rules\n\n -w /var/log/lastlog -p wa -k logins\n\n If the command does not return a line, or the line is commented out, this\nis a finding.'\n desc 'fix', 'Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful modifications to the \"lastlog\" file by adding or\nupdating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -w /var/log/lastlog -p wa -k logins\n\n The audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000062-GPOS-00031'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218']\n tag gid: 'V-230467'\n tag rid: 'SV-258225r627750_rule'\n tag stig_id: 'RHEL-08-030600'\n tag fix_id: 'F-33111r568148_fix'\n tag cci: ['CCI-000169']\n tag nist: ['AU-12 a']\n tag 'host'\n\n audit_command = '/var/log/lastlog'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258225.rb" + }, + "title": "Successful/unsuccessful modifications to the lastlog file in RHEL 8\nmust generate an audit record.", + "desc": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "descriptions": { + "default": "Without the capability to generate audit records, it would be\ndifficult to establish, correlate, and investigate the events relating to an\nincident or identify those responsible for one.\n\n Audit records can be generated from various components within the\ninformation system (e.g., module or policy filter).\n\n The list of audited events is the set of events for which audits are to be\ngenerated. This set of events is typically a subset of the list of all events\nfor which the system is capable of generating audit records.\n\n DoD has defined the list of events for which RHEL 8 will provide an audit\nrecord generation capability as the following:\n\n 1) Successful and unsuccessful attempts to access, modify, or delete\nprivileges, security objects, security levels, or categories of information\n(e.g., classification levels);\n\n 2) Access actions, such as successful and unsuccessful logon attempts,\nprivileged activities or other system-level access, starting and ending time\nfor user access to the system, concurrent logons from different workstations,\nsuccessful and unsuccessful accesses to objects, all program initiations, and\nall direct access to the information system;\n\n 3) All account creations, modifications, disabling, and terminations; and\n\n 4) All kernel module load, unload, and restart actions.", + "check": "Verify RHEL 8 generates an audit record when successful/unsuccessful\nmodifications to the \"lastlog\" file by performing the following command to\ncheck the file system rules in \"/etc/audit/audit.rules\":\n\n $ sudo grep -w lastlog /etc/audit/audit.rules\n\n -w /var/log/lastlog -p wa -k logins\n\n If the command does not return a line, or the line is commented out, this\nis a finding.", + "fix": "Configure the audit system to generate an audit event for any\nsuccessful/unsuccessful modifications to the \"lastlog\" file by adding or\nupdating the following rules in the \"/etc/audit/rules.d/audit.rules\" file:\n\n -w /var/log/lastlog -p wa -k logins\n\n The audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000062-GPOS-00031", + "satisfies": [ + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000037-GPOS-00015", + "SRG-OS-000042-GPOS-00020", + "SRG-OS-000062-GPOS-00031", + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000462-GPOS-00206", + "SRG-OS-000471-GPOS-00215", + "SRG-OS-000473-GPOS-00218" + ], + "gid": "V-230467", + "rid": "SV-258225r627750_rule", + "stig_id": "RHEL-08-030600", + "fix_id": "F-33111r568148_fix", + "cci": [ + "CCI-000169" + ], + "nist": [ + "AU-12 a" + ], + "host": null + } + }, + { + "id": "SV-258226", + "code": "control 'SV-258226' do\n title 'RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/tallylog.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\n'\n desc 'check', 'Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/tallylog\" with the following command:\n\n$ sudo auditctl -l | grep /var/log/tallylog\n\n-w /var/log/tallylog -p wa -k logins\n\nIf the command does not return a line, or the line is commented out, is a finding.'\n desc 'fix', 'Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/tallylog\".\n\nAdd or update the following file system rule to \"/etc/audit/rules.d/audit.rules\":\n\n-w /var/log/tallylog -p wa -k logins\n\nThe audit daemon must be restarted for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61967r926663_chk'\n tag severity: 'medium'\n tag gid: 'V-258226'\n tag rid: 'SV-258226r926665_rule'\n tag stig_id: 'RHEL-09-654260'\n tag gtitle: 'SRG-OS-000392-GPOS-00172'\n tag fix_id: 'F-61891r926664_fix'\n tag satisfies: ['SRG-OS-000392-GPOS-00172', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000473-GPOS-00218']\n tag 'documentable'\n tag cci: ['CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 c', 'MA-4 (1) (a)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258226.rb" + }, + "title": "RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/tallylog.", + "desc": "Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\n", + "descriptions": { + "default": "Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\n\n", + "check": "Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/tallylog\" with the following command:\n\n$ sudo auditctl -l | grep /var/log/tallylog\n\n-w /var/log/tallylog -p wa -k logins\n\nIf the command does not return a line, or the line is commented out, is a finding.", + "fix": "Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/var/log/tallylog\".\n\nAdd or update the following file system rule to \"/etc/audit/rules.d/audit.rules\":\n\n-w /var/log/tallylog -p wa -k logins\n\nThe audit daemon must be restarted for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61967r926663_chk", + "severity": "medium", + "gid": "V-258226", + "rid": "SV-258226r926665_rule", + "stig_id": "RHEL-09-654260", + "gtitle": "SRG-OS-000392-GPOS-00172", + "fix_id": "F-61891r926664_fix", + "satisfies": [ + "SRG-OS-000392-GPOS-00172", + "SRG-OS-000470-GPOS-00214", + "SRG-OS-000473-GPOS-00218" + ], + "documentable": null, + "cci": [ + "CCI-000172", + "CCI-002884" + ], + "nist": [ + "AU-12 c", + "MA-4 (1) (a)" + ] + } + }, + { + "id": "SV-258227", + "code": "control 'SV-258227' do\n title 'RHEL 9 must take appropriate action when a critical audit processing failure occurs.'\n desc 'It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected.\n\nAudit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.\n\n'\n desc 'check', 'Verify the audit service is configured to panic on a critical error with the following command:\n\n$ sudo grep \"\\\\-f\" /etc/audit/audit.rules \n\n-f 2\n\nIf the value for \"-f\" is not \"2\", and availability is not documented as an overriding concern, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to shut down when auditing failures occur.\n\nAdd the following line to the bottom of the /etc/audit/audit.rules file:\n\n-f 2'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61968r926666_chk'\n tag severity: 'medium'\n tag gid: 'V-258227'\n tag rid: 'SV-258227r926668_rule'\n tag stig_id: 'RHEL-09-654265'\n tag gtitle: 'SRG-OS-000046-GPOS-00022'\n tag fix_id: 'F-61892r926667_fix'\n tag satisfies: ['SRG-OS-000046-GPOS-00022', 'SRG-OS-000047-GPOS-00023']\n tag 'documentable'\n tag cci: ['CCI-000139', 'CCI-000140']\n tag nist: ['AU-5 a', 'AU-5 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258227.rb" + }, + "title": "RHEL 9 must take appropriate action when a critical audit processing failure occurs.", + "desc": "It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected.\n\nAudit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.\n\n", + "descriptions": { + "default": "It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected.\n\nAudit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.\n\n", + "check": "Verify the audit service is configured to panic on a critical error with the following command:\n\n$ sudo grep \"\\-f\" /etc/audit/audit.rules \n\n-f 2\n\nIf the value for \"-f\" is not \"2\", and availability is not documented as an overriding concern, this is a finding.", + "fix": "Configure RHEL 9 to shut down when auditing failures occur.\n\nAdd the following line to the bottom of the /etc/audit/audit.rules file:\n\n-f 2" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61968r926666_chk", + "severity": "medium", + "gid": "V-258227", + "rid": "SV-258227r926668_rule", + "stig_id": "RHEL-09-654265", + "gtitle": "SRG-OS-000046-GPOS-00022", + "fix_id": "F-61892r926667_fix", + "satisfies": [ + "SRG-OS-000046-GPOS-00022", + "SRG-OS-000047-GPOS-00023" + ], + "documentable": null, + "cci": [ + "CCI-000139", + "CCI-000140" + ], + "nist": [ + "AU-5 a", + "AU-5 b" + ] + } + }, + { + "id": "SV-258228", + "code": "control 'SV-258228' do\n title 'RHEL 8 audit system must protect logon UIDs from unauthorized change.'\n desc 'Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 system activity.\n\n In immutable mode, unauthorized users cannot execute changes to the audit\nsystem to potentially hide malicious activity and then put the audit rules\nback. A system reboot would be noticeable and a system administrator could\nthen investigate the unauthorized changes.'\n desc 'check', 'Verify the audit system prevents unauthorized changes to logon UIDs with\nthe following command:\n\n $ sudo grep -i immutable /etc/audit/audit.rules\n\n --loginuid-immutable\n\n If the login UIDs are not set to be immutable by adding the\n\"--loginuid-immutable\" option to the \"/etc/audit/audit.rules\", this is a\nfinding.'\n desc 'fix', 'Configure the audit system to set the logon UIDs to be immutable by adding\nthe following line to \"/etc/audit/rules.d/audit.rules\"\n\n --loginuid-immutable'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029']\n tag gid: 'V-230403'\n tag rid: 'SV-258228r627750_rule'\n tag stig_id: 'RHEL-08-030122'\n tag fix_id: 'F-33047r567956_fix'\n tag cci: ['CCI-000162']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe command('grep -i immutable /etc/audit/audit.rules') do\n its('stdout.strip') { should cmp '--loginuid-immutable' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258228.rb" + }, + "title": "RHEL 8 audit system must protect logon UIDs from unauthorized change.", + "desc": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 system activity.\n\n In immutable mode, unauthorized users cannot execute changes to the audit\nsystem to potentially hide malicious activity and then put the audit rules\nback. A system reboot would be noticeable and a system administrator could\nthen investigate the unauthorized changes.", + "descriptions": { + "default": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 system activity.\n\n In immutable mode, unauthorized users cannot execute changes to the audit\nsystem to potentially hide malicious activity and then put the audit rules\nback. A system reboot would be noticeable and a system administrator could\nthen investigate the unauthorized changes.", + "check": "Verify the audit system prevents unauthorized changes to logon UIDs with\nthe following command:\n\n $ sudo grep -i immutable /etc/audit/audit.rules\n\n --loginuid-immutable\n\n If the login UIDs are not set to be immutable by adding the\n\"--loginuid-immutable\" option to the \"/etc/audit/audit.rules\", this is a\nfinding.", + "fix": "Configure the audit system to set the logon UIDs to be immutable by adding\nthe following line to \"/etc/audit/rules.d/audit.rules\"\n\n --loginuid-immutable" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000057-GPOS-00027", + "satisfies": [ + "SRG-OS-000057-GPOS-00027", + "SRG-OS-000058-GPOS-00028", + "SRG-OS-000059-GPOS-00029" + ], + "gid": "V-230403", + "rid": "SV-258228r627750_rule", + "stig_id": "RHEL-08-030122", + "fix_id": "F-33047r567956_fix", + "cci": [ + "CCI-000162" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-258229", + "code": "control 'SV-258229' do\n title 'RHEL 8 audit system must protect auditing rules from unauthorized\nchange.'\n desc 'Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 system activity.\n\n In immutable mode, unauthorized users cannot execute changes to the audit\nsystem to potentially hide malicious activity and then put the audit rules\nback. A system reboot would be noticeable and a system administrator could\nthen investigate the unauthorized changes.'\n desc 'check', 'Verify the audit system prevents unauthorized changes with the following\ncommand:\n\n $ sudo grep \"^\\\\s*[^#]\" /etc/audit/audit.rules | tail -1\n\n -e 2\n\n If the audit system is not set to be immutable by adding the \"-e 2\"\noption to the \"/etc/audit/audit.rules\", this is a finding.'\n desc 'fix', 'Configure the audit system to set the audit rules to be immutable by adding\nthe following line to \"/etc/audit/rules.d/audit.rules\"\n\n -e 2\n\n Note: Once set, the system must be rebooted for auditing to be changed. It\nis recommended to add this option as the last step in securing the system.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029']\n tag gid: 'V-230402'\n tag rid: 'SV-258229r627750_rule'\n tag stig_id: 'RHEL-08-030121'\n tag fix_id: 'F-33046r567953_fix'\n tag cci: ['CCI-000162']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe command('grep \"^\\s*[^#]\" /etc/audit/audit.rules | tail -1') do\n its('stdout.strip') { should cmp '-e 2' }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258229.rb" + }, + "title": "RHEL 8 audit system must protect auditing rules from unauthorized\nchange.", + "desc": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 system activity.\n\n In immutable mode, unauthorized users cannot execute changes to the audit\nsystem to potentially hide malicious activity and then put the audit rules\nback. A system reboot would be noticeable and a system administrator could\nthen investigate the unauthorized changes.", + "descriptions": { + "default": "Unauthorized disclosure of audit records can reveal system and\nconfiguration data to attackers, thus compromising its confidentiality.\n\n Audit information includes all information (e.g., audit records, audit\nsettings, audit reports) needed to successfully audit RHEL 8 system activity.\n\n In immutable mode, unauthorized users cannot execute changes to the audit\nsystem to potentially hide malicious activity and then put the audit rules\nback. A system reboot would be noticeable and a system administrator could\nthen investigate the unauthorized changes.", + "check": "Verify the audit system prevents unauthorized changes with the following\ncommand:\n\n $ sudo grep \"^\\s*[^#]\" /etc/audit/audit.rules | tail -1\n\n -e 2\n\n If the audit system is not set to be immutable by adding the \"-e 2\"\noption to the \"/etc/audit/audit.rules\", this is a finding.", + "fix": "Configure the audit system to set the audit rules to be immutable by adding\nthe following line to \"/etc/audit/rules.d/audit.rules\"\n\n -e 2\n\n Note: Once set, the system must be rebooted for auditing to be changed. It\nis recommended to add this option as the last step in securing the system." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000057-GPOS-00027", + "satisfies": [ + "SRG-OS-000057-GPOS-00027", + "SRG-OS-000058-GPOS-00028", + "SRG-OS-000059-GPOS-00029" + ], + "gid": "V-230402", + "rid": "SV-258229r627750_rule", + "stig_id": "RHEL-08-030121", + "fix_id": "F-33046r567953_fix", + "cci": [ + "CCI-000162" + ], + "nist": [ + "AU-9", + "AU-9 a" + ], + "host": null + } + }, + { + "id": "SV-258230", + "code": "control 'SV-258230' do\n title 'RHEL 8 must implement NIST FIPS-validated cryptography for the following: To provision digital signatures, to generate cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.'\n desc 'Use of weak or untested encryption algorithms undermines the purposes of using encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.\n\nRHEL 8 utilizes GRUB 2 as the default bootloader. Note that GRUB 2 command-line parameters are defined in the \"kernelopts\" variable of the /boot/grub2/grubenv file for all kernel boot entries. The command \"fips-mode-setup\" modifies the \"kernelopts\" variable, which in turn updates all kernel boot entries.\n\nThe fips=1 kernel option needs to be added to the kernel command line during system installation so that key generation is done with FIPS-approved algorithms and continuous monitoring tests in place. Users must also ensure the system has plenty of entropy during the installation process by moving the mouse around, or if no mouse is available, ensuring that many keystrokes are typed. The recommended amount of keystrokes is 256 and more. Less than 256 keystrokes may generate a nonunique key.'\n desc 'check', 'Verify the operating system implements DOD-approved encryption to protect the confidentiality of remote access sessions.\n\nCheck to see if FIPS mode is enabled with the following command:\n\n $ fips-mode-setup --check\n FIPS mode is enabled\n\nIf FIPS mode is \"enabled\", check to see if the kernel boot parameter is configured for FIPS mode with the following command:\n\n $ sudo grub2-editenv list | grep fips\n kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the kernel boot parameter is configured to use FIPS mode, check to see if the system is in FIPS mode with the following command:\n\n $ sudo cat /proc/sys/crypto/fips_enabled\n 1\n\nIf FIPS mode is not \"on\", the kernel boot parameter is not configured for FIPS mode, or the system does not have a value of \"1\" for \"fips_enabled\" in \"/proc/sys/crypto\", this is a finding.'\n desc 'fix', 'Configure the operating system to implement DOD-approved encryption by following the steps below:\n\nTo enable strict FIPS compliance, the fips=1 kernel option needs to be added to the kernel boot parameters during system installation so key generation is done with FIPS-approved algorithms and continuous monitoring tests in place.\n\nEnable FIPS mode after installation (not strict FIPS-compliant) with the following command:\n\n $ sudo fips-mode-setup --enable\n\nReboot the system for the changes to take effect.'\n impact 0.7\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000033-GPOS-00014'\n tag satisfies: ['SRG-OS-000033-GPOS-00014', 'SRG-OS-000125-GPOS-00065', 'SRG-OS-000396-GPOS-00176', 'SRG-OS-000423-GPOS-00187', 'SRG-OS-000478-GPOS-00223']\n tag gid: 'V-230223'\n tag rid: 'SV-258230r928585_rule'\n tag stig_id: 'RHEL-08-010020'\n tag fix_id: 'F-32867r928584_fix'\n tag cci: ['CCI-000068']\n tag nist: ['AC-17 (2)']\n tag 'host'\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable in a container' do\n skip 'The host OS controls the FIPS mode settings. The host OS should also be scanned with the applicable OS validation profile.'\n end\n elsif input('use_fips') == false\n impact 0.0\n describe 'This control is Not Applicable as FIPS is not required for this system' do\n skip 'This control is Not Applicable as FIPS is not required for this system'\n end\n else\n describe command('fips-mode-setup --check') do\n its('stdout.strip') { should match(/FIPS mode is enabled/) }\n end\n\n grub_config = command('grub2-editenv - list').stdout\n\n describe parse_config(grub_config) do\n its('kernelopts') { should match(/fips=1/) }\n end\n\n describe file('/proc/sys/crypto/fips_enabled') do\n its('content.strip') { should cmp '1' }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258230.rb" + }, + "title": "RHEL 8 must implement NIST FIPS-validated cryptography for the following: To provision digital signatures, to generate cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.", + "desc": "Use of weak or untested encryption algorithms undermines the purposes of using encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.\n\nRHEL 8 utilizes GRUB 2 as the default bootloader. Note that GRUB 2 command-line parameters are defined in the \"kernelopts\" variable of the /boot/grub2/grubenv file for all kernel boot entries. The command \"fips-mode-setup\" modifies the \"kernelopts\" variable, which in turn updates all kernel boot entries.\n\nThe fips=1 kernel option needs to be added to the kernel command line during system installation so that key generation is done with FIPS-approved algorithms and continuous monitoring tests in place. Users must also ensure the system has plenty of entropy during the installation process by moving the mouse around, or if no mouse is available, ensuring that many keystrokes are typed. The recommended amount of keystrokes is 256 and more. Less than 256 keystrokes may generate a nonunique key.", + "descriptions": { + "default": "Use of weak or untested encryption algorithms undermines the purposes of using encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.\n\nRHEL 8 utilizes GRUB 2 as the default bootloader. Note that GRUB 2 command-line parameters are defined in the \"kernelopts\" variable of the /boot/grub2/grubenv file for all kernel boot entries. The command \"fips-mode-setup\" modifies the \"kernelopts\" variable, which in turn updates all kernel boot entries.\n\nThe fips=1 kernel option needs to be added to the kernel command line during system installation so that key generation is done with FIPS-approved algorithms and continuous monitoring tests in place. Users must also ensure the system has plenty of entropy during the installation process by moving the mouse around, or if no mouse is available, ensuring that many keystrokes are typed. The recommended amount of keystrokes is 256 and more. Less than 256 keystrokes may generate a nonunique key.", + "check": "Verify the operating system implements DOD-approved encryption to protect the confidentiality of remote access sessions.\n\nCheck to see if FIPS mode is enabled with the following command:\n\n $ fips-mode-setup --check\n FIPS mode is enabled\n\nIf FIPS mode is \"enabled\", check to see if the kernel boot parameter is configured for FIPS mode with the following command:\n\n $ sudo grub2-editenv list | grep fips\n kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 boot=UUID=8d171156-cd61-421c-ba41-1c021ac29e82\n\nIf the kernel boot parameter is configured to use FIPS mode, check to see if the system is in FIPS mode with the following command:\n\n $ sudo cat /proc/sys/crypto/fips_enabled\n 1\n\nIf FIPS mode is not \"on\", the kernel boot parameter is not configured for FIPS mode, or the system does not have a value of \"1\" for \"fips_enabled\" in \"/proc/sys/crypto\", this is a finding.", + "fix": "Configure the operating system to implement DOD-approved encryption by following the steps below:\n\nTo enable strict FIPS compliance, the fips=1 kernel option needs to be added to the kernel boot parameters during system installation so key generation is done with FIPS-approved algorithms and continuous monitoring tests in place.\n\nEnable FIPS mode after installation (not strict FIPS-compliant) with the following command:\n\n $ sudo fips-mode-setup --enable\n\nReboot the system for the changes to take effect." + }, + "impact": 0, + "refs": [], + "tags": { + "severity": "high", + "gtitle": "SRG-OS-000033-GPOS-00014", + "satisfies": [ + "SRG-OS-000033-GPOS-00014", + "SRG-OS-000125-GPOS-00065", + "SRG-OS-000396-GPOS-00176", + "SRG-OS-000423-GPOS-00187", + "SRG-OS-000478-GPOS-00223" + ], + "gid": "V-230223", + "rid": "SV-258230r928585_rule", + "stig_id": "RHEL-08-010020", + "fix_id": "F-32867r928584_fix", + "cci": [ + "CCI-000068" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null + } + }, + { + "id": "SV-258231", + "code": "control 'SV-258231' do\n title 'RHEL 8 must employ FIPS 140-2 approved cryptographic hashing\nalgorithms for all stored passwords.'\n desc 'The system must use a strong hashing algorithm to store the password.\n\n Passwords need to be protected at all times, and encryption is the standard\nmethod for protecting passwords. If passwords are not encrypted, they can be\nplainly read (i.e., clear text) and easily compromised.'\n desc 'check', 'Confirm that the interactive user account passwords are using a strong\npassword hash with the following command:\n\n $ sudo cut -d: -f2 /etc/shadow\n\n\n$6$kcOnRq/5$NUEYPuyL.wghQwWssXRcLRFiiru7f5JPV6GaJhNC2aK5F3PZpE/BCCtwrxRc/AInKMNX3CdMw11m9STiql12f/\n\n Password hashes \"!\" or \"*\" indicate inactive accounts not available for\nlogon and are not evaluated. If any interactive user password hash does not\nbegin with \"$6$\", this is a finding.'\n desc 'fix', 'Lock all interactive user accounts not using SHA-512 hashing\nuntil the passwords can be regenerated with SHA-512.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000073-GPOS-00041'\n tag gid: 'V-230232'\n tag rid: 'SV-258231r877397_rule'\n tag stig_id: 'RHEL-08-010120'\n tag fix_id: 'F-32876r567443_fix'\n tag cci: ['CCI-000196']\n tag nist: ['IA-5 (1) (c)']\n tag 'host'\n tag 'container'\n\n weak_pw_hash_users = inspec.shadow.where { password !~ /^[*!]{1,2}.*$|^\\$6\\$.*$|^$/ }.users\n\n describe 'All stored passwords' do\n it 'should only be hashed with the SHA512 algorithm' do\n message = \"Users without SHA512 hashes:\\n\\t- #{weak_pw_hash_users.join(\"\\n\\t- \")}\"\n expect(weak_pw_hash_users).to be_empty, message\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258231.rb" + }, + "title": "RHEL 8 must employ FIPS 140-2 approved cryptographic hashing\nalgorithms for all stored passwords.", + "desc": "The system must use a strong hashing algorithm to store the password.\n\n Passwords need to be protected at all times, and encryption is the standard\nmethod for protecting passwords. If passwords are not encrypted, they can be\nplainly read (i.e., clear text) and easily compromised.", + "descriptions": { + "default": "The system must use a strong hashing algorithm to store the password.\n\n Passwords need to be protected at all times, and encryption is the standard\nmethod for protecting passwords. If passwords are not encrypted, they can be\nplainly read (i.e., clear text) and easily compromised.", + "check": "Confirm that the interactive user account passwords are using a strong\npassword hash with the following command:\n\n $ sudo cut -d: -f2 /etc/shadow\n\n\n$6$kcOnRq/5$NUEYPuyL.wghQwWssXRcLRFiiru7f5JPV6GaJhNC2aK5F3PZpE/BCCtwrxRc/AInKMNX3CdMw11m9STiql12f/\n\n Password hashes \"!\" or \"*\" indicate inactive accounts not available for\nlogon and are not evaluated. If any interactive user password hash does not\nbegin with \"$6$\", this is a finding.", + "fix": "Lock all interactive user accounts not using SHA-512 hashing\nuntil the passwords can be regenerated with SHA-512." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000073-GPOS-00041", + "gid": "V-230232", + "rid": "SV-258231r877397_rule", + "stig_id": "RHEL-08-010120", + "fix_id": "F-32876r567443_fix", + "cci": [ + "CCI-000196" + ], + "nist": [ + "IA-5 (1) (c)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258232", + "code": "control 'SV-258232' do\n title 'RHEL 9 IP tunnels must use FIPS 140-2/140-3 approved cryptographic algorithms.'\n desc 'Overriding the system crypto policy makes the behavior of the Libreswan service violate expectations, and makes system configuration more fragmented.'\n desc 'check', 'Verify that the IPsec service uses the system crypto policy with the following command:\n\nNote: If the ipsec service is not installed, this requirement is Not Applicable.\n\n$ sudo grep include /etc/ipsec.conf /etc/ipsec.d/*.conf\n\n/etc/ipsec.conf:include /etc/crypto-policies/back-ends/libreswan.config\n\nIf the ipsec configuration file does not contain \"include /etc/crypto-policies/back-ends/libreswan.config\", this is a finding.'\n desc 'fix', 'Configure Libreswan to use the system cryptographic policy.\n\nAdd the following line to \"/etc/ipsec.conf\":\n\ninclude /etc/crypto-policies/back-ends/libreswan.config'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61973r926681_chk'\n tag severity: 'medium'\n tag gid: 'V-258232'\n tag rid: 'SV-258232r926683_rule'\n tag stig_id: 'RHEL-09-671020'\n tag gtitle: 'SRG-OS-000033-GPOS-00014'\n tag fix_id: 'F-61897r926682_fix'\n tag 'documentable'\n tag cci: ['CCI-000068']\n tag nist: ['AC-17 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258232.rb" + }, + "title": "RHEL 9 IP tunnels must use FIPS 140-2/140-3 approved cryptographic algorithms.", + "desc": "Overriding the system crypto policy makes the behavior of the Libreswan service violate expectations, and makes system configuration more fragmented.", + "descriptions": { + "default": "Overriding the system crypto policy makes the behavior of the Libreswan service violate expectations, and makes system configuration more fragmented.", + "check": "Verify that the IPsec service uses the system crypto policy with the following command:\n\nNote: If the ipsec service is not installed, this requirement is Not Applicable.\n\n$ sudo grep include /etc/ipsec.conf /etc/ipsec.d/*.conf\n\n/etc/ipsec.conf:include /etc/crypto-policies/back-ends/libreswan.config\n\nIf the ipsec configuration file does not contain \"include /etc/crypto-policies/back-ends/libreswan.config\", this is a finding.", + "fix": "Configure Libreswan to use the system cryptographic policy.\n\nAdd the following line to \"/etc/ipsec.conf\":\n\ninclude /etc/crypto-policies/back-ends/libreswan.config" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61973r926681_chk", + "severity": "medium", + "gid": "V-258232", + "rid": "SV-258232r926683_rule", + "stig_id": "RHEL-09-671020", + "gtitle": "SRG-OS-000033-GPOS-00014", + "fix_id": "F-61897r926682_fix", + "documentable": null, + "cci": [ + "CCI-000068" + ], + "nist": [ + "AC-17 (2)" + ] + } + }, + { + "id": "SV-258233", + "code": "control 'SV-258233' do\n title 'The RHEL 8 pam_unix.so module must be configured in the system-auth\nfile to use a FIPS 140-2 approved cryptographic hashing algorithm for system\nauthentication.'\n desc 'Unapproved mechanisms that are used for authentication to the\ncryptographic module are not verified and therefore cannot be relied upon to\nprovide confidentiality or integrity, and DoD data may be compromised.\n\n RHEL 8 systems utilizing encryption are required to use FIPS-compliant\nmechanisms for authenticating to cryptographic modules.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD\nrequirements. This allows for Security Levels 1, 2, 3, or 4 for use on a\ngeneral-purpose computing system.'\n desc 'check', 'Verify that pam_unix.so module is configured to use sha512.\n\nCheck that pam_unix.so module is configured to use sha512 in /etc/pam.d/system-auth with the following command:\n\n$ sudo grep password /etc/pam.d/system-auth | grep pam_unix\n\npassword sufficient pam_unix.so sha512\n\nIf \"sha512\" is missing, or is commented out, this is a finding.'\n desc 'fix', 'Configure RHEL 8 to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication.\n\nEdit/modify the following line in the \"/etc/pam.d/system-auth\" file to include the sha512 option for pam_unix.so:\n\npassword sufficient pam_unix.so sha512'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000120-GPOS-00061'\n tag gid: 'V-244524'\n tag rid: 'SV-258233r809331_rule'\n tag stig_id: 'RHEL-08-010159'\n tag fix_id: 'F-47756r809330_fix'\n tag cci: ['CCI-000803']\n tag nist: ['IA-7']\n tag 'host'\n tag 'container'\n\n pam_auth_files = input('pam_auth_files')\n\n describe pam(pam_auth_files['system-auth']) do\n its('lines') { should match_pam_rule('password sufficient pam_unix.so sha512') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258233.rb" + }, + "title": "The RHEL 8 pam_unix.so module must be configured in the system-auth\nfile to use a FIPS 140-2 approved cryptographic hashing algorithm for system\nauthentication.", + "desc": "Unapproved mechanisms that are used for authentication to the\ncryptographic module are not verified and therefore cannot be relied upon to\nprovide confidentiality or integrity, and DoD data may be compromised.\n\n RHEL 8 systems utilizing encryption are required to use FIPS-compliant\nmechanisms for authenticating to cryptographic modules.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD\nrequirements. This allows for Security Levels 1, 2, 3, or 4 for use on a\ngeneral-purpose computing system.", + "descriptions": { + "default": "Unapproved mechanisms that are used for authentication to the\ncryptographic module are not verified and therefore cannot be relied upon to\nprovide confidentiality or integrity, and DoD data may be compromised.\n\n RHEL 8 systems utilizing encryption are required to use FIPS-compliant\nmechanisms for authenticating to cryptographic modules.\n\n FIPS 140-2 is the current standard for validating that mechanisms used to\naccess cryptographic modules utilize authentication that meets DoD\nrequirements. This allows for Security Levels 1, 2, 3, or 4 for use on a\ngeneral-purpose computing system.", + "check": "Verify that pam_unix.so module is configured to use sha512.\n\nCheck that pam_unix.so module is configured to use sha512 in /etc/pam.d/system-auth with the following command:\n\n$ sudo grep password /etc/pam.d/system-auth | grep pam_unix\n\npassword sufficient pam_unix.so sha512\n\nIf \"sha512\" is missing, or is commented out, this is a finding.", + "fix": "Configure RHEL 8 to use a FIPS 140-2 approved cryptographic hashing algorithm for system authentication.\n\nEdit/modify the following line in the \"/etc/pam.d/system-auth\" file to include the sha512 option for pam_unix.so:\n\npassword sufficient pam_unix.so sha512" + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000120-GPOS-00061", + "gid": "V-244524", + "rid": "SV-258233r809331_rule", + "stig_id": "RHEL-08-010159", + "fix_id": "F-47756r809330_fix", + "cci": [ + "CCI-000803" + ], + "nist": [ + "IA-7" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258234", + "code": "control 'SV-258234' do\n title 'RHEL 9 must have the crypto-policies package installed.'\n desc 'Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n'\n desc 'check', 'Verify that RHEL 9 crypto-policies package is installed with the following command:\n\n$ sudo dnf list --installed crypto-policies\n\nExample output:\n\ncrypto-policies.noarch 20220223-1.git5203b41.el9_0.1\n\nIf the \"crypto-policies\" package is not installed, this is a finding.'\n desc 'fix', 'Install the crypto-policies package (if the package is not already installed) with the following command:\n\n$ sudo dnf install crypto-policies'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61975r926687_chk'\n tag severity: 'medium'\n tag gid: 'V-258234'\n tag rid: 'SV-258234r926689_rule'\n tag stig_id: 'RHEL-09-672010'\n tag gtitle: 'SRG-OS-000396-GPOS-00176'\n tag fix_id: 'F-61899r926688_fix'\n tag satisfies: ['SRG-OS-000396-GPOS-00176', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174']\n tag 'documentable'\n tag cci: ['CCI-002450', 'CCI-002890', 'CCI-003123']\n tag nist: ['SC-13 b', 'MA-4 (6)', 'MA-4 (6)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258234.rb" + }, + "title": "RHEL 9 must have the crypto-policies package installed.", + "desc": "Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n", + "descriptions": { + "default": "Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n", + "check": "Verify that RHEL 9 crypto-policies package is installed with the following command:\n\n$ sudo dnf list --installed crypto-policies\n\nExample output:\n\ncrypto-policies.noarch 20220223-1.git5203b41.el9_0.1\n\nIf the \"crypto-policies\" package is not installed, this is a finding.", + "fix": "Install the crypto-policies package (if the package is not already installed) with the following command:\n\n$ sudo dnf install crypto-policies" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61975r926687_chk", + "severity": "medium", + "gid": "V-258234", + "rid": "SV-258234r926689_rule", + "stig_id": "RHEL-09-672010", + "gtitle": "SRG-OS-000396-GPOS-00176", + "fix_id": "F-61899r926688_fix", + "satisfies": [ + "SRG-OS-000396-GPOS-00176", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174" + ], + "documentable": null, + "cci": [ + "CCI-002450", + "CCI-002890", + "CCI-003123" + ], + "nist": [ + "SC-13 b", + "MA-4 (6)", + "MA-4 (6)" + ] + } + }, + { + "id": "SV-258235", + "code": "control 'SV-258235' do\n title 'RHEL 9 crypto policy files must match files shipped with the operating system.'\n desc 'The RHEL 9 package \"crypto-policies\" defines the cryptography policies for the system.\n\nIf the files are changed from those shipped with the operating system, it may be possible for RHEL 9 to use cryptographic functions that are not FIPS 140-3 approved.\n\n'\n desc 'check', 'Verify that the RHEL 9 package \"crypto-policies\" has not been modified with the following command:\n\n$ rpm -V crypto-policies\n\nIf the command has any output, this is a finding.'\n desc 'fix', 'Reinstall the crypto-policies package to remove any modifications.\n\n$ sudo dnf reinstall crypto-policies'\n impact 0.7\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61976r926690_chk'\n tag severity: 'high'\n tag gid: 'V-258235'\n tag rid: 'SV-258235r926692_rule'\n tag stig_id: 'RHEL-09-672015'\n tag gtitle: 'SRG-OS-000478-GPOS-00223'\n tag fix_id: 'F-61900r926691_fix'\n tag satisfies: ['SRG-OS-000478-GPOS-00223', 'SRG-OS-000396-GPOS-00176']\n tag 'documentable'\n tag cci: ['CCI-002450']\n tag nist: ['SC-13 b']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258235.rb" + }, + "title": "RHEL 9 crypto policy files must match files shipped with the operating system.", + "desc": "The RHEL 9 package \"crypto-policies\" defines the cryptography policies for the system.\n\nIf the files are changed from those shipped with the operating system, it may be possible for RHEL 9 to use cryptographic functions that are not FIPS 140-3 approved.\n\n", + "descriptions": { + "default": "The RHEL 9 package \"crypto-policies\" defines the cryptography policies for the system.\n\nIf the files are changed from those shipped with the operating system, it may be possible for RHEL 9 to use cryptographic functions that are not FIPS 140-3 approved.\n\n", + "check": "Verify that the RHEL 9 package \"crypto-policies\" has not been modified with the following command:\n\n$ rpm -V crypto-policies\n\nIf the command has any output, this is a finding.", + "fix": "Reinstall the crypto-policies package to remove any modifications.\n\n$ sudo dnf reinstall crypto-policies" + }, + "impact": 0.7, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61976r926690_chk", + "severity": "high", + "gid": "V-258235", + "rid": "SV-258235r926692_rule", + "stig_id": "RHEL-09-672015", + "gtitle": "SRG-OS-000478-GPOS-00223", + "fix_id": "F-61900r926691_fix", + "satisfies": [ + "SRG-OS-000478-GPOS-00223", + "SRG-OS-000396-GPOS-00176" + ], + "documentable": null, + "cci": [ + "CCI-002450" + ], + "nist": [ + "SC-13 b" + ] + } + }, + { + "id": "SV-258236", + "code": "control 'SV-258236' do\n title 'RHEL 9 crypto policy must not be overridden.'\n desc 'Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n'\n desc 'check', 'Verify that RHEL 9 custom crypto policies are loaded correctly.\n\nList all of the crypto backends configured on the system.\n\n$ ls -l /etc/crypto-policies/back-ends/ \nlrwxrwxrwx. 1 root root 40 Oct 7 08:44 bind.config -> /usr/share/crypto-policies/FIPS/bind.txt\nlrwxrwxrwx. 1 root root 42 Oct 7 08:44 gnutls.config -> /usr/share/crypto-policies/FIPS/gnutls.txt\nlrwxrwxrwx. 1 root root 40 Oct 7 08:44 java.config -> /usr/share/crypto-policies/FIPS/java.txt\nlrwxrwxrwx. 1 root root 46 Oct 7 08:44 javasystem.config -> /usr/share/crypto-policies/FIPS/javasystem.txt\nlrwxrwxrwx. 1 root root 40 Oct 7 08:44 krb5.config -> /usr/share/crypto-policies/FIPS/krb5.txt\nlrwxrwxrwx. 1 root root 45 Oct 7 08:44 libreswan.config -> /usr/share/crypto-policies/FIPS/libreswan.txt\nlrwxrwxrwx. 1 root root 42 Oct 7 08:44 libssh.config -> /usr/share/crypto-policies/FIPS/libssh.txt\nlrwxrwxrwx. 1 root root 39 Oct 7 08:44 nss.config -> /usr/share/crypto-policies/FIPS/nss.txt\nlrwxrwxrwx. 1 root root 43 Oct 7 08:44 openssh.config -> /usr/share/crypto-policies/FIPS/openssh.txt\nlrwxrwxrwx. 1 root root 49 Oct 7 08:44 opensshserver.config -> /usr/share/crypto-policies/FIPS/opensshserver.txt\nlrwxrwxrwx. 1 root root 46 Oct 7 08:44 opensslcnf.config -> /usr/share/crypto-policies/FIPS/opensslcnf.txt\nlrwxrwxrwx. 1 root root 43 Oct 7 08:44 openssl.config -> /usr/share/crypto-policies/FIPS/openssl.txt\n\nIf the paths do not point the respective files under /usr/share/crypto-policies/FIPS path, this is a finding.'\n desc 'fix', 'Configure RHEL 9 to FIPS crypto policy.\n\n$ sudo ln -s /usr/share/crypto-policies/FIPS/.txt /etc/crypto-policies/back-ends/.conf\n\nReplace with every service that is not set to FIPS.\n\nThe system must be rebooted to make the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61977r926693_chk'\n tag severity: 'medium'\n tag gid: 'V-258236'\n tag rid: 'SV-258236r926695_rule'\n tag stig_id: 'RHEL-09-672020'\n tag gtitle: 'SRG-OS-000396-GPOS-00176'\n tag fix_id: 'F-61901r926694_fix'\n tag satisfies: ['SRG-OS-000396-GPOS-00176', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174']\n tag 'documentable'\n tag cci: ['CCI-002450', 'CCI-002890', 'CCI-003123']\n tag nist: ['SC-13 b', 'MA-4 (6)', 'MA-4 (6)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258236.rb" + }, + "title": "RHEL 9 crypto policy must not be overridden.", + "desc": "Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n", + "descriptions": { + "default": "Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n", + "check": "Verify that RHEL 9 custom crypto policies are loaded correctly.\n\nList all of the crypto backends configured on the system.\n\n$ ls -l /etc/crypto-policies/back-ends/ \nlrwxrwxrwx. 1 root root 40 Oct 7 08:44 bind.config -> /usr/share/crypto-policies/FIPS/bind.txt\nlrwxrwxrwx. 1 root root 42 Oct 7 08:44 gnutls.config -> /usr/share/crypto-policies/FIPS/gnutls.txt\nlrwxrwxrwx. 1 root root 40 Oct 7 08:44 java.config -> /usr/share/crypto-policies/FIPS/java.txt\nlrwxrwxrwx. 1 root root 46 Oct 7 08:44 javasystem.config -> /usr/share/crypto-policies/FIPS/javasystem.txt\nlrwxrwxrwx. 1 root root 40 Oct 7 08:44 krb5.config -> /usr/share/crypto-policies/FIPS/krb5.txt\nlrwxrwxrwx. 1 root root 45 Oct 7 08:44 libreswan.config -> /usr/share/crypto-policies/FIPS/libreswan.txt\nlrwxrwxrwx. 1 root root 42 Oct 7 08:44 libssh.config -> /usr/share/crypto-policies/FIPS/libssh.txt\nlrwxrwxrwx. 1 root root 39 Oct 7 08:44 nss.config -> /usr/share/crypto-policies/FIPS/nss.txt\nlrwxrwxrwx. 1 root root 43 Oct 7 08:44 openssh.config -> /usr/share/crypto-policies/FIPS/openssh.txt\nlrwxrwxrwx. 1 root root 49 Oct 7 08:44 opensshserver.config -> /usr/share/crypto-policies/FIPS/opensshserver.txt\nlrwxrwxrwx. 1 root root 46 Oct 7 08:44 opensslcnf.config -> /usr/share/crypto-policies/FIPS/opensslcnf.txt\nlrwxrwxrwx. 1 root root 43 Oct 7 08:44 openssl.config -> /usr/share/crypto-policies/FIPS/openssl.txt\n\nIf the paths do not point the respective files under /usr/share/crypto-policies/FIPS path, this is a finding.", + "fix": "Configure RHEL 9 to FIPS crypto policy.\n\n$ sudo ln -s /usr/share/crypto-policies/FIPS/.txt /etc/crypto-policies/back-ends/.conf\n\nReplace with every service that is not set to FIPS.\n\nThe system must be rebooted to make the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61977r926693_chk", + "severity": "medium", + "gid": "V-258236", + "rid": "SV-258236r926695_rule", + "stig_id": "RHEL-09-672020", + "gtitle": "SRG-OS-000396-GPOS-00176", + "fix_id": "F-61901r926694_fix", + "satisfies": [ + "SRG-OS-000396-GPOS-00176", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174" + ], + "documentable": null, + "cci": [ + "CCI-002450", + "CCI-002890", + "CCI-003123" + ], + "nist": [ + "SC-13 b", + "MA-4 (6)", + "MA-4 (6)" + ] + } + }, + { + "id": "SV-258237", + "code": "control 'SV-258237' do\n title 'RHEL 9 must use mechanisms meeting the requirements of applicable federal laws, executive orders, directives, policies, regulations, standards, and guidance for authentication to a cryptographic module.'\n desc 'Overriding the system crypto policy makes the behavior of Kerberos violate expectations, and makes system configuration more fragmented.'\n desc 'check', 'Verify that the symlink exists and targets the correct Kerberos crypto policy, with the following command:\n\nfile /etc/crypto-policies/back-ends/krb5.config\n\nIf command output shows the following line, Kerberos is configured to use the system-wide crypto policy:\n\n/etc/crypto-policies/back-ends/krb5.config: symbolic link to /usr/share/crypto-policies/FIPS/krb5.txt\n\nIf the symlink does not exist or points to a different target, this is a finding.'\n desc 'fix', 'Configure Kerberos to use system crypto policy.\n\nCreate a symlink pointing to system crypto policy in the Kerberos configuration using the following command:\n\n$ sudo ln -s /etc/crypto-policies/back-ends/krb5.config /usr/share/crypto-policies/FIPS/krb5.txt'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61978r926696_chk'\n tag severity: 'medium'\n tag gid: 'V-258237'\n tag rid: 'SV-258237r926698_rule'\n tag stig_id: 'RHEL-09-672025'\n tag gtitle: 'SRG-OS-000120-GPOS-00061'\n tag fix_id: 'F-61902r926697_fix'\n tag 'documentable'\n tag cci: ['CCI-000803']\n tag nist: ['IA-7']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258237.rb" + }, + "title": "RHEL 9 must use mechanisms meeting the requirements of applicable federal laws, executive orders, directives, policies, regulations, standards, and guidance for authentication to a cryptographic module.", + "desc": "Overriding the system crypto policy makes the behavior of Kerberos violate expectations, and makes system configuration more fragmented.", + "descriptions": { + "default": "Overriding the system crypto policy makes the behavior of Kerberos violate expectations, and makes system configuration more fragmented.", + "check": "Verify that the symlink exists and targets the correct Kerberos crypto policy, with the following command:\n\nfile /etc/crypto-policies/back-ends/krb5.config\n\nIf command output shows the following line, Kerberos is configured to use the system-wide crypto policy:\n\n/etc/crypto-policies/back-ends/krb5.config: symbolic link to /usr/share/crypto-policies/FIPS/krb5.txt\n\nIf the symlink does not exist or points to a different target, this is a finding.", + "fix": "Configure Kerberos to use system crypto policy.\n\nCreate a symlink pointing to system crypto policy in the Kerberos configuration using the following command:\n\n$ sudo ln -s /etc/crypto-policies/back-ends/krb5.config /usr/share/crypto-policies/FIPS/krb5.txt" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61978r926696_chk", + "severity": "medium", + "gid": "V-258237", + "rid": "SV-258237r926698_rule", + "stig_id": "RHEL-09-672025", + "gtitle": "SRG-OS-000120-GPOS-00061", + "fix_id": "F-61902r926697_fix", + "documentable": null, + "cci": [ + "CCI-000803" + ], + "nist": [ + "IA-7" + ] + } + }, + { + "id": "SV-258238", + "code": "control 'SV-258238' do\n title 'The RHEL 8 operating system must implement DoD-approved TLS encryption\nin the GnuTLS package.'\n desc 'Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Transport Layer Security (TLS) encryption is a required security setting as\na number of known vulnerabilities have been reported against Secure Sockets\nLayer (SSL) and earlier versions of TLS. Encryption of private information is\nessential to ensuring data confidentiality. If private information is not\nencrypted, it can be intercepted and easily read by an unauthorized party. SQL\nServer must use a minimum of FIPS 140-2-approved TLS version 1.2, and all\nnon-FIPS-approved SSL and TLS versions must be disabled. NIST SP 800-52\nspecifies the preferred configurations for government systems.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n The GnuTLS library offers an API to access secure communications protocols.\n SSLv2 is not available in the GnuTLS library. The RHEL 8 system-wide crypto\npolicy defines employed algorithms in the\n/etc/crypto-policies/back-ends/gnutls.config file.'\n desc 'check', 'Verify the GnuTLS library is configured to only allow DoD-approved SSL/TLS Versions:\n\n$ sudo grep -io +vers.* /etc/crypto-policies/back-ends/gnutls.config\n\n+VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0:+COMP-NULL:%PROFILE_MEDIUM\n\nIf the \"gnutls.config\" does not list \"-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0\" to disable unapproved SSL/TLS versions, this is a finding.'\n desc 'fix', 'Configure the RHEL 8 GnuTLS library to use only DoD-approved encryption by\nadding the following line to \"/etc/crypto-policies/back-ends/gnutls.config\":\n\n +VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0\n\n A reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000423-GPOS-00187']\n tag gid: 'V-230256'\n tag rid: 'SV-258238r877394_rule'\n tag stig_id: 'RHEL-08-010295'\n tag fix_id: 'F-32900r567515_fix'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\n tag 'host'\n tag 'container'\n\n gnutls = file('/etc/crypto-policies/back-ends/gnutls.config').content.upcase.strip.split(':')\n unapproved_versions = input('unapproved_ssl_tls_versions').map(&:upcase)\n failing_versions = unapproved_versions - gnutls\n\n describe 'GnuTLS' do\n it 'should disable unapproved SSL/TLS versions' do\n expect(failing_versions).to be_empty, \"GnuTLS should not allow:\\n\\t- #{failing_versions.join(\"\\n\\t- \")}\"\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258238.rb" + }, + "title": "The RHEL 8 operating system must implement DoD-approved TLS encryption\nin the GnuTLS package.", + "desc": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Transport Layer Security (TLS) encryption is a required security setting as\na number of known vulnerabilities have been reported against Secure Sockets\nLayer (SSL) and earlier versions of TLS. Encryption of private information is\nessential to ensuring data confidentiality. If private information is not\nencrypted, it can be intercepted and easily read by an unauthorized party. SQL\nServer must use a minimum of FIPS 140-2-approved TLS version 1.2, and all\nnon-FIPS-approved SSL and TLS versions must be disabled. NIST SP 800-52\nspecifies the preferred configurations for government systems.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n The GnuTLS library offers an API to access secure communications protocols.\n SSLv2 is not available in the GnuTLS library. The RHEL 8 system-wide crypto\npolicy defines employed algorithms in the\n/etc/crypto-policies/back-ends/gnutls.config file.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Transport Layer Security (TLS) encryption is a required security setting as\na number of known vulnerabilities have been reported against Secure Sockets\nLayer (SSL) and earlier versions of TLS. Encryption of private information is\nessential to ensuring data confidentiality. If private information is not\nencrypted, it can be intercepted and easily read by an unauthorized party. SQL\nServer must use a minimum of FIPS 140-2-approved TLS version 1.2, and all\nnon-FIPS-approved SSL and TLS versions must be disabled. NIST SP 800-52\nspecifies the preferred configurations for government systems.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n The GnuTLS library offers an API to access secure communications protocols.\n SSLv2 is not available in the GnuTLS library. The RHEL 8 system-wide crypto\npolicy defines employed algorithms in the\n/etc/crypto-policies/back-ends/gnutls.config file.", + "check": "Verify the GnuTLS library is configured to only allow DoD-approved SSL/TLS Versions:\n\n$ sudo grep -io +vers.* /etc/crypto-policies/back-ends/gnutls.config\n\n+VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0:+COMP-NULL:%PROFILE_MEDIUM\n\nIf the \"gnutls.config\" does not list \"-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0\" to disable unapproved SSL/TLS versions, this is a finding.", + "fix": "Configure the RHEL 8 GnuTLS library to use only DoD-approved encryption by\nadding the following line to \"/etc/crypto-policies/back-ends/gnutls.config\":\n\n +VERS-ALL:-VERS-DTLS0.9:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS1.0\n\n A reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000250-GPOS-00093", + "satisfies": [ + "SRG-OS-000250-GPOS-00093", + "SRG-OS-000423-GPOS-00187" + ], + "gid": "V-230256", + "rid": "SV-258238r877394_rule", + "stig_id": "RHEL-08-010295", + "fix_id": "F-32900r567515_fix", + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258239", + "code": "control 'SV-258239' do\n title 'The RHEL 8 operating system must implement DoD-approved encryption in\nthe OpenSSL package.'\n desc 'Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The employed\nalgorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config\nfile.'\n desc 'check', 'Verify the OpenSSL library is configured to use only ciphers employing FIPS\n140-2-approved algorithms:\n\n Verify that system-wide crypto policies are in effect:\n\n $ sudo grep -i opensslcnf.config /etc/pki/tls/openssl.cnf\n\n .include /etc/crypto-policies/back-ends/opensslcnf.config\n\n If the \"opensslcnf.config\" is not defined in the\n\"/etc/pki/tls/openssl.cnf\" file, this is a finding.\n\n Verify which system-wide crypto policy is in use:\n\n $ sudo update-crypto-policies --show\n\n FIPS\n\n If the system-wide crypto policy is set to anything other than \"FIPS\",\nthis is a finding.'\n desc 'fix', 'Configure the RHEL 8 OpenSSL library to use only ciphers employing FIPS\n140-2-approved algorithms with the following command:\n\n $ sudo fips-mode-setup --enable\n\n A reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065']\n tag gid: 'V-230254'\n tag rid: 'SV-258239r877394_rule'\n tag stig_id: 'RHEL-08-010293'\n tag fix_id: 'F-32898r567509_fix'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\n tag 'host'\n tag 'container-conditional'\n\n only_if(\"Checking the host's FIPS compliance can't be done within the container and should be reveiwed manually.\") {\n !(virtualization.system.eql?('docker') && !file('/etc/pki/tls/openssl.cnf').exist?)\n }\n\n describe 'A line in the OpenSSL config file' do\n subject { command('grep -i opensslcnf.config /etc/pki/tls/openssl.cnf').stdout.strip }\n it { should match(/^\\.include.*opensslcnf.config$/) }\n end\n\n describe 'System-wide crypto policy' do\n subject { command('update-crypto-policies --show').stdout.strip }\n it { should eq input('system_wide_crypto_policy') }\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258239.rb" + }, + "title": "The RHEL 8 operating system must implement DoD-approved encryption in\nthe OpenSSL package.", + "desc": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The employed\nalgorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config\nfile.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The employed\nalgorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config\nfile.", + "check": "Verify the OpenSSL library is configured to use only ciphers employing FIPS\n140-2-approved algorithms:\n\n Verify that system-wide crypto policies are in effect:\n\n $ sudo grep -i opensslcnf.config /etc/pki/tls/openssl.cnf\n\n .include /etc/crypto-policies/back-ends/opensslcnf.config\n\n If the \"opensslcnf.config\" is not defined in the\n\"/etc/pki/tls/openssl.cnf\" file, this is a finding.\n\n Verify which system-wide crypto policy is in use:\n\n $ sudo update-crypto-policies --show\n\n FIPS\n\n If the system-wide crypto policy is set to anything other than \"FIPS\",\nthis is a finding.", + "fix": "Configure the RHEL 8 OpenSSL library to use only ciphers employing FIPS\n140-2-approved algorithms with the following command:\n\n $ sudo fips-mode-setup --enable\n\n A reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000250-GPOS-00093", + "satisfies": [ + "SRG-OS-000250-GPOS-00093", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174", + "SRG-OS-000125-GPOS-00065" + ], + "gid": "V-230254", + "rid": "SV-258239r877394_rule", + "stig_id": "RHEL-08-010293", + "fix_id": "F-32898r567509_fix", + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null, + "container-conditional": null + } + }, + { + "id": "SV-258240", + "code": "control 'SV-258240' do\n title 'The RHEL 8 operating system must implement DoD-approved TLS encryption\nin the OpenSSL package.'\n desc 'Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The employed\nalgorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config\nfile.'\n desc 'check', 'Verify the OpenSSL library is configured to use only DoD-approved TLS encryption:\n\nFor versions prior to crypto-policies-20210617-1.gitc776d3e.el8.noarch:\n\n$ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config\n\nMinProtocol = TLSv1.2\n\nIf the \"MinProtocol\" is set to anything older than \"TLSv1.2\", this is a finding.\n\nFor version crypto-policies-20210617-1.gitc776d3e.el8.noarch and newer:\n\n$ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config\n\nTLS.MinProtocol = TLSv1.2\nDTLS.MinProtocol = DTLSv1.2\n\nIf the \"TLS.MinProtocol\" is set to anything older than \"TLSv1.2\" or the \"DTLS.MinProtocol\" is set to anything older than DTLSv1.2, this is a finding.'\n desc 'fix', 'Configure the RHEL 8 OpenSSL library to use only DoD-approved TLS encryption by editing the following line in the \"/etc/crypto-policies/back-ends/opensslcnf.config\" file:\n\nFor versions prior to crypto-policies-20210617-1.gitc776d3e.el8.noarch:\nMinProtocol = TLSv1.2\n\nFor version crypto-policies-20210617-1.gitc776d3e.el8.noarch and newer:\nTLS.MinProtocol = TLSv1.2\nDTLS.MinProtocol = DTLSv1.2\nA reboot is required for the changes to take effect.'\n impact 0.5\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065']\n tag gid: 'V-230255'\n tag rid: 'SV-258240r877394_rule'\n tag stig_id: 'RHEL-08-010294'\n tag fix_id: 'F-32899r809381_fix'\n tag cci: ['CCI-001453']\n tag nist: ['AC-17 (2)']\n tag 'host'\n tag 'container'\n\n crypto_policies = package('crypto-policies')\n\n if crypto_policies.version < '20210617-1.gitc776d3e.el8.noarch'\n describe parse_config_file('/etc/crypto-policies/back-ends/opensslcnf.config') do\n its('MinProtocol') { should be_in ['TLSv1.2', 'TLSv1.3'] }\n end\n else\n describe parse_config_file('/etc/crypto-policies/back-ends/opensslcnf.config') do\n its(['TLS.MinProtocol']) { should be_in ['TLSv1.2', 'TLSv1.3'] }\n its(['DTLS.MinProtocol']) { should be_in ['DTLSv1.2', 'DTLSv1.3'] }\n end\n end\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258240.rb" + }, + "title": "The RHEL 8 operating system must implement DoD-approved TLS encryption\nin the OpenSSL package.", + "desc": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The employed\nalgorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config\nfile.", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be\naltered by unauthorized users without detection.\n\n Remote access (e.g., RDP) is access to DoD nonpublic information systems by\nan authorized user (or an information system) communicating through an\nexternal, non-organization-controlled network. Remote access methods include,\nfor example, dial-up, broadband, and wireless.\n\n Cryptographic mechanisms used for protecting the integrity of information\ninclude, for example, signed hash functions using asymmetric cryptography\nenabling distribution of the public key to verify the hash information while\nmaintaining the confidentiality of the secret key used to generate the hash.\n\n RHEL 8 incorporates system-wide crypto policies by default. The employed\nalgorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config\nfile.", + "check": "Verify the OpenSSL library is configured to use only DoD-approved TLS encryption:\n\nFor versions prior to crypto-policies-20210617-1.gitc776d3e.el8.noarch:\n\n$ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config\n\nMinProtocol = TLSv1.2\n\nIf the \"MinProtocol\" is set to anything older than \"TLSv1.2\", this is a finding.\n\nFor version crypto-policies-20210617-1.gitc776d3e.el8.noarch and newer:\n\n$ sudo grep -i MinProtocol /etc/crypto-policies/back-ends/opensslcnf.config\n\nTLS.MinProtocol = TLSv1.2\nDTLS.MinProtocol = DTLSv1.2\n\nIf the \"TLS.MinProtocol\" is set to anything older than \"TLSv1.2\" or the \"DTLS.MinProtocol\" is set to anything older than DTLSv1.2, this is a finding.", + "fix": "Configure the RHEL 8 OpenSSL library to use only DoD-approved TLS encryption by editing the following line in the \"/etc/crypto-policies/back-ends/opensslcnf.config\" file:\n\nFor versions prior to crypto-policies-20210617-1.gitc776d3e.el8.noarch:\nMinProtocol = TLSv1.2\n\nFor version crypto-policies-20210617-1.gitc776d3e.el8.noarch and newer:\nTLS.MinProtocol = TLSv1.2\nDTLS.MinProtocol = DTLSv1.2\nA reboot is required for the changes to take effect." + }, + "impact": 0.5, + "refs": [], + "tags": { + "severity": "medium", + "gtitle": "SRG-OS-000250-GPOS-00093", + "satisfies": [ + "SRG-OS-000250-GPOS-00093", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174", + "SRG-OS-000125-GPOS-00065" + ], + "gid": "V-230255", + "rid": "SV-258240r877394_rule", + "stig_id": "RHEL-08-010294", + "fix_id": "F-32899r809381_fix", + "cci": [ + "CCI-001453" + ], + "nist": [ + "AC-17 (2)" + ], + "host": null, + "container": null + } + }, + { + "id": "SV-258241", + "code": "control 'SV-258241' do\n title 'RHEL 9 must implement a system-wide encryption policy.'\n desc 'Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n'\n desc 'check', 'Verify that the RHEL 9 cryptography policy has been configured correctly with the following commands:\n\n$ sudo update-crypto-policies --show \n\nFIPS\n\nIf the cryptography is not set to \"FIPS\" and is not applied, this is a finding.\n\n$ sudo update-crypto-policies --check\n\nThe configured policy matches the generated policy\n\nIf the command does not return \"The configured policy matches the generated policy\", this is a finding.'\n desc 'fix', 'Configure the operating system to implement FIPS mode with the following command\n\n$ sudo fips-mode-setup --enable\n\nReboot the system for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61982r926708_chk'\n tag severity: 'medium'\n tag gid: 'V-258241'\n tag rid: 'SV-258241r926710_rule'\n tag stig_id: 'RHEL-09-672045'\n tag gtitle: 'SRG-OS-000396-GPOS-00176'\n tag fix_id: 'F-61906r926709_fix'\n tag satisfies: ['SRG-OS-000396-GPOS-00176', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174']\n tag 'documentable'\n tag cci: ['CCI-002450', 'CCI-002890', 'CCI-003123']\n tag nist: ['SC-13 b', 'MA-4 (6)', 'MA-4 (6)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258241.rb" + }, + "title": "RHEL 9 must implement a system-wide encryption policy.", + "desc": "Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n", + "descriptions": { + "default": "Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data.\n\n", + "check": "Verify that the RHEL 9 cryptography policy has been configured correctly with the following commands:\n\n$ sudo update-crypto-policies --show \n\nFIPS\n\nIf the cryptography is not set to \"FIPS\" and is not applied, this is a finding.\n\n$ sudo update-crypto-policies --check\n\nThe configured policy matches the generated policy\n\nIf the command does not return \"The configured policy matches the generated policy\", this is a finding.", + "fix": "Configure the operating system to implement FIPS mode with the following command\n\n$ sudo fips-mode-setup --enable\n\nReboot the system for the changes to take effect." + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61982r926708_chk", + "severity": "medium", + "gid": "V-258241", + "rid": "SV-258241r926710_rule", + "stig_id": "RHEL-09-672045", + "gtitle": "SRG-OS-000396-GPOS-00176", + "fix_id": "F-61906r926709_fix", + "satisfies": [ + "SRG-OS-000396-GPOS-00176", + "SRG-OS-000393-GPOS-00173", + "SRG-OS-000394-GPOS-00174" + ], + "documentable": null, + "cci": [ + "CCI-002450", + "CCI-002890", + "CCI-003123" + ], + "nist": [ + "SC-13 b", + "MA-4 (6)", + "MA-4 (6)" + ] + } + }, + { + "id": "SV-258242", + "code": "control 'SV-258242' do\n title 'RHEL 9 must implement DOD-approved encryption in the bind package.'\n desc 'Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/ directory.\n\n'\n desc 'check', %q(Verify that BIND uses the system crypto policy with the following command:\n\nNote: If the \"bind\" package is not installed, this requirement is Not Applicable.\n\n$ sudo grep include /etc/named.conf \n\ninclude \"/etc/crypto-policies/back-ends/bind.config\";' \n\nIf BIND is installed and the BIND config file doesn't contain the include \"/etc/crypto-policies/back-ends/bind.config\" directive, or the line is commented out, this is a finding.)\n desc 'fix', 'Configure BIND to use the system crypto policy.\n\nAdd the following line to the \"options\" section in \"/etc/named.conf\":\n\ninclude \"/etc/crypto-policies/back-ends/bind.config\";'\n impact 0.5\n ref 'DPMS Target Red Hat Enterprise Linux 9'\n tag check_id: 'C-61983r926711_chk'\n tag severity: 'medium'\n tag gid: 'V-258242'\n tag rid: 'SV-258242r926713_rule'\n tag stig_id: 'RHEL-09-672050'\n tag gtitle: 'SRG-OS-000423-GPOS-00187'\n tag fix_id: 'F-61907r926712_fix'\n tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000426-GPOS-00190']\n tag 'documentable'\n tag cci: ['CCI-002418', 'CCI-002422']\n tag nist: ['SC-8', 'SC-8 (2)']\nend", + "source_location": { + "line": 1, + "ref": "./controls/SV-258242.rb" + }, + "title": "RHEL 9 must implement DOD-approved encryption in the bind package.", + "desc": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/ directory.\n\n", + "descriptions": { + "default": "Without cryptographic integrity protections, information can be altered by unauthorized users without detection.\n\nCryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.\n\nRHEL 9 incorporates system-wide crypto policies by default. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/ directory.\n\n", + "check": "Verify that BIND uses the system crypto policy with the following command:\n\nNote: If the \"bind\" package is not installed, this requirement is Not Applicable.\n\n$ sudo grep include /etc/named.conf \n\ninclude \"/etc/crypto-policies/back-ends/bind.config\";' \n\nIf BIND is installed and the BIND config file doesn't contain the include \"/etc/crypto-policies/back-ends/bind.config\" directive, or the line is commented out, this is a finding.", + "fix": "Configure BIND to use the system crypto policy.\n\nAdd the following line to the \"options\" section in \"/etc/named.conf\":\n\ninclude \"/etc/crypto-policies/back-ends/bind.config\";" + }, + "impact": 0.5, + "refs": [ + { + "ref": "DPMS Target Red Hat Enterprise Linux 9" + } + ], + "tags": { + "check_id": "C-61983r926711_chk", + "severity": "medium", + "gid": "V-258242", + "rid": "SV-258242r926713_rule", + "stig_id": "RHEL-09-672050", + "gtitle": "SRG-OS-000423-GPOS-00187", + "fix_id": "F-61907r926712_fix", + "satisfies": [ + "SRG-OS-000423-GPOS-00187", + "SRG-OS-000426-GPOS-00190" + ], + "documentable": null, + "cci": [ + "CCI-002418", + "CCI-002422" + ], + "nist": [ + "SC-8", + "SC-8 (2)" + ] + } + } + ], + "groups": [ + { + "id": "controls/SV-257777.rb", + "title": null, + "controls": [ + "SV-257777" + ] + }, + { + "id": "controls/SV-257778.rb", + "title": null, + "controls": [ + "SV-257778" + ] + }, + { + "id": "controls/SV-257779.rb", + "title": null, + "controls": [ + "SV-257779" + ] + }, + { + "id": "controls/SV-257780.rb", + "title": null, + "controls": [ + "SV-257780" + ] + }, + { + "id": "controls/SV-257781.rb", + "title": null, + "controls": [ + "SV-257781" + ] + }, + { + "id": "controls/SV-257782.rb", + "title": null, + "controls": [ + "SV-257782" + ] + }, + { + "id": "controls/SV-257783.rb", + "title": null, + "controls": [ + "SV-257783" + ] + }, + { + "id": "controls/SV-257784.rb", + "title": null, + "controls": [ + "SV-257784" + ] + }, + { + "id": "controls/SV-257785.rb", + "title": null, + "controls": [ + "SV-257785" + ] + }, + { + "id": "controls/SV-257786.rb", + "title": null, + "controls": [ + "SV-257786" + ] + }, + { + "id": "controls/SV-257787.rb", + "title": null, + "controls": [ + "SV-257787" + ] + }, + { + "id": "controls/SV-257788.rb", + "title": null, + "controls": [ + "SV-257788" + ] + }, + { + "id": "controls/SV-257789.rb", + "title": null, + "controls": [ + "SV-257789" + ] + }, + { + "id": "controls/SV-257790.rb", + "title": null, + "controls": [ + "SV-257790" + ] + }, + { + "id": "controls/SV-257791.rb", + "title": null, + "controls": [ + "SV-257791" + ] + }, + { + "id": "controls/SV-257792.rb", + "title": null, + "controls": [ + "SV-257792" + ] + }, + { + "id": "controls/SV-257793.rb", + "title": null, + "controls": [ + "SV-257793" + ] + }, + { + "id": "controls/SV-257794.rb", + "title": null, + "controls": [ + "SV-257794" + ] + }, + { + "id": "controls/SV-257795.rb", + "title": null, + "controls": [ + "SV-257795" + ] + }, + { + "id": "controls/SV-257796.rb", + "title": null, + "controls": [ + "SV-257796" + ] + }, + { + "id": "controls/SV-257797.rb", + "title": null, + "controls": [ + "SV-257797" + ] + }, + { + "id": "controls/SV-257798.rb", + "title": null, + "controls": [ + "SV-257798" + ] + }, + { + "id": "controls/SV-257799.rb", + "title": null, + "controls": [ + "SV-257799" + ] + }, + { + "id": "controls/SV-257800.rb", + "title": null, + "controls": [ + "SV-257800" + ] + }, + { + "id": "controls/SV-257801.rb", + "title": null, + "controls": [ + "SV-257801" + ] + }, + { + "id": "controls/SV-257802.rb", + "title": null, + "controls": [ + "SV-257802" + ] + }, + { + "id": "controls/SV-257803.rb", + "title": null, + "controls": [ + "SV-257803" + ] + }, + { + "id": "controls/SV-257804.rb", + "title": null, + "controls": [ + "SV-257804" + ] + }, + { + "id": "controls/SV-257805.rb", + "title": null, + "controls": [ + "SV-257805" + ] + }, + { + "id": "controls/SV-257806.rb", + "title": null, + "controls": [ + "SV-257806" + ] + }, + { + "id": "controls/SV-257807.rb", + "title": null, + "controls": [ + "SV-257807" + ] + }, + { + "id": "controls/SV-257808.rb", + "title": null, + "controls": [ + "SV-257808" + ] + }, + { + "id": "controls/SV-257809.rb", + "title": null, + "controls": [ + "SV-257809" + ] + }, + { + "id": "controls/SV-257810.rb", + "title": null, + "controls": [ + "SV-257810" + ] + }, + { + "id": "controls/SV-257811.rb", + "title": null, + "controls": [ + "SV-257811" + ] + }, + { + "id": "controls/SV-257812.rb", + "title": null, + "controls": [ + "SV-257812" + ] + }, + { + "id": "controls/SV-257813.rb", + "title": null, + "controls": [ + "SV-257813" + ] + }, + { + "id": "controls/SV-257814.rb", + "title": null, + "controls": [ + "SV-257814" + ] + }, + { + "id": "controls/SV-257815.rb", + "title": null, + "controls": [ + "SV-257815" + ] + }, + { + "id": "controls/SV-257816.rb", + "title": null, + "controls": [ + "SV-257816" + ] + }, + { + "id": "controls/SV-257817.rb", + "title": null, + "controls": [ + "SV-257817" + ] + }, + { + "id": "controls/SV-257818.rb", + "title": null, + "controls": [ + "SV-257818" + ] + }, + { + "id": "controls/SV-257819.rb", + "title": null, + "controls": [ + "SV-257819" + ] + }, + { + "id": "controls/SV-257820.rb", + "title": null, + "controls": [ + "SV-257820" + ] + }, + { + "id": "controls/SV-257821.rb", + "title": null, + "controls": [ + "SV-257821" + ] + }, + { + "id": "controls/SV-257822.rb", + "title": null, + "controls": [ + "SV-257822" + ] + }, + { + "id": "controls/SV-257823.rb", + "title": null, + "controls": [ + "SV-257823" + ] + }, + { + "id": "controls/SV-257824.rb", + "title": null, + "controls": [ + "SV-257824" + ] + }, + { + "id": "controls/SV-257825.rb", + "title": null, + "controls": [ + "SV-257825" + ] + }, + { + "id": "controls/SV-257826.rb", + "title": null, + "controls": [ + "SV-257826" + ] + }, + { + "id": "controls/SV-257827.rb", + "title": null, + "controls": [ + "SV-257827" + ] + }, + { + "id": "controls/SV-257828.rb", + "title": null, + "controls": [ + "SV-257828" + ] + }, + { + "id": "controls/SV-257829.rb", + "title": null, + "controls": [ + "SV-257829" + ] + }, + { + "id": "controls/SV-257830.rb", + "title": null, + "controls": [ + "SV-257830" + ] + }, + { + "id": "controls/SV-257831.rb", + "title": null, + "controls": [ + "SV-257831" + ] + }, + { + "id": "controls/SV-257832.rb", + "title": null, + "controls": [ + "SV-257832" + ] + }, + { + "id": "controls/SV-257833.rb", + "title": null, + "controls": [ + "SV-257833" + ] + }, + { + "id": "controls/SV-257834.rb", + "title": null, + "controls": [ + "SV-257834" + ] + }, + { + "id": "controls/SV-257835.rb", + "title": null, + "controls": [ + "SV-257835" + ] + }, + { + "id": "controls/SV-257836.rb", + "title": null, + "controls": [ + "SV-257836" + ] + }, + { + "id": "controls/SV-257837.rb", + "title": null, + "controls": [ + "SV-257837" + ] + }, + { + "id": "controls/SV-257838.rb", + "title": null, + "controls": [ + "SV-257838" + ] + }, + { + "id": "controls/SV-257839.rb", + "title": null, + "controls": [ + "SV-257839" + ] + }, + { + "id": "controls/SV-257840.rb", + "title": null, + "controls": [ + "SV-257840" + ] + }, + { + "id": "controls/SV-257841.rb", + "title": null, + "controls": [ + "SV-257841" + ] + }, + { + "id": "controls/SV-257842.rb", + "title": null, + "controls": [ + "SV-257842" + ] + }, + { + "id": "controls/SV-257843.rb", + "title": null, + "controls": [ + "SV-257843" + ] + }, + { + "id": "controls/SV-257844.rb", + "title": null, + "controls": [ + "SV-257844" + ] + }, + { + "id": "controls/SV-257845.rb", + "title": null, + "controls": [ + "SV-257845" + ] + }, + { + "id": "controls/SV-257846.rb", + "title": null, + "controls": [ + "SV-257846" + ] + }, + { + "id": "controls/SV-257847.rb", + "title": null, + "controls": [ + "SV-257847" + ] + }, + { + "id": "controls/SV-257848.rb", + "title": null, + "controls": [ + "SV-257848" + ] + }, + { + "id": "controls/SV-257849.rb", + "title": null, + "controls": [ + "SV-257849" + ] + }, + { + "id": "controls/SV-257850.rb", + "title": null, + "controls": [ + "SV-257850" + ] + }, + { + "id": "controls/SV-257851.rb", + "title": null, + "controls": [ + "SV-257851" + ] + }, + { + "id": "controls/SV-257852.rb", + "title": null, + "controls": [ + "SV-257852" + ] + }, + { + "id": "controls/SV-257853.rb", + "title": null, + "controls": [ + "SV-257853" + ] + }, + { + "id": "controls/SV-257854.rb", + "title": null, + "controls": [ + "SV-257854" + ] + }, + { + "id": "controls/SV-257855.rb", + "title": null, + "controls": [ + "SV-257855" + ] + }, + { + "id": "controls/SV-257856.rb", + "title": null, + "controls": [ + "SV-257856" + ] + }, + { + "id": "controls/SV-257857.rb", + "title": null, + "controls": [ + "SV-257857" + ] + }, + { + "id": "controls/SV-257858.rb", + "title": null, + "controls": [ + "SV-257858" + ] + }, + { + "id": "controls/SV-257859.rb", + "title": null, + "controls": [ + "SV-257859" + ] + }, + { + "id": "controls/SV-257860.rb", + "title": null, + "controls": [ + "SV-257860" + ] + }, + { + "id": "controls/SV-257861.rb", + "title": null, + "controls": [ + "SV-257861" + ] + }, + { + "id": "controls/SV-257862.rb", + "title": null, + "controls": [ + "SV-257862" + ] + }, + { + "id": "controls/SV-257863.rb", + "title": null, + "controls": [ + "SV-257863" + ] + }, + { + "id": "controls/SV-257864.rb", + "title": null, + "controls": [ + "SV-257864" + ] + }, + { + "id": "controls/SV-257865.rb", + "title": null, + "controls": [ + "SV-257865" + ] + }, + { + "id": "controls/SV-257866.rb", + "title": null, + "controls": [ + "SV-257866" + ] + }, + { + "id": "controls/SV-257867.rb", + "title": null, + "controls": [ + "SV-257867" + ] + }, + { + "id": "controls/SV-257868.rb", + "title": null, + "controls": [ + "SV-257868" + ] + }, + { + "id": "controls/SV-257869.rb", + "title": null, + "controls": [ + "SV-257869" + ] + }, + { + "id": "controls/SV-257870.rb", + "title": null, + "controls": [ + "SV-257870" + ] + }, + { + "id": "controls/SV-257871.rb", + "title": null, + "controls": [ + "SV-257871" + ] + }, + { + "id": "controls/SV-257872.rb", + "title": null, + "controls": [ + "SV-257872" + ] + }, + { + "id": "controls/SV-257873.rb", + "title": null, + "controls": [ + "SV-257873" + ] + }, + { + "id": "controls/SV-257874.rb", + "title": null, + "controls": [ + "SV-257874" + ] + }, + { + "id": "controls/SV-257875.rb", + "title": null, + "controls": [ + "SV-257875" + ] + }, + { + "id": "controls/SV-257876.rb", + "title": null, + "controls": [ + "SV-257876" + ] + }, + { + "id": "controls/SV-257877.rb", + "title": null, + "controls": [ + "SV-257877" + ] + }, + { + "id": "controls/SV-257878.rb", + "title": null, + "controls": [ + "SV-257878" + ] + }, + { + "id": "controls/SV-257879.rb", + "title": null, + "controls": [ + "SV-257879" + ] + }, + { + "id": "controls/SV-257880.rb", + "title": null, + "controls": [ + "SV-257880" + ] + }, + { + "id": "controls/SV-257881.rb", + "title": null, + "controls": [ + "SV-257881" + ] + }, + { + "id": "controls/SV-257882.rb", + "title": null, + "controls": [ + "SV-257882" + ] + }, + { + "id": "controls/SV-257883.rb", + "title": null, + "controls": [ + "SV-257883" + ] + }, + { + "id": "controls/SV-257884.rb", + "title": null, + "controls": [ + "SV-257884" + ] + }, + { + "id": "controls/SV-257885.rb", + "title": null, + "controls": [ + "SV-257885" + ] + }, + { + "id": "controls/SV-257886.rb", + "title": null, + "controls": [ + "SV-257886" + ] + }, + { + "id": "controls/SV-257887.rb", + "title": null, + "controls": [ + "SV-257887" + ] + }, + { + "id": "controls/SV-257888.rb", + "title": null, + "controls": [ + "SV-257888" + ] + }, + { + "id": "controls/SV-257889.rb", + "title": null, + "controls": [ + "SV-257889" + ] + }, + { + "id": "controls/SV-257890.rb", + "title": null, + "controls": [ + "SV-257890" + ] + }, + { + "id": "controls/SV-257891.rb", + "title": null, + "controls": [ + "SV-257891" + ] + }, + { + "id": "controls/SV-257892.rb", + "title": null, + "controls": [ + "SV-257892" + ] + }, + { + "id": "controls/SV-257893.rb", + "title": null, + "controls": [ + "SV-257893" + ] + }, + { + "id": "controls/SV-257894.rb", + "title": null, + "controls": [ + "SV-257894" + ] + }, + { + "id": "controls/SV-257895.rb", + "title": null, + "controls": [ + "SV-257895" + ] + }, + { + "id": "controls/SV-257896.rb", + "title": null, + "controls": [ + "SV-257896" + ] + }, + { + "id": "controls/SV-257897.rb", + "title": null, + "controls": [ + "SV-257897" + ] + }, + { + "id": "controls/SV-257898.rb", + "title": null, + "controls": [ + "SV-257898" + ] + }, + { + "id": "controls/SV-257899.rb", + "title": null, + "controls": [ + "SV-257899" + ] + }, + { + "id": "controls/SV-257900.rb", + "title": null, + "controls": [ + "SV-257900" + ] + }, + { + "id": "controls/SV-257901.rb", + "title": null, + "controls": [ + "SV-257901" + ] + }, + { + "id": "controls/SV-257902.rb", + "title": null, + "controls": [ + "SV-257902" + ] + }, + { + "id": "controls/SV-257903.rb", + "title": null, + "controls": [ + "SV-257903" + ] + }, + { + "id": "controls/SV-257904.rb", + "title": null, + "controls": [ + "SV-257904" + ] + }, + { + "id": "controls/SV-257905.rb", + "title": null, + "controls": [ + "SV-257905" + ] + }, + { + "id": "controls/SV-257906.rb", + "title": null, + "controls": [ + "SV-257906" + ] + }, + { + "id": "controls/SV-257907.rb", + "title": null, + "controls": [ + "SV-257907" + ] + }, + { + "id": "controls/SV-257908.rb", + "title": null, + "controls": [ + "SV-257908" + ] + }, + { + "id": "controls/SV-257909.rb", + "title": null, + "controls": [ + "SV-257909" + ] + }, + { + "id": "controls/SV-257910.rb", + "title": null, + "controls": [ + "SV-257910" + ] + }, + { + "id": "controls/SV-257911.rb", + "title": null, + "controls": [ + "SV-257911" + ] + }, + { + "id": "controls/SV-257912.rb", + "title": null, + "controls": [ + "SV-257912" + ] + }, + { + "id": "controls/SV-257913.rb", + "title": null, + "controls": [ + "SV-257913" + ] + }, + { + "id": "controls/SV-257914.rb", + "title": null, + "controls": [ + "SV-257914" + ] + }, + { + "id": "controls/SV-257915.rb", + "title": null, + "controls": [ + "SV-257915" + ] + }, + { + "id": "controls/SV-257916.rb", + "title": null, + "controls": [ + "SV-257916" + ] + }, + { + "id": "controls/SV-257917.rb", + "title": null, + "controls": [ + "SV-257917" + ] + }, + { + "id": "controls/SV-257918.rb", + "title": null, + "controls": [ + "SV-257918" + ] + }, + { + "id": "controls/SV-257919.rb", + "title": null, + "controls": [ + "SV-257919" + ] + }, + { + "id": "controls/SV-257920.rb", + "title": null, + "controls": [ + "SV-257920" + ] + }, + { + "id": "controls/SV-257921.rb", + "title": null, + "controls": [ + "SV-257921" + ] + }, + { + "id": "controls/SV-257922.rb", + "title": null, + "controls": [ + "SV-257922" + ] + }, + { + "id": "controls/SV-257923.rb", + "title": null, + "controls": [ + "SV-257923" + ] + }, + { + "id": "controls/SV-257924.rb", + "title": null, + "controls": [ + "SV-257924" + ] + }, + { + "id": "controls/SV-257925.rb", + "title": null, + "controls": [ + "SV-257925" + ] + }, + { + "id": "controls/SV-257926.rb", + "title": null, + "controls": [ + "SV-257926" + ] + }, + { + "id": "controls/SV-257927.rb", + "title": null, + "controls": [ + "SV-257927" + ] + }, + { + "id": "controls/SV-257928.rb", + "title": null, + "controls": [ + "SV-257928" + ] + }, + { + "id": "controls/SV-257929.rb", + "title": null, + "controls": [ + "SV-257929" + ] + }, + { + "id": "controls/SV-257930.rb", + "title": null, + "controls": [ + "SV-257930" + ] + }, + { + "id": "controls/SV-257931.rb", + "title": null, + "controls": [ + "SV-257931" + ] + }, + { + "id": "controls/SV-257932.rb", + "title": null, + "controls": [ + "SV-257932" + ] + }, + { + "id": "controls/SV-257933.rb", + "title": null, + "controls": [ + "SV-257933" + ] + }, + { + "id": "controls/SV-257934.rb", + "title": null, + "controls": [ + "SV-257934" + ] + }, + { + "id": "controls/SV-257935.rb", + "title": null, + "controls": [ + "SV-257935" + ] + }, + { + "id": "controls/SV-257936.rb", + "title": null, + "controls": [ + "SV-257936" + ] + }, + { + "id": "controls/SV-257937.rb", + "title": null, + "controls": [ + "SV-257937" + ] + }, + { + "id": "controls/SV-257938.rb", + "title": null, + "controls": [ + "SV-257938" + ] + }, + { + "id": "controls/SV-257939.rb", + "title": null, + "controls": [ + "SV-257939" + ] + }, + { + "id": "controls/SV-257940.rb", + "title": null, + "controls": [ + "SV-257940" + ] + }, + { + "id": "controls/SV-257941.rb", + "title": null, + "controls": [ + "SV-257941" + ] + }, + { + "id": "controls/SV-257942.rb", + "title": null, + "controls": [ + "SV-257942" + ] + }, + { + "id": "controls/SV-257943.rb", + "title": null, + "controls": [ + "SV-257943" + ] + }, + { + "id": "controls/SV-257944.rb", + "title": null, + "controls": [ + "SV-257944" + ] + }, + { + "id": "controls/SV-257945.rb", + "title": null, + "controls": [ + "SV-257945" + ] + }, + { + "id": "controls/SV-257946.rb", + "title": null, + "controls": [ + "SV-257946" + ] + }, + { + "id": "controls/SV-257947.rb", + "title": null, + "controls": [ + "SV-257947" + ] + }, + { + "id": "controls/SV-257948.rb", + "title": null, + "controls": [ + "SV-257948" + ] + }, + { + "id": "controls/SV-257949.rb", + "title": null, + "controls": [ + "SV-257949" + ] + }, + { + "id": "controls/SV-257950.rb", + "title": null, + "controls": [ + "SV-257950" + ] + }, + { + "id": "controls/SV-257951.rb", + "title": null, + "controls": [ + "SV-257951" + ] + }, + { + "id": "controls/SV-257952.rb", + "title": null, + "controls": [ + "SV-257952" + ] + }, + { + "id": "controls/SV-257953.rb", + "title": null, + "controls": [ + "SV-257953" + ] + }, + { + "id": "controls/SV-257954.rb", + "title": null, + "controls": [ + "SV-257954" + ] + }, + { + "id": "controls/SV-257955.rb", + "title": null, + "controls": [ + "SV-257955" + ] + }, + { + "id": "controls/SV-257956.rb", + "title": null, + "controls": [ + "SV-257956" + ] + }, + { + "id": "controls/SV-257957.rb", + "title": null, + "controls": [ + "SV-257957" + ] + }, + { + "id": "controls/SV-257958.rb", + "title": null, + "controls": [ + "SV-257958" + ] + }, + { + "id": "controls/SV-257959.rb", + "title": null, + "controls": [ + "SV-257959" + ] + }, + { + "id": "controls/SV-257960.rb", + "title": null, + "controls": [ + "SV-257960" + ] + }, + { + "id": "controls/SV-257961.rb", + "title": null, + "controls": [ + "SV-257961" + ] + }, + { + "id": "controls/SV-257962.rb", + "title": null, + "controls": [ + "SV-257962" + ] + }, + { + "id": "controls/SV-257963.rb", + "title": null, + "controls": [ + "SV-257963" + ] + }, + { + "id": "controls/SV-257964.rb", + "title": null, + "controls": [ + "SV-257964" + ] + }, + { + "id": "controls/SV-257965.rb", + "title": null, + "controls": [ + "SV-257965" + ] + }, + { + "id": "controls/SV-257966.rb", + "title": null, + "controls": [ + "SV-257966" + ] + }, + { + "id": "controls/SV-257967.rb", + "title": null, + "controls": [ + "SV-257967" + ] + }, + { + "id": "controls/SV-257968.rb", + "title": null, + "controls": [ + "SV-257968" + ] + }, + { + "id": "controls/SV-257969.rb", + "title": null, + "controls": [ + "SV-257969" + ] + }, + { + "id": "controls/SV-257970.rb", + "title": null, + "controls": [ + "SV-257970" + ] + }, + { + "id": "controls/SV-257971.rb", + "title": null, + "controls": [ + "SV-257971" + ] + }, + { + "id": "controls/SV-257972.rb", + "title": null, + "controls": [ + "SV-257972" + ] + }, + { + "id": "controls/SV-257973.rb", + "title": null, + "controls": [ + "SV-257973" + ] + }, + { + "id": "controls/SV-257974.rb", + "title": null, + "controls": [ + "SV-257974" + ] + }, + { + "id": "controls/SV-257975.rb", + "title": null, + "controls": [ + "SV-257975" + ] + }, + { + "id": "controls/SV-257976.rb", + "title": null, + "controls": [ + "SV-257976" + ] + }, + { + "id": "controls/SV-257977.rb", + "title": null, + "controls": [ + "SV-257977" + ] + }, + { + "id": "controls/SV-257978.rb", + "title": null, + "controls": [ + "SV-257978" + ] + }, + { + "id": "controls/SV-257979.rb", + "title": null, + "controls": [ + "SV-257979" + ] + }, + { + "id": "controls/SV-257980.rb", + "title": null, + "controls": [ + "SV-257980" + ] + }, + { + "id": "controls/SV-257981.rb", + "title": null, + "controls": [ + "SV-257981" + ] + }, + { + "id": "controls/SV-257982.rb", + "title": null, + "controls": [ + "SV-257982" + ] + }, + { + "id": "controls/SV-257983.rb", + "title": null, + "controls": [ + "SV-257983" + ] + }, + { + "id": "controls/SV-257984.rb", + "title": null, + "controls": [ + "SV-257984" + ] + }, + { + "id": "controls/SV-257985.rb", + "title": null, + "controls": [ + "SV-257985" + ] + }, + { + "id": "controls/SV-257986.rb", + "title": null, + "controls": [ + "SV-257986" + ] + }, + { + "id": "controls/SV-257987.rb", + "title": null, + "controls": [ + "SV-257987" + ] + }, + { + "id": "controls/SV-257988.rb", + "title": null, + "controls": [ + "SV-257988" + ] + }, + { + "id": "controls/SV-257989.rb", + "title": null, + "controls": [ + "SV-257989" + ] + }, + { + "id": "controls/SV-257990.rb", + "title": null, + "controls": [ + "SV-257990" + ] + }, + { + "id": "controls/SV-257991.rb", + "title": null, + "controls": [ + "SV-257991" + ] + }, + { + "id": "controls/SV-257992.rb", + "title": null, + "controls": [ + "SV-257992" + ] + }, + { + "id": "controls/SV-257993.rb", + "title": null, + "controls": [ + "SV-257993" + ] + }, + { + "id": "controls/SV-257994.rb", + "title": null, + "controls": [ + "SV-257994" + ] + }, + { + "id": "controls/SV-257995.rb", + "title": null, + "controls": [ + "SV-257995" + ] + }, + { + "id": "controls/SV-257996.rb", + "title": null, + "controls": [ + "SV-257996" + ] + }, + { + "id": "controls/SV-257997.rb", + "title": null, + "controls": [ + "SV-257997" + ] + }, + { + "id": "controls/SV-257998.rb", + "title": null, + "controls": [ + "SV-257998" + ] + }, + { + "id": "controls/SV-257999.rb", + "title": null, + "controls": [ + "SV-257999" + ] + }, + { + "id": "controls/SV-258000.rb", + "title": null, + "controls": [ + "SV-258000" + ] + }, + { + "id": "controls/SV-258001.rb", + "title": null, + "controls": [ + "SV-258001" + ] + }, + { + "id": "controls/SV-258002.rb", + "title": null, + "controls": [ + "SV-258002" + ] + }, + { + "id": "controls/SV-258003.rb", + "title": null, + "controls": [ + "SV-258003" + ] + }, + { + "id": "controls/SV-258004.rb", + "title": null, + "controls": [ + "SV-258004" + ] + }, + { + "id": "controls/SV-258005.rb", + "title": null, + "controls": [ + "SV-258005" + ] + }, + { + "id": "controls/SV-258006.rb", + "title": null, + "controls": [ + "SV-258006" + ] + }, + { + "id": "controls/SV-258007.rb", + "title": null, + "controls": [ + "SV-258007" + ] + }, + { + "id": "controls/SV-258008.rb", + "title": null, + "controls": [ + "SV-258008" + ] + }, + { + "id": "controls/SV-258009.rb", + "title": null, + "controls": [ + "SV-258009" + ] + }, + { + "id": "controls/SV-258010.rb", + "title": null, + "controls": [ + "SV-258010" + ] + }, + { + "id": "controls/SV-258011.rb", + "title": null, + "controls": [ + "SV-258011" + ] + }, + { + "id": "controls/SV-258012.rb", + "title": null, + "controls": [ + "SV-258012" + ] + }, + { + "id": "controls/SV-258013.rb", + "title": null, + "controls": [ + "SV-258013" + ] + }, + { + "id": "controls/SV-258014.rb", + "title": null, + "controls": [ + "SV-258014" + ] + }, + { + "id": "controls/SV-258015.rb", + "title": null, + "controls": [ + "SV-258015" + ] + }, + { + "id": "controls/SV-258016.rb", + "title": null, + "controls": [ + "SV-258016" + ] + }, + { + "id": "controls/SV-258017.rb", + "title": null, + "controls": [ + "SV-258017" + ] + }, + { + "id": "controls/SV-258018.rb", + "title": null, + "controls": [ + "SV-258018" + ] + }, + { + "id": "controls/SV-258019.rb", + "title": null, + "controls": [ + "SV-258019" + ] + }, + { + "id": "controls/SV-258020.rb", + "title": null, + "controls": [ + "SV-258020" + ] + }, + { + "id": "controls/SV-258021.rb", + "title": null, + "controls": [ + "SV-258021" + ] + }, + { + "id": "controls/SV-258022.rb", + "title": null, + "controls": [ + "SV-258022" + ] + }, + { + "id": "controls/SV-258023.rb", + "title": null, + "controls": [ + "SV-258023" + ] + }, + { + "id": "controls/SV-258024.rb", + "title": null, + "controls": [ + "SV-258024" + ] + }, + { + "id": "controls/SV-258025.rb", + "title": null, + "controls": [ + "SV-258025" + ] + }, + { + "id": "controls/SV-258026.rb", + "title": null, + "controls": [ + "SV-258026" + ] + }, + { + "id": "controls/SV-258027.rb", + "title": null, + "controls": [ + "SV-258027" + ] + }, + { + "id": "controls/SV-258028.rb", + "title": null, + "controls": [ + "SV-258028" + ] + }, + { + "id": "controls/SV-258029.rb", + "title": null, + "controls": [ + "SV-258029" + ] + }, + { + "id": "controls/SV-258030.rb", + "title": null, + "controls": [ + "SV-258030" + ] + }, + { + "id": "controls/SV-258031.rb", + "title": null, + "controls": [ + "SV-258031" + ] + }, + { + "id": "controls/SV-258032.rb", + "title": null, + "controls": [ + "SV-258032" + ] + }, + { + "id": "controls/SV-258033.rb", + "title": null, + "controls": [ + "SV-258033" + ] + }, + { + "id": "controls/SV-258034.rb", + "title": null, + "controls": [ + "SV-258034" + ] + }, + { + "id": "controls/SV-258035.rb", + "title": null, + "controls": [ + "SV-258035" + ] + }, + { + "id": "controls/SV-258036.rb", + "title": null, + "controls": [ + "SV-258036" + ] + }, + { + "id": "controls/SV-258037.rb", + "title": null, + "controls": [ + "SV-258037" + ] + }, + { + "id": "controls/SV-258038.rb", + "title": null, + "controls": [ + "SV-258038" + ] + }, + { + "id": "controls/SV-258039.rb", + "title": null, + "controls": [ + "SV-258039" + ] + }, + { + "id": "controls/SV-258040.rb", + "title": null, + "controls": [ + "SV-258040" + ] + }, + { + "id": "controls/SV-258041.rb", + "title": null, + "controls": [ + "SV-258041" + ] + }, + { + "id": "controls/SV-258042.rb", + "title": null, + "controls": [ + "SV-258042" + ] + }, + { + "id": "controls/SV-258043.rb", + "title": null, + "controls": [ + "SV-258043" + ] + }, + { + "id": "controls/SV-258044.rb", + "title": null, + "controls": [ + "SV-258044" + ] + }, + { + "id": "controls/SV-258045.rb", + "title": null, + "controls": [ + "SV-258045" + ] + }, + { + "id": "controls/SV-258046.rb", + "title": null, + "controls": [ + "SV-258046" + ] + }, + { + "id": "controls/SV-258047.rb", + "title": null, + "controls": [ + "SV-258047" + ] + }, + { + "id": "controls/SV-258048.rb", + "title": null, + "controls": [ + "SV-258048" + ] + }, + { + "id": "controls/SV-258049.rb", + "title": null, + "controls": [ + "SV-258049" + ] + }, + { + "id": "controls/SV-258050.rb", + "title": null, + "controls": [ + "SV-258050" + ] + }, + { + "id": "controls/SV-258051.rb", + "title": null, + "controls": [ + "SV-258051" + ] + }, + { + "id": "controls/SV-258052.rb", + "title": null, + "controls": [ + "SV-258052" + ] + }, + { + "id": "controls/SV-258053.rb", + "title": null, + "controls": [ + "SV-258053" + ] + }, + { + "id": "controls/SV-258054.rb", + "title": null, + "controls": [ + "SV-258054" + ] + }, + { + "id": "controls/SV-258055.rb", + "title": null, + "controls": [ + "SV-258055" + ] + }, + { + "id": "controls/SV-258056.rb", + "title": null, + "controls": [ + "SV-258056" + ] + }, + { + "id": "controls/SV-258057.rb", + "title": null, + "controls": [ + "SV-258057" + ] + }, + { + "id": "controls/SV-258058.rb", + "title": null, + "controls": [ + "SV-258058" + ] + }, + { + "id": "controls/SV-258059.rb", + "title": null, + "controls": [ + "SV-258059" + ] + }, + { + "id": "controls/SV-258060.rb", + "title": null, + "controls": [ + "SV-258060" + ] + }, + { + "id": "controls/SV-258061.rb", + "title": null, + "controls": [ + "SV-258061" + ] + }, + { + "id": "controls/SV-258062.rb", + "title": null, + "controls": [ + "SV-258062" + ] + }, + { + "id": "controls/SV-258063.rb", + "title": null, + "controls": [ + "SV-258063" + ] + }, + { + "id": "controls/SV-258064.rb", + "title": null, + "controls": [ + "SV-258064" + ] + }, + { + "id": "controls/SV-258065.rb", + "title": null, + "controls": [ + "SV-258065" + ] + }, + { + "id": "controls/SV-258066.rb", + "title": null, + "controls": [ + "SV-258066" + ] + }, + { + "id": "controls/SV-258067.rb", + "title": null, + "controls": [ + "SV-258067" + ] + }, + { + "id": "controls/SV-258068.rb", + "title": null, + "controls": [ + "SV-258068" + ] + }, + { + "id": "controls/SV-258069.rb", + "title": null, + "controls": [ + "SV-258069" + ] + }, + { + "id": "controls/SV-258070.rb", + "title": null, + "controls": [ + "SV-258070" + ] + }, + { + "id": "controls/SV-258071.rb", + "title": null, + "controls": [ + "SV-258071" + ] + }, + { + "id": "controls/SV-258072.rb", + "title": null, + "controls": [ + "SV-258072" + ] + }, + { + "id": "controls/SV-258073.rb", + "title": null, + "controls": [ + "SV-258073" + ] + }, + { + "id": "controls/SV-258074.rb", + "title": null, + "controls": [ + "SV-258074" + ] + }, + { + "id": "controls/SV-258075.rb", + "title": null, + "controls": [ + "SV-258075" + ] + }, + { + "id": "controls/SV-258076.rb", + "title": null, + "controls": [ + "SV-258076" + ] + }, + { + "id": "controls/SV-258077.rb", + "title": null, + "controls": [ + "SV-258077" + ] + }, + { + "id": "controls/SV-258078.rb", + "title": null, + "controls": [ + "SV-258078" + ] + }, + { + "id": "controls/SV-258079.rb", + "title": null, + "controls": [ + "SV-258079" + ] + }, + { + "id": "controls/SV-258080.rb", + "title": null, + "controls": [ + "SV-258080" + ] + }, + { + "id": "controls/SV-258081.rb", + "title": null, + "controls": [ + "SV-258081" + ] + }, + { + "id": "controls/SV-258082.rb", + "title": null, + "controls": [ + "SV-258082" + ] + }, + { + "id": "controls/SV-258083.rb", + "title": null, + "controls": [ + "SV-258083" + ] + }, + { + "id": "controls/SV-258084.rb", + "title": null, + "controls": [ + "SV-258084" + ] + }, + { + "id": "controls/SV-258085.rb", + "title": null, + "controls": [ + "SV-258085" + ] + }, + { + "id": "controls/SV-258086.rb", + "title": null, + "controls": [ + "SV-258086" + ] + }, + { + "id": "controls/SV-258087.rb", + "title": null, + "controls": [ + "SV-258087" + ] + }, + { + "id": "controls/SV-258088.rb", + "title": null, + "controls": [ + "SV-258088" + ] + }, + { + "id": "controls/SV-258089.rb", + "title": null, + "controls": [ + "SV-258089" + ] + }, + { + "id": "controls/SV-258090.rb", + "title": null, + "controls": [ + "SV-258090" + ] + }, + { + "id": "controls/SV-258091.rb", + "title": null, + "controls": [ + "SV-258091" + ] + }, + { + "id": "controls/SV-258092.rb", + "title": null, + "controls": [ + "SV-258092" + ] + }, + { + "id": "controls/SV-258093.rb", + "title": null, + "controls": [ + "SV-258093" + ] + }, + { + "id": "controls/SV-258094.rb", + "title": null, + "controls": [ + "SV-258094" + ] + }, + { + "id": "controls/SV-258095.rb", + "title": null, + "controls": [ + "SV-258095" + ] + }, + { + "id": "controls/SV-258096.rb", + "title": null, + "controls": [ + "SV-258096" + ] + }, + { + "id": "controls/SV-258097.rb", + "title": null, + "controls": [ + "SV-258097" + ] + }, + { + "id": "controls/SV-258098.rb", + "title": null, + "controls": [ + "SV-258098" + ] + }, + { + "id": "controls/SV-258099.rb", + "title": null, + "controls": [ + "SV-258099" + ] + }, + { + "id": "controls/SV-258100.rb", + "title": null, + "controls": [ + "SV-258100" + ] + }, + { + "id": "controls/SV-258101.rb", + "title": null, + "controls": [ + "SV-258101" + ] + }, + { + "id": "controls/SV-258102.rb", + "title": null, + "controls": [ + "SV-258102" + ] + }, + { + "id": "controls/SV-258103.rb", + "title": null, + "controls": [ + "SV-258103" + ] + }, + { + "id": "controls/SV-258104.rb", + "title": null, + "controls": [ + "SV-258104" + ] + }, + { + "id": "controls/SV-258105.rb", + "title": null, + "controls": [ + "SV-258105" + ] + }, + { + "id": "controls/SV-258106.rb", + "title": null, + "controls": [ + "SV-258106" + ] + }, + { + "id": "controls/SV-258107.rb", + "title": null, + "controls": [ + "SV-258107" + ] + }, + { + "id": "controls/SV-258108.rb", + "title": null, + "controls": [ + "SV-258108" + ] + }, + { + "id": "controls/SV-258109.rb", + "title": null, + "controls": [ + "SV-258109" + ] + }, + { + "id": "controls/SV-258110.rb", + "title": null, + "controls": [ + "SV-258110" + ] + }, + { + "id": "controls/SV-258111.rb", + "title": null, + "controls": [ + "SV-258111" + ] + }, + { + "id": "controls/SV-258112.rb", + "title": null, + "controls": [ + "SV-258112" + ] + }, + { + "id": "controls/SV-258113.rb", + "title": null, + "controls": [ + "SV-258113" + ] + }, + { + "id": "controls/SV-258114.rb", + "title": null, + "controls": [ + "SV-258114" + ] + }, + { + "id": "controls/SV-258115.rb", + "title": null, + "controls": [ + "SV-258115" + ] + }, + { + "id": "controls/SV-258116.rb", + "title": null, + "controls": [ + "SV-258116" + ] + }, + { + "id": "controls/SV-258117.rb", + "title": null, + "controls": [ + "SV-258117" + ] + }, + { + "id": "controls/SV-258118.rb", + "title": null, + "controls": [ + "SV-258118" + ] + }, + { + "id": "controls/SV-258119.rb", + "title": null, + "controls": [ + "SV-258119" + ] + }, + { + "id": "controls/SV-258120.rb", + "title": null, + "controls": [ + "SV-258120" + ] + }, + { + "id": "controls/SV-258121.rb", + "title": null, + "controls": [ + "SV-258121" + ] + }, + { + "id": "controls/SV-258122.rb", + "title": null, + "controls": [ + "SV-258122" + ] + }, + { + "id": "controls/SV-258123.rb", + "title": null, + "controls": [ + "SV-258123" + ] + }, + { + "id": "controls/SV-258124.rb", + "title": null, + "controls": [ + "SV-258124" + ] + }, + { + "id": "controls/SV-258125.rb", + "title": null, + "controls": [ + "SV-258125" + ] + }, + { + "id": "controls/SV-258126.rb", + "title": null, + "controls": [ + "SV-258126" + ] + }, + { + "id": "controls/SV-258127.rb", + "title": null, + "controls": [ + "SV-258127" + ] + }, + { + "id": "controls/SV-258128.rb", + "title": null, + "controls": [ + "SV-258128" + ] + }, + { + "id": "controls/SV-258129.rb", + "title": null, + "controls": [ + "SV-258129" + ] + }, + { + "id": "controls/SV-258130.rb", + "title": null, + "controls": [ + "SV-258130" + ] + }, + { + "id": "controls/SV-258131.rb", + "title": null, + "controls": [ + "SV-258131" + ] + }, + { + "id": "controls/SV-258132.rb", + "title": null, + "controls": [ + "SV-258132" + ] + }, + { + "id": "controls/SV-258133.rb", + "title": null, + "controls": [ + "SV-258133" + ] + }, + { + "id": "controls/SV-258134.rb", + "title": null, + "controls": [ + "SV-258134" + ] + }, + { + "id": "controls/SV-258135.rb", + "title": null, + "controls": [ + "SV-258135" + ] + }, + { + "id": "controls/SV-258136.rb", + "title": null, + "controls": [ + "SV-258136" + ] + }, + { + "id": "controls/SV-258137.rb", + "title": null, + "controls": [ + "SV-258137" + ] + }, + { + "id": "controls/SV-258138.rb", + "title": null, + "controls": [ + "SV-258138" + ] + }, + { + "id": "controls/SV-258139.rb", + "title": null, + "controls": [ + "SV-258139" + ] + }, + { + "id": "controls/SV-258140.rb", + "title": null, + "controls": [ + "SV-258140" + ] + }, + { + "id": "controls/SV-258141.rb", + "title": null, + "controls": [ + "SV-258141" + ] + }, + { + "id": "controls/SV-258142.rb", + "title": null, + "controls": [ + "SV-258142" + ] + }, + { + "id": "controls/SV-258143.rb", + "title": null, + "controls": [ + "SV-258143" + ] + }, + { + "id": "controls/SV-258144.rb", + "title": null, + "controls": [ + "SV-258144" + ] + }, + { + "id": "controls/SV-258145.rb", + "title": null, + "controls": [ + "SV-258145" + ] + }, + { + "id": "controls/SV-258146.rb", + "title": null, + "controls": [ + "SV-258146" + ] + }, + { + "id": "controls/SV-258147.rb", + "title": null, + "controls": [ + "SV-258147" + ] + }, + { + "id": "controls/SV-258148.rb", + "title": null, + "controls": [ + "SV-258148" + ] + }, + { + "id": "controls/SV-258149.rb", + "title": null, + "controls": [ + "SV-258149" + ] + }, + { + "id": "controls/SV-258150.rb", + "title": null, + "controls": [ + "SV-258150" + ] + }, + { + "id": "controls/SV-258151.rb", + "title": null, + "controls": [ + "SV-258151" + ] + }, + { + "id": "controls/SV-258152.rb", + "title": null, + "controls": [ + "SV-258152" + ] + }, + { + "id": "controls/SV-258153.rb", + "title": null, + "controls": [ + "SV-258153" + ] + }, + { + "id": "controls/SV-258154.rb", + "title": null, + "controls": [ + "SV-258154" + ] + }, + { + "id": "controls/SV-258155.rb", + "title": null, + "controls": [ + "SV-258155" + ] + }, + { + "id": "controls/SV-258156.rb", + "title": null, + "controls": [ + "SV-258156" + ] + }, + { + "id": "controls/SV-258157.rb", + "title": null, + "controls": [ + "SV-258157" + ] + }, + { + "id": "controls/SV-258158.rb", + "title": null, + "controls": [ + "SV-258158" + ] + }, + { + "id": "controls/SV-258159.rb", + "title": null, + "controls": [ + "SV-258159" + ] + }, + { + "id": "controls/SV-258160.rb", + "title": null, + "controls": [ + "SV-258160" + ] + }, + { + "id": "controls/SV-258161.rb", + "title": null, + "controls": [ + "SV-258161" + ] + }, + { + "id": "controls/SV-258162.rb", + "title": null, + "controls": [ + "SV-258162" + ] + }, + { + "id": "controls/SV-258163.rb", + "title": null, + "controls": [ + "SV-258163" + ] + }, + { + "id": "controls/SV-258164.rb", + "title": null, + "controls": [ + "SV-258164" + ] + }, + { + "id": "controls/SV-258165.rb", + "title": null, + "controls": [ + "SV-258165" + ] + }, + { + "id": "controls/SV-258166.rb", + "title": null, + "controls": [ + "SV-258166" + ] + }, + { + "id": "controls/SV-258167.rb", + "title": null, + "controls": [ + "SV-258167" + ] + }, + { + "id": "controls/SV-258168.rb", + "title": null, + "controls": [ + "SV-258168" + ] + }, + { + "id": "controls/SV-258169.rb", + "title": null, + "controls": [ + "SV-258169" + ] + }, + { + "id": "controls/SV-258170.rb", + "title": null, + "controls": [ + "SV-258170" + ] + }, + { + "id": "controls/SV-258171.rb", + "title": null, + "controls": [ + "SV-258171" + ] + }, + { + "id": "controls/SV-258172.rb", + "title": null, + "controls": [ + "SV-258172" + ] + }, + { + "id": "controls/SV-258173.rb", + "title": null, + "controls": [ + "SV-258173" + ] + }, + { + "id": "controls/SV-258174.rb", + "title": null, + "controls": [ + "SV-258174" + ] + }, + { + "id": "controls/SV-258175.rb", + "title": null, + "controls": [ + "SV-258175" + ] + }, + { + "id": "controls/SV-258176.rb", + "title": null, + "controls": [ + "SV-258176" + ] + }, + { + "id": "controls/SV-258177.rb", + "title": null, + "controls": [ + "SV-258177" + ] + }, + { + "id": "controls/SV-258178.rb", + "title": null, + "controls": [ + "SV-258178" + ] + }, + { + "id": "controls/SV-258179.rb", + "title": null, + "controls": [ + "SV-258179" + ] + }, + { + "id": "controls/SV-258180.rb", + "title": null, + "controls": [ + "SV-258180" + ] + }, + { + "id": "controls/SV-258181.rb", + "title": null, + "controls": [ + "SV-258181" + ] + }, + { + "id": "controls/SV-258182.rb", + "title": null, + "controls": [ + "SV-258182" + ] + }, + { + "id": "controls/SV-258183.rb", + "title": null, + "controls": [ + "SV-258183" + ] + }, + { + "id": "controls/SV-258184.rb", + "title": null, + "controls": [ + "SV-258184" + ] + }, + { + "id": "controls/SV-258185.rb", + "title": null, + "controls": [ + "SV-258185" + ] + }, + { + "id": "controls/SV-258186.rb", + "title": null, + "controls": [ + "SV-258186" + ] + }, + { + "id": "controls/SV-258187.rb", + "title": null, + "controls": [ + "SV-258187" + ] + }, + { + "id": "controls/SV-258188.rb", + "title": null, + "controls": [ + "SV-258188" + ] + }, + { + "id": "controls/SV-258189.rb", + "title": null, + "controls": [ + "SV-258189" + ] + }, + { + "id": "controls/SV-258190.rb", + "title": null, + "controls": [ + "SV-258190" + ] + }, + { + "id": "controls/SV-258191.rb", + "title": null, + "controls": [ + "SV-258191" + ] + }, + { + "id": "controls/SV-258192.rb", + "title": null, + "controls": [ + "SV-258192" + ] + }, + { + "id": "controls/SV-258193.rb", + "title": null, + "controls": [ + "SV-258193" + ] + }, + { + "id": "controls/SV-258194.rb", + "title": null, + "controls": [ + "SV-258194" + ] + }, + { + "id": "controls/SV-258195.rb", + "title": null, + "controls": [ + "SV-258195" + ] + }, + { + "id": "controls/SV-258196.rb", + "title": null, + "controls": [ + "SV-258196" + ] + }, + { + "id": "controls/SV-258197.rb", + "title": null, + "controls": [ + "SV-258197" + ] + }, + { + "id": "controls/SV-258198.rb", + "title": null, + "controls": [ + "SV-258198" + ] + }, + { + "id": "controls/SV-258199.rb", + "title": null, + "controls": [ + "SV-258199" + ] + }, + { + "id": "controls/SV-258200.rb", + "title": null, + "controls": [ + "SV-258200" + ] + }, + { + "id": "controls/SV-258201.rb", + "title": null, + "controls": [ + "SV-258201" + ] + }, + { + "id": "controls/SV-258202.rb", + "title": null, + "controls": [ + "SV-258202" + ] + }, + { + "id": "controls/SV-258203.rb", + "title": null, + "controls": [ + "SV-258203" + ] + }, + { + "id": "controls/SV-258204.rb", + "title": null, + "controls": [ + "SV-258204" + ] + }, + { + "id": "controls/SV-258205.rb", + "title": null, + "controls": [ + "SV-258205" + ] + }, + { + "id": "controls/SV-258206.rb", + "title": null, + "controls": [ + "SV-258206" + ] + }, + { + "id": "controls/SV-258207.rb", + "title": null, + "controls": [ + "SV-258207" + ] + }, + { + "id": "controls/SV-258208.rb", + "title": null, + "controls": [ + "SV-258208" + ] + }, + { + "id": "controls/SV-258209.rb", + "title": null, + "controls": [ + "SV-258209" + ] + }, + { + "id": "controls/SV-258210.rb", + "title": null, + "controls": [ + "SV-258210" + ] + }, + { + "id": "controls/SV-258211.rb", + "title": null, + "controls": [ + "SV-258211" + ] + }, + { + "id": "controls/SV-258212.rb", + "title": null, + "controls": [ + "SV-258212" + ] + }, + { + "id": "controls/SV-258213.rb", + "title": null, + "controls": [ + "SV-258213" + ] + }, + { + "id": "controls/SV-258214.rb", + "title": null, + "controls": [ + "SV-258214" + ] + }, + { + "id": "controls/SV-258215.rb", + "title": null, + "controls": [ + "SV-258215" + ] + }, + { + "id": "controls/SV-258216.rb", + "title": null, + "controls": [ + "SV-258216" + ] + }, + { + "id": "controls/SV-258217.rb", + "title": null, + "controls": [ + "SV-258217" + ] + }, + { + "id": "controls/SV-258218.rb", + "title": null, + "controls": [ + "SV-258218" + ] + }, + { + "id": "controls/SV-258219.rb", + "title": null, + "controls": [ + "SV-258219" + ] + }, + { + "id": "controls/SV-258220.rb", + "title": null, + "controls": [ + "SV-258220" + ] + }, + { + "id": "controls/SV-258221.rb", + "title": null, + "controls": [ + "SV-258221" + ] + }, + { + "id": "controls/SV-258222.rb", + "title": null, + "controls": [ + "SV-258222" + ] + }, + { + "id": "controls/SV-258223.rb", + "title": null, + "controls": [ + "SV-258223" + ] + }, + { + "id": "controls/SV-258224.rb", + "title": null, + "controls": [ + "SV-258224" + ] + }, + { + "id": "controls/SV-258225.rb", + "title": null, + "controls": [ + "SV-258225" + ] + }, + { + "id": "controls/SV-258226.rb", + "title": null, + "controls": [ + "SV-258226" + ] + }, + { + "id": "controls/SV-258227.rb", + "title": null, + "controls": [ + "SV-258227" + ] + }, + { + "id": "controls/SV-258228.rb", + "title": null, + "controls": [ + "SV-258228" + ] + }, + { + "id": "controls/SV-258229.rb", + "title": null, + "controls": [ + "SV-258229" + ] + }, + { + "id": "controls/SV-258230.rb", + "title": null, + "controls": [ + "SV-258230" + ] + }, + { + "id": "controls/SV-258231.rb", + "title": null, + "controls": [ + "SV-258231" + ] + }, + { + "id": "controls/SV-258232.rb", + "title": null, + "controls": [ + "SV-258232" + ] + }, + { + "id": "controls/SV-258233.rb", + "title": null, + "controls": [ + "SV-258233" + ] + }, + { + "id": "controls/SV-258234.rb", + "title": null, + "controls": [ + "SV-258234" + ] + }, + { + "id": "controls/SV-258235.rb", + "title": null, + "controls": [ + "SV-258235" + ] + }, + { + "id": "controls/SV-258236.rb", + "title": null, + "controls": [ + "SV-258236" + ] + }, + { + "id": "controls/SV-258237.rb", + "title": null, + "controls": [ + "SV-258237" + ] + }, + { + "id": "controls/SV-258238.rb", + "title": null, + "controls": [ + "SV-258238" + ] + }, + { + "id": "controls/SV-258239.rb", + "title": null, + "controls": [ + "SV-258239" + ] + }, + { + "id": "controls/SV-258240.rb", + "title": null, + "controls": [ + "SV-258240" + ] + }, + { + "id": "controls/SV-258241.rb", + "title": null, + "controls": [ + "SV-258241" + ] + }, + { + "id": "controls/SV-258242.rb", + "title": null, + "controls": [ + "SV-258242" + ] + } + ], + "name": "redhat-enterprise-linux-9-stig-baseline", + "title": "redhat-enterprise-linux-9-stig-baseline", + "maintainer": "MITRE SAF Team", + "copyright": "MITRE", + "license": "Apache-2.0", + "summary": "InSpec profile aligned to DISA STIG for RHEL9", + "version": "1.2.0", + "inspec_version": ">= 6.0", + "supports": [ + { + "platform-name": "redhat", + "release": "9.*" + } + ], + "inputs": [ + { + "name": "sudoers_config_files", + "options": { + "type": "Array", + "value": [ + "/etc/sudoers", + "/etc/sudoers.d/*" + ] + } + }, + { + "name": "passwordless_admins", + "options": { + "type": "Array", + "value": [] + } + }, + { + "name": "sshd_config_values", + "options": { + "type": "Hash", + "value": { + "GSSAPIAuthentication": "no", + "ClientAliveInterval": "600" + } + } + }, + { + "name": "alternate_mfa_method", + "options": { + "type": "String", + "value": "" + } + }, + { + "name": "sssd_conf_files", + "options": { + "type": "Array", + "value": [ + "/etc/sssd/sssd.conf", + "/etc/sssd/conf.d/*.conf" + ] + } + }, + { + "name": "piv_driver", + "options": { + "type": "String", + "value": "PIV-II" + } + }, + { + "name": "ssh_host_key_dirs", + "options": { + "type": "Array", + "value": [ + "/etc/ssh/", + "/home/" + ] + } + }, + { + "name": "ssh_pub_key_mode", + "options": { + "type": "String", + "value": "0644" + } + }, + { + "name": "ssh_private_key_mode", + "options": { + "type": "String", + "value": "0640" + } + }, + { + "name": "audit_conf_mode", + "options": { + "type": "String", + "value": "0640" + } + }, + { + "name": "audit_tool_mode", + "options": { + "type": "String", + "value": "0755" + } + }, + { + "name": "home_dir_mode", + "options": { + "type": "String", + "value": "0750" + } + }, + { + "name": "initialization_file_mode", + "options": { + "type": "String", + "value": "0740" + } + }, + { + "name": "alert_method", + "options": { + "type": "String", + "value": "email" + } + }, + { + "name": "peripherals_package", + "options": { + "type": "String", + "value": "usbguard" + } + }, + { + "name": "peripherals_service", + "options": { + "type": "String", + "value": "usbguard" + } + }, + { + "name": "allow_container_openssh_server", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "maxclassrepeat", + "options": { + "type": "Numeric", + "value": 4 + } + }, + { + "name": "maxrepeat", + "options": { + "type": "Numeric", + "value": 3 + } + }, + { + "name": "minclass", + "options": { + "type": "Numeric", + "value": 4 + } + }, + { + "name": "difok", + "options": { + "type": "Numeric", + "value": 8 + } + }, + { + "name": "pass_min_days", + "options": { + "type": "Numeric", + "value": 1 + } + }, + { + "name": "pass_max_days", + "options": { + "type": "Numeric", + "value": 60 + } + }, + { + "name": "seperate_filesystem_exempt", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "disable_slow_controls", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "disconnected_system", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "use_fips", + "options": { + "type": "Boolean", + "value": true + } + }, + { + "name": "data_at_rest_exempt", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "min_reuse_generations", + "options": { + "type": "Numeric", + "value": 5 + } + }, + { + "name": "min_retry", + "options": { + "type": "Numeric", + "value": 3 + } + }, + { + "name": "pass_min_len", + "options": { + "type": "Numeric", + "value": 15 + } + }, + { + "name": "faillock_tally", + "options": { + "type": "String", + "value": "faillog_t" + } + }, + { + "name": "network_router", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "sysctl_conf_files", + "options": { + "type": "Array", + "value": [ + "/etc/sysctl.d/*.conf", + "/run/sysctl.d/*.conf", + "/usr/local/lib/sysctl.d/*.conf", + "/usr/lib/sysctl.d/*.conf", + "/lib/sysctl.d/*.conf", + "/etc/sysctl.conf" + ] + } + }, + { + "name": "kernel_dump_expected_value", + "options": { + "type": "String", + "value": "|/bin/false" + } + }, + { + "name": "core_dump_expected_value", + "options": { + "type": "Numeric", + "value": 0 + } + }, + { + "name": "concurrent_sessions_permitted", + "options": { + "type": "Numeric", + "value": 10 + } + }, + { + "name": "kernel_config_files", + "options": { + "type": "Array", + "value": [ + "/etc/sysctl.d/*.conf", + "/run/sysctl.d/*.conf", + "/usr/local/lib/sysctl.d/*.conf", + "/usr/lib/sysctl.d/*.conf", + "/lib/sysctl.d/*.conf", + "/etc/sysctl.conf" + ] + } + }, + { + "name": "grub_uefi_main_cfg", + "options": { + "type": "String", + "value": "/boot/efi/EFI/redhat/grub.cfg" + } + }, + { + "name": "grub_uefi_user_boot_files", + "options": { + "type": "Array", + "value": [ + "/boot/efi/EFI/redhat/user.cfg" + ] + } + }, + { + "name": "exempt_home_users", + "options": { + "type": "Array", + "value": [ + "root" + ] + } + }, + { + "name": "non_interactive_shells", + "options": { + "type": "Array", + "value": [ + "/sbin/nologin", + "/sbin/halt", + "/sbin/shutdown", + "/bin/false", + "/bin/sync", + "/bin/true" + ] + } + }, + { + "name": "user_accounts", + "options": { + "type": "Array", + "value": [ + "vagrant" + ] + } + }, + { + "name": "grub_main_cfg", + "options": { + "type": "String", + "value": "/boot/grub2/grub.cfg" + } + }, + { + "name": "unapproved_ssl_tls_versions", + "options": { + "type": "Array", + "value": [ + "-VERS-DTLS0.9", + "-VERS-SSL3.0", + "-VERS-TLS1.0", + "-VERS-TLS1.1", + "-VERS-DTLS1.0" + ] + } + }, + { + "name": "grub_user_boot_files", + "options": { + "type": "Array", + "value": [ + "/boot/grub2/user.cfg" + ] + } + }, + { + "name": "ipv4_enabled", + "options": { + "type": "Boolean", + "value": true + } + }, + { + "name": "unsuccessful_attempts", + "options": { + "type": "Numeric", + "value": 3 + } + }, + { + "name": "central_account_management", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "ipv6_enabled", + "options": { + "type": "Boolean", + "value": true + } + }, + { + "name": "camera_installed", + "options": { + "type": "Boolean", + "value": true + } + }, + { + "name": "bluetooth_installed", + "options": { + "type": "Boolean", + "value": true + } + }, + { + "name": "known_system_accounts", + "options": { + "type": "Array", + "value": [ + "adm", + "bin", + "chrony", + "daemon", + "dbus", + "halt", + "lp", + "mail", + "nobody", + "ntp", + "operator", + "polkitd", + "postfix", + "root", + "shutdown", + "sshd", + "sssd", + "sync", + "systemd-bus-proxy", + "systemd-network" + ] + } + }, + { + "name": "smart_card_enabled", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "file_integrity_tool", + "options": { + "type": "String", + "value": "aide" + } + }, + { + "name": "authoritative_timeserver", + "options": { + "type": "String", + "value": "0.us.pool.ntp.mil" + } + }, + { + "name": "non_removable_media_fs", + "options": { + "type": "Array", + "value": [ + "/", + "/tmp", + "none", + "/home", + "/tmpfs" + ] + } + }, + { + "name": "private_key_files", + "options": { + "type": "Array", + "value": [] + } + }, + { + "name": "openssh_server_required_algorithms", + "options": { + "type": "Array", + "value": [ + "hmac-sha2-512", + "hmac-sha2-256", + "hmac-sha2-512-etm@openssh.com", + "hmac-sha2-256-etm@openssh.com" + ] + } + }, + { + "name": "root_ca_file", + "options": { + "type": "String", + "value": "/etc/sssd/pki/sssd_auth_ca_db.pem" + } + }, + { + "name": "system_inactivity_timeout", + "options": { + "type": "Numeric", + "value": 900 + } + }, + { + "name": "days_of_inactivity", + "options": { + "type": "Numeric", + "value": 35 + } + }, + { + "name": "temporary_accounts", + "options": { + "type": "Array", + "value": [] + } + }, + { + "name": "temporary_account_max_days", + "options": { + "type": "Numeric", + "value": 3 + } + }, + { + "name": "banner_message_text_cli", + "options": { + "type": "String", + "value": "You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details." + } + }, + { + "name": "banner_message_text_ral", + "options": { + "type": "String", + "value": "You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details." + } + }, + { + "name": "banner_message_text_gui", + "options": { + "type": "String", + "value": "You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details." + } + }, + { + "name": "maxlogins_limit", + "options": { + "type": "Numeric", + "value": 10 + } + }, + { + "name": "fail_interval", + "options": { + "type": "Numeric", + "value": 900 + } + }, + { + "name": "lockout_time", + "options": { + "type": "Numeric", + "value": 0 + } + }, + { + "name": "system_activity_timeout", + "options": { + "type": "Numeric", + "value": 900 + } + }, + { + "name": "log_directory", + "options": { + "type": "String", + "value": "/var/log/faillock" + } + }, + { + "name": "sshd_client_alive_count_max", + "options": { + "type": "Numeric", + "value": 1 + } + }, + { + "name": "linux_threat_prevention_package", + "options": { + "type": "String", + "value": "mcafeetp" + } + }, + { + "name": "linux_threat_prevention_service", + "options": { + "type": "String", + "value": "mfetpd" + } + }, + { + "name": "remove_xorg_x11_server_packages", + "options": { + "type": "Array", + "value": [ + "xorg-x11-server-common", + "xorg-x11-server-Xorg", + "xorg-x11-server-utils", + "xorg-x11-server-Xwayland" + ] + } + }, + { + "name": "gui_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "disk_error_action", + "options": { + "type": "Array", + "value": [ + "SYSLOG", + "SINGLE", + "HALT" + ] + } + }, + { + "name": "disk_full_action", + "options": { + "type": "Array", + "value": [ + "SYSLOG", + "SINGLE", + "HALT" + ] + } + }, + { + "name": "permit_root_login", + "options": { + "type": "String", + "value": "no" + } + }, + { + "name": "permissions_for_shells", + "options": { + "type": "Hash", + "value": { + "default_umask": "077", + "bashrc_umask": "077", + "cshrc_umask": "077", + "profile_umask": "077" + } + } + }, + { + "name": "permissions_for_libs", + "options": { + "type": "String", + "value": "0755" + } + }, + { + "name": "system_libraries", + "options": { + "type": "Array", + "value": [ + "/lib", + "/lib64", + "/usr/lib", + "/usr/lib64" + ] + } + }, + { + "name": "system_command_dirs", + "options": { + "type": "Array", + "value": [ + "/bin", + "/sbin", + "/usr/bin", + "/usr/sbin", + "/usr/local/bin", + "/usr/local/sbin" + ] + } + }, + { + "name": "required_system_accounts", + "options": { + "type": "Array", + "value": [ + "root" + ] + } + }, + { + "name": "var_log_messages_group", + "options": { + "type": "Array", + "value": [ + "root" + ] + } + }, + { + "name": "sssd_certificate_verification", + "options": { + "type": "String", + "value": "ocsp_dgst=sha1" + } + }, + { + "name": "sssd_conf_path", + "options": { + "type": "String", + "value": "/etc/sssd/sssd.conf" + } + }, + { + "name": "var_log_audit_group", + "options": { + "type": "Array", + "value": [ + "root" + ] + } + }, + { + "name": "use_fapolicyd", + "options": { + "type": "Boolean", + "value": true + } + }, + { + "name": "pam_auth_files", + "options": { + "type": "Hash", + "value": { + "system-auth": "/etc/pam.d/system-auth", + "password-auth": "/etc/pam.d/password-auth", + "smartcard-auth": "/etc/pam.d/smartcard-auth" + } + } + }, + { + "name": "security_faillock_conf", + "options": { + "type": "String", + "value": "/etc/security/faillock.conf" + } + }, + { + "name": "external_firewall", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "firewalld_properties", + "options": { + "type": "Hash", + "value": { + "default_zone": "public", + "ports": [], + "protocols": [], + "services": [ + "cockpit", + "dhcpv6-client", + "ssh" + ] + } + } + }, + { + "name": "mount_tmp_options", + "options": { + "type": "Hash", + "value": { + "nodev": false, + "nosuid": false, + "noexec": false + } + } + }, + { + "name": "skip_password_privilege_escalation", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "skip_endpoint_security_tool", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "non_default_tally_dir", + "options": { + "type": "String", + "value": "/var/log/faillock" + } + }, + { + "name": "users_allowed_blank_passwords", + "options": { + "type": "Array", + "value": [] + } + }, + { + "name": "mail_package", + "options": { + "type": "String", + "value": "mailx" + } + }, + { + "name": "rpm_gpg_file", + "options": { + "type": "String", + "value": "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release" + } + }, + { + "name": "rpm_gpg_keys", + "options": { + "type": "Hash", + "value": { + "release key 2": "567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51", + "auxiliary key": "6A6A A7C9 7C88 90AE C6AE BFE2 F76F 66C3 D408 2792" + } + } + }, + { + "name": "administrator_users", + "options": { + "type": "Array", + "value": [ + "root" + ] + } + }, + { + "name": "allowed_admin_selinux_roles", + "options": { + "type": "Array", + "value": [ + "sysadm_u", + "staff_u" + ] + } + }, + { + "name": "allowed_non_admin_selinux_roles", + "options": { + "type": "Array", + "value": [ + "user_u" + ] + } + }, + { + "name": "stop_idle_session_sec", + "options": { + "type": "Numeric", + "value": 900 + } + }, + { + "name": "sha_crypt_min_rounds", + "options": { + "type": "Numeric", + "value": 5000 + } + }, + { + "name": "sha_crypt_max_rounds", + "options": { + "type": "Numeric", + "value": 5000 + } + }, + { + "name": "login_prompt_delay", + "options": { + "type": "Numeric", + "value": 4 + } + }, + { + "name": "logging_conf_files", + "options": { + "type": "Array", + "value": [ + "/etc/rsyslog.conf", + "/etc/rsyslog.d/*.conf" + ] + } + }, + { + "name": "alternative_logging", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "alternative_logging_method", + "options": { + "type": "String", + "value": "" + } + }, + { + "name": "expected_backlog_limit", + "options": { + "type": "Numeric", + "value": 8192 + } + }, + { + "name": "audit_storage_threshold", + "options": { + "type": "Numeric", + "value": 25 + } + }, + { + "name": "autofs_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "usb_storage_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "tftp_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "ftp_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "promiscuous_mode_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "gssproxy_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "iprutils_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "tuned_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "kerberos_required", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "alternate_firewall_tool", + "options": { + "type": "String", + "value": "" + } + }, + { + "name": "wifi_hardware", + "options": { + "type": "Boolean", + "value": true + } + }, + { + "name": "system_is_workstation", + "options": { + "type": "Boolean", + "value": false + } + }, + { + "name": "audit_rule_keynames", + "options": { + "type": "Hash", + "value": { + "execve": "execpriv", + "/etc/shadow": "identity", + "/etc/security/opasswd": "identity", + "/etc/passwd": "identity", + "/etc/gshadow": "identity", + "/etc/group": "identity", + "/etc/sudoers": "identity", + "/etc/sudoers.d": "identity", + "/usr/bin/su": "privileged-priv_change", + "setxattr": "perm_mod", + "fsetxattr": "perm_mod", + "lsetxattr": "perm_mod", + "removexattr": "perm_mod", + "fremovexattr": "perm_mod", + "lremovexattr": "perm_mod", + "/usr/bin/chage": "privileged-chage", + "/usr/bin/chcon": "perm_mod", + "/usr/bin/ssh-agent": "privileged-ssh", + "/usr/bin/passwd": "privileged-passwd", + "/usr/bin/mount": "privileged-mount", + "/usr/bin/umount": "privileged-mount", + "mount": "privileged-mount", + "/usr/sbin/unix_update": "privileged-unix-update", + "/usr/sbin/postdrop": "privileged-unix-update", + "/usr/sbin/postqueue": "privileged-unix-update", + "/usr/sbin/semanage": "privileged-unix-update", + "/usr/sbin/setfiles": "privileged-unix-update", + "/usr/sbin/userhelper": "privileged-unix-update", + "/usr/sbin/setsebool": "privileged-unix-update", + "/usr/sbin/unix_chkpwd": "privileged-unix-update", + "/usr/libexec/openssh/ssh-keysign": "privileged-ssh", + "/usr/bin/setfacl": "perm_mod", + "/usr/sbin/pam_timestamp_check": "privileged-pam_timestamp_check", + "/usr/bin/newgrp": "priv_cmd", + "init_module": "module_chng", + "finit_module": "module_chng", + "rename": "delete", + "unlink": "delete", + "rmdir": "delete", + "renameat": "delete", + "unlinkat": "delete", + "/usr/bin/gpasswd": "privileged-gpasswd", + "delete_module": "module_chng", + "/usr/bin/crontab": "privileged-crontab", + "/usr/bin/chsh": "priv_cmd", + "truncate": "perm_access", + "ftruncate": "perm_access", + "creat": "perm_access", + "open": "perm_access", + "openat": "perm_access", + "open_by_handle_at": "perm_access", + "chown": "perm_mod", + "fchown": "perm_mod", + "fchownat": "perm_mod", + "lchown": "perm_mod", + "chmod": "perm_mod", + "fchmod": "perm_mod", + "fchmodat": "perm_mod", + "/usr/bin/sudo": "priv_cmd", + "/usr/sbin/usermod": "privileged-usermod", + "/usr/bin/chacl": "perm_mod", + "/usr/bin/kmod": "modules", + "/var/log/faillock": "logins", + "/var/log/lastlog": "logins" + } + } + }, + { + "name": "audit_rule_keynames_overrides", + "options": { + "type": "Hash", + "value": {} + } + }, + { + "name": "promiscuous_mode_permitted", + "options": { + "value": "Input 'promiscuous_mode_permitted' does not have a value. Skipping test." + } + }, + { + "name": "system_wide_crypto_policy", + "options": { + "value": "Input 'system_wide_crypto_policy' does not have a value. Skipping test." + } + } + ], + "sha256": "7c0807230889af87a84814c7886a8fbfba9db87850e4dd38109e6f581474b6f3", + "status_message": "", + "status": "loaded", + "generator": { + "name": "inspec", + "version": "5.22.40" + } +} diff --git a/rhel9_status.csv b/rhel9_status.csv new file mode 100644 index 0000000..135d22a --- /dev/null +++ b/rhel9_status.csv @@ -0,0 +1,467 @@ +Control,Status +SV-257783,Implemented +SV-257787,Implemented +SV-257788,Implemented +SV-257789,Implemented +SV-257790,Implemented +SV-257791,Implemented +SV-257792,Implemented +SV-257811,Implemented +SV-257818,Implemented +SV-257820,Implemented +SV-257822,Implemented +SV-257823,Implemented +SV-257825,Implemented +SV-257828,Implemented +SV-257829,Implemented +SV-257835,Implemented +SV-257836,Implemented +SV-257839,Implemented +SV-257840,Implemented +SV-257850,Implemented +SV-257853,Implemented +SV-257860,Implemented +SV-257869,Implemented +SV-257888,Implemented +SV-257891,Implemented +SV-257892,Implemented +SV-257893,Implemented +SV-257894,Implemented +SV-257895,Implemented +SV-257896,Implemented +SV-257897,Implemented +SV-257898,Implemented +SV-257899,Implemented +SV-257900,Implemented +SV-257901,Implemented +SV-257902,Implemented +SV-257903,Implemented +SV-257904,Implemented +SV-257905,Implemented +SV-257906,Implemented +SV-257907,Implemented +SV-257908,Implemented +SV-257909,Implemented +SV-257910,Implemented +SV-257911,Implemented +SV-257912,Implemented +SV-257913,Implemented +SV-257926,Implemented +SV-257927,Implemented +SV-257932,Implemented +SV-257933,Implemented +SV-257934,Implemented +SV-257938,Implemented +SV-257943,Implemented +SV-257944,Implemented +SV-257949,Implemented +SV-257950,Implemented +SV-257953,Implemented +SV-257954,Implemented +SV-257957,Implemented +SV-257960,Implemented +SV-257961,Implemented +SV-257965,Implemented +SV-257967,Implemented +SV-257980,Implemented +SV-257982,Implemented +SV-257983,Implemented +SV-257984,Implemented +SV-257986,Implemented +SV-257988,Implemented +SV-257990,Implemented +SV-257992,Implemented +SV-257997,Implemented +SV-257998,Implemented +SV-257999,Implemented +SV-258002,Implemented +SV-258005,Implemented +SV-258010,Implemented +SV-258013,Implemented +SV-258014,Implemented +SV-258015,Implemented +SV-258016,Implemented +SV-258017,Implemented +SV-258020,Implemented +SV-258027,Implemented +SV-258028,Implemented +SV-258029,Implemented +SV-258030,Implemented +SV-258031,Implemented +SV-258032,Implemented +SV-258046,Implemented +SV-258048,Implemented +SV-258055,Implemented +SV-258057,Implemented +SV-258061,Implemented +SV-258068,Implemented +SV-258072,Implemented +SV-258073,Implemented +SV-258075,Implemented +SV-258082,Implemented +SV-258083,Implemented +SV-258088,Implemented +SV-258094,Implemented +SV-258099,Implemented +SV-258100,Implemented +SV-258101,Implemented +SV-258112,Implemented +SV-258116,Implemented +SV-258117,Implemented +SV-258121,Implemented +SV-258124,Implemented +SV-258125,Implemented +SV-258126,Implemented +SV-258129,Implemented +SV-258135,Implemented +SV-258136,Implemented +SV-258143,Implemented +SV-258145,Implemented +SV-258148,Implemented +SV-258158,Implemented +SV-258159,Implemented +SV-258160,Implemented +SV-258168,Implemented +SV-258170,Implemented +SV-258172,Implemented +SV-258175,Implemented +SV-258180,Implemented +SV-258205,Implemented +SV-258211,Implemented +SV-258212,Implemented +SV-258213,Implemented +SV-258214,Implemented +SV-258216,Implemented +SV-258224,Implemented +SV-258226,Implemented +SV-258227,Implemented +SV-258232,Implemented +SV-258234,Implemented +SV-258235,Implemented +SV-258236,Implemented +SV-258237,Implemented +SV-258241,Implemented +SV-258242,Implemented +SV-257777,Implemented (Carried Over From RHEL8 Profile) +SV-257778,Implemented (Carried Over From RHEL8 Profile) +SV-257779,Implemented (Carried Over From RHEL8 Profile) +SV-257780,Implemented (Carried Over From RHEL8 Profile) +SV-257781,Implemented (Carried Over From RHEL8 Profile) +SV-257782,Implemented (Carried Over From RHEL8 Profile) +SV-257784,Implemented (Carried Over From RHEL8 Profile) +SV-257785,Implemented (Carried Over From RHEL8 Profile) +SV-257786,Implemented (Carried Over From RHEL8 Profile) +SV-257793,Implemented (Carried Over From RHEL8 Profile) +SV-257794,Implemented (Carried Over From RHEL8 Profile) +SV-257795,Implemented (Carried Over From RHEL8 Profile) +SV-257796,Implemented (Carried Over From RHEL8 Profile) +SV-257797,Implemented (Carried Over From RHEL8 Profile) +SV-257798,Implemented (Carried Over From RHEL8 Profile) +SV-257799,Implemented (Carried Over From RHEL8 Profile) +SV-257800,Implemented (Carried Over From RHEL8 Profile) +SV-257801,Implemented (Carried Over From RHEL8 Profile) +SV-257802,Implemented (Carried Over From RHEL8 Profile) +SV-257803,Implemented (Carried Over From RHEL8 Profile) +SV-257804,Implemented (Carried Over From RHEL8 Profile) +SV-257805,Implemented (Carried Over From RHEL8 Profile) +SV-257806,Implemented (Carried Over From RHEL8 Profile) +SV-257807,Implemented (Carried Over From RHEL8 Profile) +SV-257808,Implemented (Carried Over From RHEL8 Profile) +SV-257809,Implemented (Carried Over From RHEL8 Profile) +SV-257810,Implemented (Carried Over From RHEL8 Profile) +SV-257812,Implemented (Carried Over From RHEL8 Profile) +SV-257813,Implemented (Carried Over From RHEL8 Profile) +SV-257814,Implemented (Carried Over From RHEL8 Profile) +SV-257815,Implemented (Carried Over From RHEL8 Profile) +SV-257816,Implemented (Carried Over From RHEL8 Profile) +SV-257817,Implemented (Carried Over From RHEL8 Profile) +SV-257819,Implemented (Carried Over From RHEL8 Profile) +SV-257821,Implemented (Carried Over From RHEL8 Profile) +SV-257824,Implemented (Carried Over From RHEL8 Profile) +SV-257826,Implemented (Carried Over From RHEL8 Profile) +SV-257827,Implemented (Carried Over From RHEL8 Profile) +SV-257830,Implemented (Carried Over From RHEL8 Profile) +SV-257831,Implemented (Carried Over From RHEL8 Profile) +SV-257832,Implemented (Carried Over From RHEL8 Profile) +SV-257833,Implemented (Carried Over From RHEL8 Profile) +SV-257834,Implemented (Carried Over From RHEL8 Profile) +SV-257837,Implemented (Carried Over From RHEL8 Profile) +SV-257838,Implemented (Carried Over From RHEL8 Profile) +SV-257841,Implemented (Carried Over From RHEL8 Profile) +SV-257842,Implemented (Carried Over From RHEL8 Profile) +SV-257843,Implemented (Carried Over From RHEL8 Profile) +SV-257844,Implemented (Carried Over From RHEL8 Profile) +SV-257845,Implemented (Carried Over From RHEL8 Profile) +SV-257846,Implemented (Carried Over From RHEL8 Profile) +SV-257847,Implemented (Carried Over From RHEL8 Profile) +SV-257848,Implemented (Carried Over From RHEL8 Profile) +SV-257849,Implemented (Carried Over From RHEL8 Profile) +SV-257851,Implemented (Carried Over From RHEL8 Profile) +SV-257852,Implemented (Carried Over From RHEL8 Profile) +SV-257854,Implemented (Carried Over From RHEL8 Profile) +SV-257855,Implemented (Carried Over From RHEL8 Profile) +SV-257856,Implemented (Carried Over From RHEL8 Profile) +SV-257857,Implemented (Carried Over From RHEL8 Profile) +SV-257858,Implemented (Carried Over From RHEL8 Profile) +SV-257859,Implemented (Carried Over From RHEL8 Profile) +SV-257861,Implemented (Carried Over From RHEL8 Profile) +SV-257862,Implemented (Carried Over From RHEL8 Profile) +SV-257863,Implemented (Carried Over From RHEL8 Profile) +SV-257864,Implemented (Carried Over From RHEL8 Profile) +SV-257865,Implemented (Carried Over From RHEL8 Profile) +SV-257866,Implemented (Carried Over From RHEL8 Profile) +SV-257867,Implemented (Carried Over From RHEL8 Profile) +SV-257868,Implemented (Carried Over From RHEL8 Profile) +SV-257870,Implemented (Carried Over From RHEL8 Profile) +SV-257871,Implemented (Carried Over From RHEL8 Profile) +SV-257872,Implemented (Carried Over From RHEL8 Profile) +SV-257873,Implemented (Carried Over From RHEL8 Profile) +SV-257874,Implemented (Carried Over From RHEL8 Profile) +SV-257875,Implemented (Carried Over From RHEL8 Profile) +SV-257876,Implemented (Carried Over From RHEL8 Profile) +SV-257877,Implemented (Carried Over From RHEL8 Profile) +SV-257878,Implemented (Carried Over From RHEL8 Profile) +SV-257879,Implemented (Carried Over From RHEL8 Profile) +SV-257880,Implemented (Carried Over From RHEL8 Profile) +SV-257881,Implemented (Carried Over From RHEL8 Profile) +SV-257882,Implemented (Carried Over From RHEL8 Profile) +SV-257883,Implemented (Carried Over From RHEL8 Profile) +SV-257884,Implemented (Carried Over From RHEL8 Profile) +SV-257885,Implemented (Carried Over From RHEL8 Profile) +SV-257886,Implemented (Carried Over From RHEL8 Profile) +SV-257887,Implemented (Carried Over From RHEL8 Profile) +SV-257889,Implemented (Carried Over From RHEL8 Profile) +SV-257890,Implemented (Carried Over From RHEL8 Profile) +SV-257914,Implemented (Carried Over From RHEL8 Profile) +SV-257915,Implemented (Carried Over From RHEL8 Profile) +SV-257916,Implemented (Carried Over From RHEL8 Profile) +SV-257917,Implemented (Carried Over From RHEL8 Profile) +SV-257918,Implemented (Carried Over From RHEL8 Profile) +SV-257919,Implemented (Carried Over From RHEL8 Profile) +SV-257920,Implemented (Carried Over From RHEL8 Profile) +SV-257921,Implemented (Carried Over From RHEL8 Profile) +SV-257922,Implemented (Carried Over From RHEL8 Profile) +SV-257923,Implemented (Carried Over From RHEL8 Profile) +SV-257924,Implemented (Carried Over From RHEL8 Profile) +SV-257925,Implemented (Carried Over From RHEL8 Profile) +SV-257928,Implemented (Carried Over From RHEL8 Profile) +SV-257929,Implemented (Carried Over From RHEL8 Profile) +SV-257930,Implemented (Carried Over From RHEL8 Profile) +SV-257931,Implemented (Carried Over From RHEL8 Profile) +SV-257935,Implemented (Carried Over From RHEL8 Profile) +SV-257936,Implemented (Carried Over From RHEL8 Profile) +SV-257937,Implemented (Carried Over From RHEL8 Profile) +SV-257939,Implemented (Carried Over From RHEL8 Profile) +SV-257940,Implemented (Carried Over From RHEL8 Profile) +SV-257941,Implemented (Carried Over From RHEL8 Profile) +SV-257942,Implemented (Carried Over From RHEL8 Profile) +SV-257945,Implemented (Carried Over From RHEL8 Profile) +SV-257946,Implemented (Carried Over From RHEL8 Profile) +SV-257947,Implemented (Carried Over From RHEL8 Profile) +SV-257948,Implemented (Carried Over From RHEL8 Profile) +SV-257951,Implemented (Carried Over From RHEL8 Profile) +SV-257952,Implemented (Carried Over From RHEL8 Profile) +SV-257955,Implemented (Carried Over From RHEL8 Profile) +SV-257956,Implemented (Carried Over From RHEL8 Profile) +SV-257958,Implemented (Carried Over From RHEL8 Profile) +SV-257959,Implemented (Carried Over From RHEL8 Profile) +SV-257962,Implemented (Carried Over From RHEL8 Profile) +SV-257963,Implemented (Carried Over From RHEL8 Profile) +SV-257964,Implemented (Carried Over From RHEL8 Profile) +SV-257966,Implemented (Carried Over From RHEL8 Profile) +SV-257968,Implemented (Carried Over From RHEL8 Profile) +SV-257969,Implemented (Carried Over From RHEL8 Profile) +SV-257970,Implemented (Carried Over From RHEL8 Profile) +SV-257971,Implemented (Carried Over From RHEL8 Profile) +SV-257972,Implemented (Carried Over From RHEL8 Profile) +SV-257973,Implemented (Carried Over From RHEL8 Profile) +SV-257974,Implemented (Carried Over From RHEL8 Profile) +SV-257975,Implemented (Carried Over From RHEL8 Profile) +SV-257976,Implemented (Carried Over From RHEL8 Profile) +SV-257977,Implemented (Carried Over From RHEL8 Profile) +SV-257978,Implemented (Carried Over From RHEL8 Profile) +SV-257979,Implemented (Carried Over From RHEL8 Profile) +SV-257981,Implemented (Carried Over From RHEL8 Profile) +SV-257985,Implemented (Carried Over From RHEL8 Profile) +SV-257987,Implemented (Carried Over From RHEL8 Profile) +SV-257989,Implemented (Carried Over From RHEL8 Profile) +SV-257991,Implemented (Carried Over From RHEL8 Profile) +SV-257993,Implemented (Carried Over From RHEL8 Profile) +SV-257994,Implemented (Carried Over From RHEL8 Profile) +SV-257995,Implemented (Carried Over From RHEL8 Profile) +SV-257996,Implemented (Carried Over From RHEL8 Profile) +SV-258000,Implemented (Carried Over From RHEL8 Profile) +SV-258001,Implemented (Carried Over From RHEL8 Profile) +SV-258003,Implemented (Carried Over From RHEL8 Profile) +SV-258004,Implemented (Carried Over From RHEL8 Profile) +SV-258006,Implemented (Carried Over From RHEL8 Profile) +SV-258007,Implemented (Carried Over From RHEL8 Profile) +SV-258008,Implemented (Carried Over From RHEL8 Profile) +SV-258009,Implemented (Carried Over From RHEL8 Profile) +SV-258011,Implemented (Carried Over From RHEL8 Profile) +SV-258012,Implemented (Carried Over From RHEL8 Profile) +SV-258018,Implemented (Carried Over From RHEL8 Profile) +SV-258019,Implemented (Carried Over From RHEL8 Profile) +SV-258021,Implemented (Carried Over From RHEL8 Profile) +SV-258022,Implemented (Carried Over From RHEL8 Profile) +SV-258023,Implemented (Carried Over From RHEL8 Profile) +SV-258024,Implemented (Carried Over From RHEL8 Profile) +SV-258025,Implemented (Carried Over From RHEL8 Profile) +SV-258026,Implemented (Carried Over From RHEL8 Profile) +SV-258033,Implemented (Carried Over From RHEL8 Profile) +SV-258034,Implemented (Carried Over From RHEL8 Profile) +SV-258035,Implemented (Carried Over From RHEL8 Profile) +SV-258036,Implemented (Carried Over From RHEL8 Profile) +SV-258037,Implemented (Carried Over From RHEL8 Profile) +SV-258038,Implemented (Carried Over From RHEL8 Profile) +SV-258039,Implemented (Carried Over From RHEL8 Profile) +SV-258040,Implemented (Carried Over From RHEL8 Profile) +SV-258041,Implemented (Carried Over From RHEL8 Profile) +SV-258042,Implemented (Carried Over From RHEL8 Profile) +SV-258043,Implemented (Carried Over From RHEL8 Profile) +SV-258044,Implemented (Carried Over From RHEL8 Profile) +SV-258045,Implemented (Carried Over From RHEL8 Profile) +SV-258047,Implemented (Carried Over From RHEL8 Profile) +SV-258049,Implemented (Carried Over From RHEL8 Profile) +SV-258050,Implemented (Carried Over From RHEL8 Profile) +SV-258051,Implemented (Carried Over From RHEL8 Profile) +SV-258052,Implemented (Carried Over From RHEL8 Profile) +SV-258053,Implemented (Carried Over From RHEL8 Profile) +SV-258054,Implemented (Carried Over From RHEL8 Profile) +SV-258056,Implemented (Carried Over From RHEL8 Profile) +SV-258058,Implemented (Carried Over From RHEL8 Profile) +SV-258059,Implemented (Carried Over From RHEL8 Profile) +SV-258060,Implemented (Carried Over From RHEL8 Profile) +SV-258062,Implemented (Carried Over From RHEL8 Profile) +SV-258063,Implemented (Carried Over From RHEL8 Profile) +SV-258064,Implemented (Carried Over From RHEL8 Profile) +SV-258065,Implemented (Carried Over From RHEL8 Profile) +SV-258066,Implemented (Carried Over From RHEL8 Profile) +SV-258067,Implemented (Carried Over From RHEL8 Profile) +SV-258069,Implemented (Carried Over From RHEL8 Profile) +SV-258070,Implemented (Carried Over From RHEL8 Profile) +SV-258071,Implemented (Carried Over From RHEL8 Profile) +SV-258074,Implemented (Carried Over From RHEL8 Profile) +SV-258076,Implemented (Carried Over From RHEL8 Profile) +SV-258077,Implemented (Carried Over From RHEL8 Profile) +SV-258078,Implemented (Carried Over From RHEL8 Profile) +SV-258079,Implemented (Carried Over From RHEL8 Profile) +SV-258080,Implemented (Carried Over From RHEL8 Profile) +SV-258081,Implemented (Carried Over From RHEL8 Profile) +SV-258084,Implemented (Carried Over From RHEL8 Profile) +SV-258085,Implemented (Carried Over From RHEL8 Profile) +SV-258086,Implemented (Carried Over From RHEL8 Profile) +SV-258087,Implemented (Carried Over From RHEL8 Profile) +SV-258089,Implemented (Carried Over From RHEL8 Profile) +SV-258090,Implemented (Carried Over From RHEL8 Profile) +SV-258091,Implemented (Carried Over From RHEL8 Profile) +SV-258092,Implemented (Carried Over From RHEL8 Profile) +SV-258093,Implemented (Carried Over From RHEL8 Profile) +SV-258095,Implemented (Carried Over From RHEL8 Profile) +SV-258096,Implemented (Carried Over From RHEL8 Profile) +SV-258097,Implemented (Carried Over From RHEL8 Profile) +SV-258098,Implemented (Carried Over From RHEL8 Profile) +SV-258102,Implemented (Carried Over From RHEL8 Profile) +SV-258103,Implemented (Carried Over From RHEL8 Profile) +SV-258104,Implemented (Carried Over From RHEL8 Profile) +SV-258105,Implemented (Carried Over From RHEL8 Profile) +SV-258106,Implemented (Carried Over From RHEL8 Profile) +SV-258107,Implemented (Carried Over From RHEL8 Profile) +SV-258108,Implemented (Carried Over From RHEL8 Profile) +SV-258109,Implemented (Carried Over From RHEL8 Profile) +SV-258110,Implemented (Carried Over From RHEL8 Profile) +SV-258111,Implemented (Carried Over From RHEL8 Profile) +SV-258113,Implemented (Carried Over From RHEL8 Profile) +SV-258114,Implemented (Carried Over From RHEL8 Profile) +SV-258115,Implemented (Carried Over From RHEL8 Profile) +SV-258118,Implemented (Carried Over From RHEL8 Profile) +SV-258119,Implemented (Carried Over From RHEL8 Profile) +SV-258120,Implemented (Carried Over From RHEL8 Profile) +SV-258122,Implemented (Carried Over From RHEL8 Profile) +SV-258123,Implemented (Carried Over From RHEL8 Profile) +SV-258127,Implemented (Carried Over From RHEL8 Profile) +SV-258128,Implemented (Carried Over From RHEL8 Profile) +SV-258130,Implemented (Carried Over From RHEL8 Profile) +SV-258131,Implemented (Carried Over From RHEL8 Profile) +SV-258132,Implemented (Carried Over From RHEL8 Profile) +SV-258133,Implemented (Carried Over From RHEL8 Profile) +SV-258134,Implemented (Carried Over From RHEL8 Profile) +SV-258137,Implemented (Carried Over From RHEL8 Profile) +SV-258138,Implemented (Carried Over From RHEL8 Profile) +SV-258139,Implemented (Carried Over From RHEL8 Profile) +SV-258140,Implemented (Carried Over From RHEL8 Profile) +SV-258141,Implemented (Carried Over From RHEL8 Profile) +SV-258142,Implemented (Carried Over From RHEL8 Profile) +SV-258144,Implemented (Carried Over From RHEL8 Profile) +SV-258146,Implemented (Carried Over From RHEL8 Profile) +SV-258147,Implemented (Carried Over From RHEL8 Profile) +SV-258149,Implemented (Carried Over From RHEL8 Profile) +SV-258150,Implemented (Carried Over From RHEL8 Profile) +SV-258151,Implemented (Carried Over From RHEL8 Profile) +SV-258152,Implemented (Carried Over From RHEL8 Profile) +SV-258153,Implemented (Carried Over From RHEL8 Profile) +SV-258154,Implemented (Carried Over From RHEL8 Profile) +SV-258155,Implemented (Carried Over From RHEL8 Profile) +SV-258156,Implemented (Carried Over From RHEL8 Profile) +SV-258157,Implemented (Carried Over From RHEL8 Profile) +SV-258161,Implemented (Carried Over From RHEL8 Profile) +SV-258162,Implemented (Carried Over From RHEL8 Profile) +SV-258163,Implemented (Carried Over From RHEL8 Profile) +SV-258164,Implemented (Carried Over From RHEL8 Profile) +SV-258165,Implemented (Carried Over From RHEL8 Profile) +SV-258166,Implemented (Carried Over From RHEL8 Profile) +SV-258167,Implemented (Carried Over From RHEL8 Profile) +SV-258169,Implemented (Carried Over From RHEL8 Profile) +SV-258171,Implemented (Carried Over From RHEL8 Profile) +SV-258173,Implemented (Carried Over From RHEL8 Profile) +SV-258174,Implemented (Carried Over From RHEL8 Profile) +SV-258176,Implemented (Carried Over From RHEL8 Profile) +SV-258177,Implemented (Carried Over From RHEL8 Profile) +SV-258178,Implemented (Carried Over From RHEL8 Profile) +SV-258179,Implemented (Carried Over From RHEL8 Profile) +SV-258181,Implemented (Carried Over From RHEL8 Profile) +SV-258182,Implemented (Carried Over From RHEL8 Profile) +SV-258183,Implemented (Carried Over From RHEL8 Profile) +SV-258184,Implemented (Carried Over From RHEL8 Profile) +SV-258185,Implemented (Carried Over From RHEL8 Profile) +SV-258186,Implemented (Carried Over From RHEL8 Profile) +SV-258187,Implemented (Carried Over From RHEL8 Profile) +SV-258188,Implemented (Carried Over From RHEL8 Profile) +SV-258189,Implemented (Carried Over From RHEL8 Profile) +SV-258190,Implemented (Carried Over From RHEL8 Profile) +SV-258191,Implemented (Carried Over From RHEL8 Profile) +SV-258192,Implemented (Carried Over From RHEL8 Profile) +SV-258193,Implemented (Carried Over From RHEL8 Profile) +SV-258194,Implemented (Carried Over From RHEL8 Profile) +SV-258195,Implemented (Carried Over From RHEL8 Profile) +SV-258196,Implemented (Carried Over From RHEL8 Profile) +SV-258197,Implemented (Carried Over From RHEL8 Profile) +SV-258198,Implemented (Carried Over From RHEL8 Profile) +SV-258199,Implemented (Carried Over From RHEL8 Profile) +SV-258200,Implemented (Carried Over From RHEL8 Profile) +SV-258201,Implemented (Carried Over From RHEL8 Profile) +SV-258202,Implemented (Carried Over From RHEL8 Profile) +SV-258203,Implemented (Carried Over From RHEL8 Profile) +SV-258204,Implemented (Carried Over From RHEL8 Profile) +SV-258206,Implemented (Carried Over From RHEL8 Profile) +SV-258207,Implemented (Carried Over From RHEL8 Profile) +SV-258208,Implemented (Carried Over From RHEL8 Profile) +SV-258209,Implemented (Carried Over From RHEL8 Profile) +SV-258210,Implemented (Carried Over From RHEL8 Profile) +SV-258215,Implemented (Carried Over From RHEL8 Profile) +SV-258217,Implemented (Carried Over From RHEL8 Profile) +SV-258218,Implemented (Carried Over From RHEL8 Profile) +SV-258219,Implemented (Carried Over From RHEL8 Profile) +SV-258220,Implemented (Carried Over From RHEL8 Profile) +SV-258221,Implemented (Carried Over From RHEL8 Profile) +SV-258222,Implemented (Carried Over From RHEL8 Profile) +SV-258223,Implemented (Carried Over From RHEL8 Profile) +SV-258225,Implemented (Carried Over From RHEL8 Profile) +SV-258228,Implemented (Carried Over From RHEL8 Profile) +SV-258229,Implemented (Carried Over From RHEL8 Profile) +SV-258230,Implemented (Carried Over From RHEL8 Profile) +SV-258231,Implemented (Carried Over From RHEL8 Profile) +SV-258233,Implemented (Carried Over From RHEL8 Profile) +SV-258238,Implemented (Carried Over From RHEL8 Profile) +SV-258239,Implemented (Carried Over From RHEL8 Profile) +SV-258240,Implemented (Carried Over From RHEL8 Profile) \ No newline at end of file diff --git a/spec/ansible/disa/files/U_RHEL_9_STIG_V1R2_Manual-xccdf.xml b/spec/ansible/disa/files/U_RHEL_9_STIG_V1R2_Manual-xccdf.xml deleted file mode 100644 index 7b8879e..0000000 --- a/spec/ansible/disa/files/U_RHEL_9_STIG_V1R2_Manual-xccdf.xml +++ /dev/null @@ -1,7020 +0,0 @@ -acceptedRed Hat Enterprise Linux 9 Security Technical Implementation GuideThis Security Technical Implementation Guide is published as a tool to improve the security of Department of Defense (DOD) information systems. The requirements are derived from the National Institute of Standards and Technology (NIST) 800-53 and related documents. Comments or proposed revisions to this document should be sent via email to the following address: disa.stig_spt@mail.mil.DISASTIG.DOD.MILRelease: 2 Benchmark Date: 24 Jan 20243.4.1.229161.10.01I - Mission Critical Classified<ProfileDescription></ProfileDescription>I - Mission Critical Public<ProfileDescription></ProfileDescription>I - Mission Critical Sensitive<ProfileDescription></ProfileDescription>II - Mission Support Classified<ProfileDescription></ProfileDescription>II - Mission Support Public<ProfileDescription></ProfileDescription>II - Mission Support Sensitive<ProfileDescription></ProfileDescription>III - Administrative Classified<ProfileDescription></ProfileDescription>III - Administrative Public<ProfileDescription></ProfileDescription>III - Administrative Sensitive<ProfileDescription></ProfileDescription>SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-211010RHEL 9 must be a vendor-supported release.<VulnDiscussion>An operating system release is considered "supported" if the vendor continues to provide security patches for the product. With an unsupported release, it will not be possible to resolve security issues discovered in the system software. - -Red Hat offers the Extended Update Support (EUS) add-on to a Red Hat Enterprise Linux subscription, for a fee, for those customers who wish to standardize on a specific minor release for an extended period.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Upgrade to a supported version of RHEL 9.Verify that the version or RHEL 9 is vendor supported with the following command: - -$ cat /etc/redhat-release - -Red Hat Enterprise Linux release 9.2 (Plow) - -If the installed version of RHEL 9 is not supported, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-211015RHEL 9 vendor packaged system security patches and updates must be installed and up to date.<VulnDiscussion>Installing software updates is a fundamental mitigation against the exploitation of publicly known vulnerabilities. If the most recent security patches and updates are not installed, unauthorized users may take advantage of weaknesses in the unpatched software. The lack of prompt attention to patching could result in a system compromise.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Install RHEL 9 security patches and updates at the organizationally defined frequency. If system updates are installed via a centralized repository that is configured on the system, all updates can be installed with the following command: - -$ sudo dnf updateVerify RHEL 9 security patches and updates are installed and up to date. Updates are required to be applied with a frequency determined by organizational policy. - -Obtain the list of available package security updates from Red Hat. The URL for updates is https://access.redhat.com/errata-search/. It is important to note that updates provided by Red Hat may not be present on the system if the underlying packages are not installed. - -Check that the available package security updates have been installed on the system with the following command: - -$ dnf history list | more - - ID | Command line | Date and time | Action(s) | Altered -------------------------------------------------------------------------------- - 70 | install aide | 2023-03-05 10:58 | Install | 1 - 69 | update -y | 2023-03-04 14:34 | Update | 18 EE - 68 | install vlc | 2023-02-21 17:12 | Install | 21 - 67 | update -y | 2023-02-21 17:04 | Update | 7 EE - -Typical update frequency may be overridden by Information Assurance Vulnerability Alert (IAVA) notifications from CYBERCOM. - -If the system is in noncompliance with the organizational patching policy, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-09-211020RHEL 9 must display the Standard Mandatory DOD Notice and Consent Banner before granting local or remote access to the system via a command line user logon.<VulnDiscussion>Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. - -System use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist. - -Satisfies: SRG-OS-000023-GPOS-00006, SRG-OS-000228-GPOS-00088</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000048CCI-001384CCI-001385CCI-001386CCI-001387CCI-001388Configure RHEL 9 to display the Standard Mandatory DOD Notice and Consent Banner before granting access to the system via command line logon. - -Edit the "/etc/issue" file to replace the default text with the Standard Mandatory DOD Notice and Consent Banner. The DOD-required text is: - -"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. - -By using this IS (which includes any device attached to this IS), you consent to the following conditions: - --The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. - --At any time, the USG may inspect and seize data stored on this IS. - --Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. - --This IS includes security measures (e.g., authentication and access controls) to protect USG interests -- not for your personal benefit or privacy. - --Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details."Verify RHEL 9 displays the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a command line user logon. - -Check that a banner is displayed at the command line login screen with the following command: - -$ sudo cat /etc/issue - -If the banner is set correctly it will return the following text: - -"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. - -By using this IS (which includes any device attached to this IS), you consent to the following conditions: - --The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. - --At any time, the USG may inspect and seize data stored on this IS. - --Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. - --This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. - --Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details." - -If the banner text does not match the Standard Mandatory DOD Notice and Consent Banner exactly, or the line is commented out, this is a finding.SRG-OS-000191-GPOS-00080<GroupDescription></GroupDescription>RHEL-09-211025RHEL 9 must implement the Endpoint Security for Linux Threat Prevention tool.<VulnDiscussion>Without the use of automated mechanisms to scan for security flaws on a continuous and/or periodic basis, the operating system or other system components may remain vulnerable to the exploits presented by undetected software flaws. - -To support this requirement, the operating system may have an integrated solution incorporating continuous scanning using ESS and periodic scanning using other tools, as specified in the requirement.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001233Install and enable the latest McAfee ENSLTP package.Verify that RHEL 9 has implemented the Endpoint Security for Linux Threat Prevention tool. - -Check that the following package has been installed: - -$ sudo rpm -qa | grep -i mcafeetp - -If the "mcafeetp" package is not installed, this is a finding. - -Verify that the daemon is running: - -$ sudo ps -ef | grep -i mfetpd - -If the daemon is not running, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-211030The graphical display manager must not be the default target on RHEL 9 unless approved.<VulnDiscussion>Unnecessary service packages must not be installed to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Document the requirement for a graphical user interface with the ISSO or set the default target to multi-user with the following command: - -$ sudo systemctl set-default multi-user.targetVerify that RHEL 9 is configured to boot to the command line: - -$ systemctl get-default - -multi-user.target - -If the system default target is not set to "multi-user.target" and the information system security officer (ISSO) lacks a documented requirement for a graphical user interface, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-211035RHEL 9 must enable the hardware random number generator entropy gatherer service.<VulnDiscussion>The most important characteristic of a random number generator is its randomness, namely its ability to deliver random numbers that are impossible to predict. Entropy in computer security is associated with the unpredictability of a source of randomness. The random source with high entropy tends to achieve a uniform distribution of random values. Random number generators are one of the most important building blocks of cryptosystems. - -The rngd service feeds random data from hardware device to kernel random device. Quality (nonpredictable) random number generation is important for several security functions (i.e., ciphers).</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Install the rng-tools package with the following command: - -$ sudo dnf install rng-tools - -Then enable the rngd service run the following command: - -$ sudo systemctl enable --now rngdNote: For RHEL 9 systems running with kernel FIPS mode enabled as specified by RHEL-09-671010, this requirement is Not Applicable. - -Verify that RHEL 9 has enabled the hardware random number generator entropy gatherer service with the following command: - -$ systemctl is-active rngd - -active - -If the "rngd" service is not active, this is a finding.SRG-OS-000269-GPOS-00103<GroupDescription></GroupDescription>RHEL-09-211040RHEL 9 systemd-journald service must be enabled.<VulnDiscussion>In the event of a system failure, RHEL 9 must preserve any information necessary to determine cause of failure and any information necessary to return to operations with least disruption to system processes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001665To enable the systemd-journald service, run the following command: - -$ sudo systemctl enable --now systemd-journaldVerify that "systemd-journald" is active with the following command: - -$ systemctl is-active systemd-journald - -active - -If the systemd-journald service is not active, this is a finding.SRG-OS-000324-GPOS-00125<GroupDescription></GroupDescription>RHEL-09-211045The systemd Ctrl-Alt-Delete burst key sequence in RHEL 9 must be disabled.<VulnDiscussion>A locally logged-on user who presses Ctrl-Alt-Delete when at the console can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In a graphical user environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken. - -Satisfies: SRG-OS-000324-GPOS-00125, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-002235Configure the system to disable the CtrlAltDelBurstAction by added or modifying the following line in the "/etc/systemd/system.conf" configuration file: - -CtrlAltDelBurstAction=none - -Reload the daemon for this change to take effect. - -$ sudo systemctl daemon-reloadVerify RHEL 9 is configured to not reboot the system when Ctrl-Alt-Delete is pressed seven times within two seconds with the following command: - -$ grep -i ctrl /etc/systemd/system.conf - -CtrlAltDelBurstAction=none - -If the "CtrlAltDelBurstAction" is not set to "none", commented out, or is missing, this is a finding.SRG-OS-000324-GPOS-00125<GroupDescription></GroupDescription>RHEL-09-211050The x86 Ctrl-Alt-Delete key sequence must be disabled on RHEL 9.<VulnDiscussion>A locally logged-on user who presses Ctrl-Alt-Delete when at the console can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In a graphical user environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken. - -Satisfies: SRG-OS-000324-GPOS-00125, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-002235Configure RHEL 9 to disable the ctrl-alt-del.target with the following command: - -$ sudo systemctl disable --now ctrl-alt-del.target -$ sudo systemctl mask --now ctrl-alt-del.targetVerify RHEL 9 is not configured to reboot the system when Ctrl-Alt-Delete is pressed with the following command: - -$ sudo systemctl status ctrl-alt-del.target - -ctrl-alt-del.target -Loaded: masked (Reason: Unit ctrl-alt-del.target is masked.) -Active: inactive (dead) - -If the "ctrl-alt-del.target" is loaded and not masked, this is a finding.SRG-OS-000324-GPOS-00125<GroupDescription></GroupDescription>RHEL-09-211055RHEL 9 debug-shell systemd service must be disabled.<VulnDiscussion>The debug-shell requires no authentication and provides root privileges to anyone who has physical access to the machine. While this feature is disabled by default, masking it adds an additional layer of assurance that it will not be enabled via a dependency in systemd. This also prevents attackers with physical access from trivially bypassing security on the machine through valid troubleshooting configurations and gaining root access when the system is rebooted. - -Satisfies: SRG-OS-000324-GPOS-00125, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-002235Configure RHEL 9 to mask the debug-shell systemd service with the following command: - -$ sudo systemctl disable --now debug-shell.service -$ sudo systemctl mask --now debug-shell.serviceVerify RHEL 9 is configured to mask the debug-shell systemd service with the following command: - -$ sudo systemctl status debug-shell.service - -debug-shell.service -Loaded: masked (Reason: Unit debug-shell.service is masked.) -Active: inactive (dead) - -If the "debug-shell.service" is loaded and not masked, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-09-212010RHEL 9 must require a boot loader superuser password.<VulnDiscussion>To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. - -Password protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000213Configure RHEL 9 to require a grub bootloader password for the grub superuser account. - -Generate an encrypted grub2 password for the grub superuser account with the following command: - -$ sudo grub2-setpassword -Enter password: -Confirm password:Verify the boot loader superuser password has been set and run the following command: - -$ sudo grep "superusers" /etc/grub2.cfg - -password_pbkdf2 superusers-account ${GRUB2_PASSWORD} - -To verify the boot loader superuser account password has been set, and the password encrypted, run the following command: - -$ sudo cat /boot/grub2/user.cfg - -GRUB2_PASSWORD=grub.pbkdf2.sha512.10000.C4E08AC72FBFF7E837FD267BFAD7AEB3D42DDC -2C99F2A94DD5E2E75C2DC331B719FE55D9411745F82D1B6CFD9E927D61925F9BBDD1CFAA0080E0 -916F7AB46E0D.1302284FCCC52CD73BA3671C6C12C26FF50BA873293B24EE2A96EE3B57963E6D7 -0C83964B473EC8F93B07FE749AA6710269E904A9B08A6BBACB00A2D242AD828 - -If a "GRUB2_PASSWORD" is not set, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-212015RHEL 9 must disable the ability of systemd to spawn an interactive boot process.<VulnDiscussion>Using interactive or recovery boot, the console user could disable auditing, firewalls, or other services, weakening system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to allocate sufficient audit_backlog_limit to disable the ability of systemd to spawn an interactive boot process with the following command: - -$ sudo grubby --update-kernel=ALL --remove-args="systemd.confirm_spawn"Verify that GRUB 2 is configured to disable interactive boot. - -Check that the current GRUB 2 configuration disables the ability of systemd to spawn an interactive boot process with the following command: - -$ sudo grubby --info=ALL | grep args | grep 'systemd.confirm_spawn' - -If any output is returned, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-09-212020RHEL 9 must require a unique superusers name upon booting into single-user and maintenance modes.<VulnDiscussion>Having a nondefault grub superuser username makes password-guessing attacks less effective.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000213Configure RHEL 9 to have a unique username for the grub superuser account. - -Edit the "/etc/grub.d/01_users" file and add or modify the following lines in the "### BEGIN /etc/grub.d/01_users ###" section: - -set superusers="superusers-account" -export superusers - -Once the superuser account has been added, update the grub.cfg file by running: - -$ sudo grubby --update-kernel=ALLVerify the boot loader superuser account has been set with the following command: - -$ sudo grep -A1 "superusers" /etc/grub2.cfg - -set superusers="<superusers-account>" -export superusers - -The <superusers-account> is the actual account name different from common names like root, admin, or administrator. - -If superusers contains easily guessable usernames, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-212025RHEL 9 /boot/grub2/grub.cfg file must be group-owned by root.<VulnDiscussion>The "root" group is a highly privileged group. Furthermore, the group-owner of this file should not have any access privileges anyway.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /boot/grub2/grub.cfg to root by running the following command: - -$ sudo chgrp root /boot/grub2/grub.cfgVerify the group ownership of the "/boot/grub2/grub.cfg" file with the following command: - -$ sudo stat -c "%G %n" /boot/grub2/grub.cfg - -root /boot/grub2/grub.cfg - -If "/boot/grub2/grub.cfg" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-212030RHEL 9 /boot/grub2/grub.cfg file must be owned by root.<VulnDiscussion>The " /boot/grub2/grub.cfg" file stores sensitive system configuration. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /boot/grub2/grub.cfg to root by running the following command: - -$ sudo chown root /boot/grub2/grub.cfgVerify the ownership of the "/boot/grub2/grub.cfg" file with the following command: - -$ sudo stat -c "%U %n" /boot/grub2/grub.cfg - -root /boot/grub2/grub.cfg - -If "/boot/grub2/grub.cfg" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-212035RHEL 9 must disable virtual system calls.<VulnDiscussion>System calls are special routines in the Linux kernel, which userspace applications ask to do privileged tasks. Invoking a system call is an expensive operation because the processor must interrupt the currently executing task and switch context to kernel mode and then back to userspace after the system call completes. Virtual system calls map into user space a page that contains some variables and the implementation of some system calls. This allows the system calls to be executed in userspace to alleviate the context switching expense. - -Virtual system calls provide an opportunity of attack for a user who has control of the return instruction pointer. Disabling virtual system calls help to prevent return oriented programming (ROP) attacks via buffer overflows and overruns. If the system intends to run containers based on RHEL 6 components, then virtual system calls will need enabled so the components function properly. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000134-GPOS-00068</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001084Document the use of virtual system calls with the ISSO as an operational requirement or disable them with the following command: - -$ sudo grubby --update-kernel=ALL --args="vsyscall=none" - -Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: - -GRUB_CMDLINE_LINUX="vsyscall=none"Verify the current GRUB 2 configuration disables virtual system calls with the following command: - -$ sudo grubby --info=ALL | grep args | grep -v 'vsyscall=none' - -If any output is returned, this is a finding. - -Check that virtual system calls are disabled by default to persist in kernel updates with the following command: - -$ sudo grep vsyscall /etc/default/grub - -GRUB_CMDLINE_LINUX="vsyscall=none" - -If "vsyscall" is not set to "none", is missing or commented out, and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-212040RHEL 9 must clear the page allocator to prevent use-after-free attacks.<VulnDiscussion>Poisoning writes an arbitrary value to freed pages, so any modification or reference to that page after being freed or before being initialized will be detected and prevented. This prevents many types of use-after-free vulnerabilities at little performance cost. Also prevents leak of data and detection of corrupted memory. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000134-GPOS-00068</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001084Configure RHEL 9 to enable page poisoning with the following commands: - -$ sudo grubby --update-kernel=ALL --args="page_poison=1" - -Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: - -GRUB_CMDLINE_LINUX="page_poison=1"Verify that GRUB 2 is configured to enable page poisoning to mitigate use-after-free vulnerabilities. - -Check that the current GRUB 2 configuration has page poisoning enabled with the following command: - -$ sudo grubby --info=ALL | grep args | grep -v 'page_poison=1' - -If any output is returned, this is a finding. - -Check that page poisoning is enabled by default to persist in kernel updates with the following command: - -$ sudo grep page_poison /etc/default/grub - -GRUB_CMDLINE_LINUX="page_poison=1" - -If "page_poison" is not set to "1", is missing or commented out, this is a finding.SRG-OS-000433-GPOS-00192<GroupDescription></GroupDescription>RHEL-09-212045RHEL 9 must clear SLUB/SLAB objects to prevent use-after-free attacks.<VulnDiscussion>Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can be either hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. - -Poisoning writes an arbitrary value to freed pages, so any modification or reference to that page after being freed or before being initialized will be detected and prevented. This prevents many types of use-after-free vulnerabilities at little performance cost. Also prevents leak of data and detection of corrupted memory. - -SLAB objects are blocks of physically contiguous memory. SLUB is the unqueued SLAB allocator. - -Satisfies: SRG-OS-000433-GPOS-00192, SRG-OS-000134-GPOS-00068</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001084CCI-002824Configure RHEL to enable poisoning of SLUB/SLAB objects with the following commands: - -$ sudo grubby --update-kernel=ALL --args="slub_debug=P" - -Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: - -GRUB_CMDLINE_LINUX="slub_debug=P"Verify that GRUB 2 is configured to enable poisoning of SLUB/SLAB objects to mitigate use-after-free vulnerabilities with the following commands: - -Check that the current GRUB 2 configuration has poisoning of SLUB/SLAB objects enabled: - -$ sudo grubby --info=ALL | grep args | grep -v 'slub_debug=P' - -If any output is returned, this is a finding. - -Check that poisoning of SLUB/SLAB objects is enabled by default to persist in kernel updates: - -$ sudo grep slub_debug /etc/default/grub - -GRUB_CMDLINE_LINUX="slub_debug=P" - -If "slub_debug" is not set to "P", is missing or commented out, this is a finding.SRG-OS-000433-GPOS-00193<GroupDescription></GroupDescription>RHEL-09-212050RHEL 9 must enable mitigations against processor-based vulnerabilities.<VulnDiscussion>Kernel page-table isolation is a kernel feature that mitigates the Meltdown security vulnerability and hardens the kernel against attempts to bypass kernel address space layout randomization (KASLR). - -Satisfies: SRG-OS-000433-GPOS-00193, SRG-OS-000095-GPOS-00049</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381CCI-002824Configure RHEL 9 to enable kernel page-table isolation with the following command: - -$ sudo grubby --update-kernel=ALL --args="pti=on" - -Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: - -GRUB_CMDLINE_LINUX="pti=on"Verify RHEL 9 enables kernel page-table isolation with the following command: - -$ sudo grubby --info=ALL | grep pti - -args="ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 pti=on - -If the "pti" entry does not equal "on", or is missing, this is a finding. - -Check that kernel page-table isolation is enabled by default to persist in kernel updates: - -$ sudo grep pti /etc/default/grub - -GRUB_CMDLINE_LINUX="pti=on" - -If "pti" is not set to "on", is missing or commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-212055RHEL 9 must enable auditing of processes that start prior to the audit daemon.<VulnDiscussion>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000473-GPOS-00218, SRG-OS-000254-GPOS-00095</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-001464CCI-002884Enable auditing of processes that start prior to the audit daemon with the following command: - -$ sudo grubby --update-kernel=ALL --args="audit=1" - -Add or modify the following line in "/etc/default/grub" to ensure the configuration survives kernel updates: - -GRUB_CMDLINE_LINUX="audit=1"Verify that GRUB 2 is configured to enable auditing of processes that start prior to the audit daemon with the following commands: - -Check that the current GRUB 2 configuration enabled auditing: - -$ sudo grubby --info=ALL | grep audit - -args="ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet fips=1 audit=1 audit_backlog_limit=8192 pti=on - -If "audit" is not set to "1" or is missing, this is a finding. - -Check that auditing is enabled by default to persist in kernel updates: - -$ sudo grep audit /etc/default/grub - -GRUB_CMDLINE_LINUX="audit=1" - -If "audit" is not set to "1", is missing, or is commented out, this is a finding.SRG-OS-000132-GPOS-00067<GroupDescription></GroupDescription>RHEL-09-213010RHEL 9 must restrict access to the kernel message buffer.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. - -This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DOD or other government agencies. - -There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. - -Restricting access to the kernel message buffer limits access to only root. This prevents attackers from gaining additional system information as a nonprivileged user. - -Satisfies: SRG-OS-000132-GPOS-00067, SRG-OS-000138-GPOS-00069</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001082CCI-001090Configure RHEL 9 to restrict access to the kernel message buffer. - -Add or edit the following line in a system configuration file, in the "/etc/sysctl.d/" directory: - -kernel.dmesg_restrict = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is configured to restrict access to the kernel message buffer with the following commands: - -Check the status of the kernel.dmesg_restrict kernel parameter. - -$ sudo sysctl kernel.dmesg_restrict - -kernel.dmesg_restrict = 1 - -If "kernel.dmesg_restrict" is not set to "1" or is missing, this is a finding. - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.dmesg_restrict | tail -1 - -kernel.dmesg_restrict = 1 - -If "kernel.dmesg_restrict" is not set to "1" or is missing, this is a finding.SRG-OS-000132-GPOS-00067<GroupDescription></GroupDescription>RHEL-09-213015RHEL 9 must prevent kernel profiling by nonprivileged users.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. - -This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DOD or other government agencies. - -There may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components. - -Setting the kernel.perf_event_paranoid kernel parameter to "2" prevents attackers from gaining additional system information as a nonprivileged user. - -Satisfies: SRG-OS-000132-GPOS-00067, SRG-OS-000138-GPOS-00069</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001082CCI-001090Configure RHEL 9 to prevent kernel profiling by nonprivileged users. - -Add or edit the following line in a system configuration file, in the "/etc/sysctl.d/" directory: - -kernel.perf_event_paranoid = 2 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is configured to prevent kernel profiling by nonprivileged users with the following commands: - -Check the status of the kernel.perf_event_paranoid kernel parameter. - -$ sudo sysctl kernel.perf_event_paranoid - -kernel.perf_event_paranoid = 2 - -If "kernel.perf_event_paranoid" is not set to "2" or is missing, this is a finding. -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.perf_event_paranoid | tail -1 - -kernel.perf_event_paranoid = 2 - -If "kernel.perf_event_paranoid" is not set to "2" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213020RHEL 9 must prevent the loading of a new kernel for later execution.<VulnDiscussion>Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. - -Disabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000366-GPOS-00153</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001749Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: - -kernel.kexec_load_disabled = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is configured to disable kernel image loading. - -Check the status of the kernel.kexec_load_disabled kernel parameter with the following command: - -$ sudo sysctl kernel.kexec_load_disabled - -kernel.kexec_load_disabled = 1 - -If "kernel.kexec_load_disabled" is not set to "1" or is missing, this is a finding. - -Check that the configuration files are present to enable this kernel parameter with the following command: - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.kexec_load_disabled | tail -1 - -kernel.kexec_load_disabled = 1 - -If "kernel.kexec_load_disabled" is not set to "1" or is missing, this is a finding.SRG-OS-000132-GPOS-00067<GroupDescription></GroupDescription>RHEL-09-213025RHEL 9 must restrict exposed kernel pointer addresses access.<VulnDiscussion>Exposing kernel pointers (through procfs or "seq_printf()") exposes kernel writeable structures, which may contain functions pointers. If a write vulnerability occurs in the kernel, allowing write access to any of this structure, the kernel can be compromised. This option disallows any program without the CAP_SYSLOG capability to get the addresses of kernel pointers by replacing them with "0". - -Satisfies: SRG-OS-000132-GPOS-00067, SRG-OS-000433-GPOS-00192, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001082CCI-002824Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: - -kernel.kptr_restrict = 1 - -Reload settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify the runtime status of the kernel.kptr_restrict kernel parameter with the following command: - -$ sudo sysctl kernel.kptr_restrict - -kernel.kptr_restrict = 1 - -Verify the configuration of the kernel.kptr_restrict kernel parameter with the following command: - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.kptr_restrict | tail -1 - -kernel.kptr_restrict =1 - -If "kernel.kptr_restrict" is not set to "1" or is missing, this is a finding.SRG-OS-000312-GPOS-00123<GroupDescription></GroupDescription>RHEL-09-213030RHEL 9 must enable kernel parameters to enforce discretionary access control on hardlinks.<VulnDiscussion>By enabling the fs.protected_hardlinks kernel parameter, users can no longer create soft or hard links to files they do not own. Disallowing such hardlinks mitigates vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat(). - -Satisfies: SRG-OS-000312-GPOS-00123, SRG-OS-000324-GPOS-00125</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002165CCI-002235Configure RHEL 9 to enable DAC on hardlinks with the following: - -Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: - -fs.protected_hardlinks = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is configured to enable DAC on hardlinks. - -Check the status of the fs.protected_hardlinks kernel parameter with the following command: - -$ sudo sysctl fs.protected_hardlinks - -fs.protected_hardlinks = 1 - -If "fs.protected_hardlinks" is not set to "1" or is missing, this is a finding. - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F fs.protected_hardlinks | tail -1 - -fs.protected_hardlinks = 1 - -If "fs.protected_hardlinks" is not set to "1" or is missing, this is a finding.SRG-OS-000312-GPOS-00123<GroupDescription></GroupDescription>RHEL-09-213035RHEL 9 must enable kernel parameters to enforce discretionary access control on symlinks.<VulnDiscussion>By enabling the fs.protected_symlinks kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the user identifier (UID) of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of open() or creat(). - -Satisfies: SRG-OS-000312-GPOS-00123, SRG-OS-000324-GPOS-00125</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002165CCI-002235Configure RHEL 9 to enable DAC on symlinks with the following: - -Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: - -fs.protected_symlinks = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is configured to enable DAC on symlinks. - -Check the status of the fs.protected_symlinks kernel parameter with the following command: - -$ sudo sysctl fs.protected_symlinks - -fs.protected_symlinks = 1 - -If "fs.protected_symlinks " is not set to "1" or is missing, this is a finding. - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F fs.protected_symlinks | tail -1 - -fs.protected_symlinks = 1 - -If "fs.protected_symlinks" is not set to "1" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213040RHEL 9 must disable the kernel.core_pattern.<VulnDiscussion>A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers trying to debug problems.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to disable storing core dumps. - -Add or edit the following line in a system configuration file, in the "/etc/sysctl.d/" directory: - -kernel.core_pattern = |/bin/false - -The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: - -$ sudo sysctl --systemVerify RHEL 9 disables storing core dumps with the following commands: - -$ sudo sysctl kernel.core_pattern - -kernel.core_pattern = |/bin/false - -If the returned line does not have a value of "|/bin/false", or a line is not returned and the need for core dumps is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding. - -Check that the configuration files are present to disable core dump storage. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.core_pattern | tail -1 - -kernel.core_pattern = |/bin/false - -If "kernel.core_pattern" is not set to "|/bin/false" and is not documented with the ISSO as an operational requirement, or is missing, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-213045RHEL 9 must be configured to disable the Asynchronous Transfer Mode kernel module.<VulnDiscussion>Disabling Asynchronous Transfer Mode (ATM) protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381To configure the system to prevent the atm kernel module from being loaded, add the following line to the file /etc/modprobe.d/atm.conf (or create atm.conf if it does not exist): - -install atm /bin/false -blacklist atmVerify that RHEL 9 disables the ability to load the ATM kernel module with the following command: - -$ sudo grep -r atm /etc/modprobe.conf /etc/modprobe.d/* - -blacklist atm - -If the command does not return any output, or the line is commented out, and use of ATM is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-213050RHEL 9 must be configured to disable the Controller Area Network kernel module.<VulnDiscussion>Disabling Controller Area Network (CAN) protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381To configure the system to prevent the can kernel module from being loaded, add the following line to the file /etc/modprobe.d/can.conf (or create atm.conf if it does not exist): - -install can /bin/false -blacklist canVerify that RHEL 9 disables the ability to load the CAN kernel module with the following command: - -$ sudo grep -r can /etc/modprobe.conf /etc/modprobe.d/* - -blacklist can - -If the command does not return any output, or the line is commented out, and use of CAN is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-213055RHEL 9 must be configured to disable the FireWire kernel module.<VulnDiscussion>Disabling firewire protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381To configure the system to prevent the firewire-core kernel module from being loaded, add the following line to the file /etc/modprobe.d/firewire-core.conf (or create firewire-core.conf if it does not exist): - -install firewire-core /bin/false -blacklist firewire-coreVerify that RHEL 9 disables the ability to load the firewire-core kernel module with the following command: - -$ sudo grep -r firewire-core /etc/modprobe.conf /etc/modprobe.d/* - -blacklist firewire-core - -If the command does not return any output, or the line is commented out, and use of firewire-core is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-213060RHEL 9 must disable the Stream Control Transmission Protocol (SCTP) kernel module.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. - -Failing to disconnect unused protocols can result in a system compromise. - -The Stream Control Transmission Protocol (SCTP) is a transport layer protocol, designed to support the idea of message-oriented communication, with several streams of messages within one connection. Disabling SCTP protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381To configure the system to prevent the sctp kernel module from being loaded, add the following line to the file /etc/modprobe.d/sctp.conf (or create sctp.conf if it does not exist): - -install sctp/bin/false -blacklist sctpVerify that RHEL 9 disables the ability to load the sctp kernel module with the following command: - -$ sudo grep -r sctp /etc/modprobe.conf /etc/modprobe.d/* - -blacklist sctp - -If the command does not return any output, or the line is commented out, and use of sctp is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-213065RHEL 9 must disable the Transparent Inter Process Communication (TIPC) kernel module.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. - -Failing to disconnect unused protocols can result in a system compromise. - -The Transparent Inter Process Communication (TIPC) is a protocol that is specially designed for intra-cluster communication. It can be configured to transmit messages either on UDP or directly across Ethernet. Message delivery is sequence guaranteed, loss free and flow controlled. Disabling TIPC protects the system against exploitation of any flaws in its implementation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381To configure the system to prevent the tipc kernel module from being loaded, add the following line to the file /etc/modprobe.d/tipc.conf (or create tipc.conf if it does not exist): - -install tipc /bin/false -blacklist tipcVerify that RHEL 9 disables the ability to load the tipc kernel module with the following command: - -$ sudo grep -r tipc /etc/modprobe.conf /etc/modprobe.d/* - -blacklist tipc - -If the command does not return any output, or the line is commented out, and use of tipc is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000433-GPOS-00193<GroupDescription></GroupDescription>RHEL-09-213070RHEL 9 must implement address space layout randomization (ASLR) to protect its memory from unauthorized code execution.<VulnDiscussion>Address space layout randomization (ASLR) makes it more difficult for an attacker to predict the location of attack code they have introduced into a process' address space during an attempt at exploitation. Additionally, ASLR makes it more difficult for an attacker to know the location of existing code in order to repurpose it using return oriented programming (ROP) techniques. - -Satisfies: SRG-OS-000433-GPOS-00193, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-002824Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: - -kernel.randomize_va_space = 2 - -Reload settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is implementing ASLR with the following command: - -$ sudo sysctl kernel.randomize_va_space - -kernel.randomize_va_space = 2 - -Check that the configuration files are present to enable this kernel parameter. -Verify the configuration of the kernel.kptr_restrict kernel parameter with the following command: - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.randomize_va_space | tail -1 - -kernel.randomize_va_space = 2 - -If "kernel.randomize_va_space" is not set to "2" or is missing, this is a finding.SRG-OS-000132-GPOS-00067<GroupDescription></GroupDescription>RHEL-09-213075RHEL 9 must disable access to network bpf system call from nonprivileged processes.<VulnDiscussion>Loading and accessing the packet filters programs and maps using the bpf() system call has the potential of revealing sensitive information about the kernel state. - -Satisfies: SRG-OS-000132-GPOS-00067, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001082Configure RHEL 9 to prevent privilege escalation thru the kernel by disabling access to the bpf syscall by adding the following line to a file, in the "/etc/sysctl.d" directory: - -kernel.unprivileged_bpf_disabled = 1 - -The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: - -$ sudo sysctl --systemVerify RHEL 9 prevents privilege escalation thru the kernel by disabling access to the bpf system call with the following commands: - -$ sudo sysctl kernel.unprivileged_bpf_disabled - -kernel.unprivileged_bpf_disabled = 1 - -If the returned line does not have a value of "1", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.unprivileged_bpf_disabled | tail -1 -kernel.unprivileged_bpf_disabled = 1 - -If the network parameter "ipv4.tcp_syncookies" is not equal to "1", or nothing is returned, this is a finding.SRG-OS-000132-GPOS-00067<GroupDescription></GroupDescription>RHEL-09-213080RHEL 9 must restrict usage of ptrace to descendant processes.<VulnDiscussion>Unrestricted usage of ptrace allows compromised binaries to run ptrace on other processes of the user. Like this, the attacker can steal sensitive information from the target processes (e.g., SSH sessions, web browser, etc.) without any additional assistance from the user (i.e., without resorting to phishing). - -Satisfies: SRG-OS-000132-GPOS-00067, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001082Configure RHEL 9 to restrict usage of ptrace to descendant processes by adding the following line to a file, in the "/etc/sysctl.d" directory: - -kernel.yama.ptrace_scope = 1 - -The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: - -$ sudo sysctl --systemVerify RHEL 9 restricts usage of ptrace to descendant processes with the following commands: - -$ sudo sysctl kernel.yama.ptrace_scope - -kernel.yama.ptrace_scope = 1 - -If the returned line does not have a value of "1", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.yama.ptrace_scope| tail -1 -kernel.yama.ptrace_scope = 1 - -If the network parameter "kernel.yama.ptrace_scope" is not equal to "1", or nothing is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213085RHEL 9 must disable core dump backtraces.<VulnDiscussion>A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers or system operators trying to debug problems. - -Enabling core dumps on production systems is not recommended; however, there may be overriding operational requirements to enable advanced debugging. Permitting temporary enablement of core dumps during such situations must be reviewed through local needs and policy.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the operating system to disable core dump backtraces. - -Add or modify the following line in /etc/systemd/coredump.conf: - -ProcessSizeMax=0Verify RHEL 9 disables core dump backtraces by issuing the following command: - -$ grep -i process /etc/systemd/coredump.conf - -ProcessSizeMax=0 - -If the "ProcessSizeMax" item is missing, commented out, or the value is anything other than "0" and the need for core dumps is not documented with the information system security officer (ISSO) as an operational requirement for all domains that have the "core" item assigned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213090RHEL 9 must disable storing core dumps.<VulnDiscussion>A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers or system operators trying to debug problems. Enabling core dumps on production systems is not recommended; however, there may be overriding operational requirements to enable advanced debugging. Permitting temporary enablement of core dumps during such situations must be reviewed through local needs and policy.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the operating system to disable storing core dumps for all users. - -Add or modify the following line in /etc/systemd/coredump.conf: - -Storage=noneVerify RHEL 9 disables storing core dumps for all users by issuing the following command: - -$ grep -i storage /etc/systemd/coredump.conf - -Storage=none - -If the "Storage" item is missing, commented out, or the value is anything other than "none" and the need for core dumps is not documented with the information system security officer (ISSO) as an operational requirement for all domains that have the "core" item assigned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213095RHEL 9 must disable core dumps for all users.<VulnDiscussion>A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers trying to debug problems.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the operating system to disable core dumps for all users. - -Add the following line to the top of the /etc/security/limits.conf or in a single ".conf" file defined in /etc/security/limits.d/: - -* hard core 0Verify RHEL 9 disables core dumps for all users by issuing the following command: - -$ grep -r -s core /etc/security/limits.conf /etc/security/limits.d/*.conf - -/etc/security/limits.conf:* hard core 0 - -This can be set as a global domain (with the * wildcard) but may be set differently for multiple domains. - -If the "core" item is missing, commented out, or the value is anything other than "0" and the need for core dumps is not documented with the information system security officer (ISSO) as an operational requirement for all domains that have the "core" item assigned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213100RHEL 9 must disable acquiring, saving, and processing core dumps.<VulnDiscussion>A core dump includes a memory image taken at the time the operating system terminates an application. The memory image could contain sensitive data and is generally useful only for developers trying to debug problems.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the system to disable the systemd-coredump.socket with the following command: - -$ sudo systemctl mask --now systemd-coredump.socket - -Created symlink /etc/systemd/system/systemd-coredump.socket -> /dev/null - -Reload the daemon for this change to take effect. - -$ sudo systemctl daemon-reloadVerify RHEL 9 is not configured to acquire, save, or process core dumps with the following command: - -$ sudo systemctl status systemd-coredump.socket - -systemd-coredump.socket -Loaded: masked (Reason: Unit systemd-coredump.socket is masked.) -Active: inactive (dead) - -If the "systemd-coredump.socket" is loaded and not masked and the need for core dumps is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213105RHEL 9 must disable the use of user namespaces.<VulnDiscussion>User namespaces are used primarily for Linux containers. The value "0" disallows the use of user namespaces.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to disable the use of user namespaces by adding the following line to a file, in the "/etc/sysctl.d" directory: - -Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is Not Applicable. - -user.max_user_namespaces = 0 - -The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: - -$ sudo sysctl --systemVerify RHEL 9 disables the use of user namespaces with the following commands: - -Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is Not Applicable. - -$ sudo sysctl user.max_user_namespaces - -user.max_user_namespaces = 0 - -If the returned line does not have a value of "0", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F user.max_user_namespaces | tail -1 -user.max_user_namespaces = 0 - -If the network parameter "user.max_user_namespaces" is not equal to "0", or nothing is returned, this is a finding.SRG-OS-000433-GPOS-00192<GroupDescription></GroupDescription>RHEL-09-213110RHEL 9 must implement nonexecutable data to protect its memory from unauthorized code execution.<VulnDiscussion>ExecShield uses the segmentation feature on all x86 systems to prevent execution in memory higher than a certain address. It writes an address as a limit in the code segment descriptor, to control where code can be executed, on a per-process basis. When the kernel places a process's memory regions such as the stack and heap higher than this address, the hardware prevents execution in that address range. This is enabled by default on the latest Red Hat and Fedora systems if supported by the hardware.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002824Update the GRUB 2 bootloader configuration. - -Run the following command: - -$ sudo grubby --update-kernel=ALL --remove-args=noexecVerify ExecShield is enabled on 64-bit RHEL 9 systems with the following command: - -$ sudo dmesg | grep '[NX|DX]*protection' - -[ 0.000000] NX (Execute Disable) protection: active - -If "dmesg" does not show "NX (Execute Disable) protection" active, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-213115The kdump service on RHEL 9 must be disabled.<VulnDiscussion>Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition. Unless the system is used for kernel development or testing, there is little need to run the kdump service.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Disable and mask the kdump service on RHEL 9. - -To disable the kdump service run the following command: - -$ sudo systemctl disable --now kdump - -To mask the kdump service run the following command: - -$ sudo systemctl mask --now kdumpVerify that the kdump service is disabled in system boot configuration with the following command: - -$ systemctl is-enabled kdump - -disabled - -Verify that the kdump service is not active (i.e., not running) through current runtime configuration with the following command: - -$ systemctl is-active kdump - -inactive - -Verify that the kdump service is masked with the following command: - -$ sudo systemctl show kdump | grep "LoadState\|UnitFileState" - -LoadState=masked - -UnitFileState=masked - -If the "kdump" service is loaded or active, and is not masked, this is a finding.SRG-OS-000366-GPOS-00153<GroupDescription></GroupDescription>RHEL-09-214010RHEL 9 must ensure cryptographic verification of vendor software packages.<VulnDiscussion>Cryptographic verification of vendor software packages ensures that all software packages are obtained from a valid source and protects against spoofing that could lead to installation of malware on the system. Red Hat cryptographically signs all software packages, which includes updates, with a GPG key to verify that they are valid.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001749Install Red Hat package-signing keys on the system and verify their fingerprints match vendor values. - -Insert RHEL 9 installation disc or attach RHEL 9 installation image to the system. Mount the disc or image to make the contents accessible inside the system. - -Assuming the mounted location is "/media/cdrom", use the following command to copy Red Hat GPG key file onto the system: - -$ sudo cp /media/cdrom/RPM-GPG-KEY-redhat-release /etc/pki/rpm-gpg/ - -Import Red Hat GPG keys from key file into system keyring: - -$ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release - -Using the steps listed in the Check Text, confirm the newly imported keys show as installed on the system and verify their fingerprints match vendor values.Confirm Red Hat package-signing keys are installed on the system and verify their fingerprints match vendor values. - -Note: For RHEL 9 software packages, Red Hat uses GPG keys labeled "release key 2" and "auxiliary key 3". The keys are defined in key file "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release" by default. - -List Red Hat GPG keys installed on the system: - -$ sudo rpm -q --queryformat "%{SUMMARY}\n" gpg-pubkey | grep -i "red hat" - -Red Hat, Inc. (release key 2) <security@redhat.com> public key -Red Hat, Inc. (auxiliary key 3) <security@redhat.com> public key - -If Red Hat GPG keys "release key 2" and "auxiliary key 3" are not installed, this is a finding. - -List key fingerprints of installed Red Hat GPG keys: - -$ sudo gpg -q --keyid-format short --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release - -If key file "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release" is missing, this is a finding. - -Example output: - -pub rsa4096/FD431D51 2009-10-22 [SC] - Key fingerprint = 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51 -uid Red Hat, Inc. (release key 2) <security@redhat.com> -pub rsa4096/5A6340B3 2022-03-09 [SC] - Key fingerprint = 7E46 2425 8C40 6535 D56D 6F13 5054 E4A4 5A63 40B3 -uid Red Hat, Inc. (auxiliary key 3) <security@redhat.com> - -Compare key fingerprints of installed Red Hat GPG keys with fingerprints listed for RHEL 9 on Red Hat "Product Signing Keys" webpage at https://access.redhat.com/security/team/key. - -If key fingerprints do not match, this is a finding.SRG-OS-000366-GPOS-00153<GroupDescription></GroupDescription>RHEL-09-214015RHEL 9 must check the GPG signature of software packages originating from external software repositories before installation.<VulnDiscussion>Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. - -All software packages must be signed with a cryptographic key recognized and approved by the organization. - -Verifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001749Configure dnf to always check the GPG signature of software packages originating from external software repositories before installation. - -Add or update the following line in the [main] section of the /etc/dnf/dnf.conf file: - -gpgcheck=1Verify that dnf always checks the GPG signature of software packages originating from external software repositories before installation: - -$ grep gpgcheck /etc/dnf/dnf.conf - -gpgcheck=1 - -If "gpgcheck" is not set to "1", or if the option is missing or commented out, ask the system administrator how the GPG signatures of software packages are being verified. - -If there is no process to verify GPG signatures that is approved by the organization, this is a finding.SRG-OS-000366-GPOS-00153<GroupDescription></GroupDescription>RHEL-09-214020RHEL 9 must check the GPG signature of locally installed software packages before installation.<VulnDiscussion>Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. - -All software packages must be signed with a cryptographic key recognized and approved by the organization. - -Verifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001749Configure dnf to always check the GPG signature of local software packages before installation. - -Add or update the following line in the [main] section of the /etc/dnf/dnf.conf file: - -localpkg_gpgcheck=1Verify that dnf always checks the GPG signature of locally installed software packages before installation: - -$ grep localpkg_gpgcheck /etc/dnf/dnf.conf - -localpkg_gpgcheck=1 - -If "localpkg_gpgcheck" is not set to "1", or if the option is missing or commented out, ask the system administrator how the GPG signatures of local software packages are being verified. - -If there is no process to verify GPG signatures that is approved by the organization, this is a finding.SRG-OS-000366-GPOS-00153<GroupDescription></GroupDescription>RHEL-09-214025RHEL 9 must have GPG signature verification enabled for all software repositories.<VulnDiscussion>Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. - -All software packages must be signed with a cryptographic key recognized and approved by the organization. - -Verifying the authenticity of software prior to installation validates the integrity of the software package received from a vendor. This verifies the software has not been tampered with and that it has been provided by a trusted vendor.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001749Configure all software repositories defined in "/etc/yum.repos.d/" to have "gpgcheck" enabled: - -$ sudo sed -i 's/gpgcheck\s*=.*/gpgcheck=1/g' /etc/yum.repos.d/*Verify that all software repositories defined in "/etc/yum.repos.d/" have been configured with "gpgcheck" enabled: - -$ grep gpgcheck /etc/yum.repos.d/*.repo | more - -gpgcheck = 1 - -If "gpgcheck" is not set to "1" for all returned lines, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-214030RHEL 9 must be configured so that the cryptographic hashes of system files match vendor values.<VulnDiscussion>The hashes of important files like system executables should match the information given by the RPM database. Executables with erroneous hashes could be a sign of nefarious activity on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Given output from the check command, identify the package that provides the output and reinstall it. The following trimmed example output shows a package that has failed verification, been identified, and been reinstalled: - -$ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != "c"' -S.5....T. /usr/bin/znew -$ sudo dnf provides /usr/bin/znew -[...] -gzip-1.10-8.el9.x86_64 : The GNU data compression program -[...] -$ sudo dnf reinstall gzip -[...] -$ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != "c"' -[no output]The following command will list which files on the system have file hashes different from what is expected by the RPM database: - - $ rpm -Va --noconfig | awk '$1 ~ /..5/ && $2 != "c"' - -If there is output, this is a finding.SRG-OS-000437-GPOS-00194<GroupDescription></GroupDescription>RHEL-09-214035RHEL 9 must remove all software components after updated versions have been installed.<VulnDiscussion>Previous versions of software components that are not removed from the information system after updates have been installed may be exploited by some adversaries.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002617Configure RHEL 9 to remove all software components after updated versions have been installed. - -Edit the file /etc/dnf/dnf.conf by adding or editing the following line: - - clean_requirements_on_remove=1Verify RHEL 9 removes all software components after updated versions have been installed with the following command: - -$ grep clean /etc/dnf/dnf.conf - -clean_requirements_on_remove=1 - -If "clean_requirements_on_remove" is not set to "1", this is a finding.SRG-OS-000366-GPOS-00153<GroupDescription></GroupDescription>RHEL-09-215010RHEL 9 subscription-manager package must be installed.<VulnDiscussion>The Red Hat Subscription Manager application manages software subscriptions and software repositories for installed software products on the local system. It communicates with backend servers, such as the Red Hat Customer Portal or an on-premise instance of Subscription Asset Manager, to register the local system and grant access to software resources determined by the subscription entitlement.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001749The subscription-manager package can be installed with the following command: - -$ sudo dnf install subscription-managerVerify that RHEL 9 subscription-manager package is installed with the following command: - -$ sudo dnf list --installed subscription-manager - -Example output: - -subscription-manager.x86_64 1.29.26-3.el9_0 - -If the "subscription-manager" package is not installed, this is a finding.SRG-OS-000074-GPOS-00042<GroupDescription></GroupDescription>RHEL-09-215015RHEL 9 must not have a File Transfer Protocol (FTP) server package installed.<VulnDiscussion>The FTP service provides an unencrypted remote access that does not provide for the confidentiality and integrity of user passwords or the remote session. If a privileged user were to log on using this service, the privileged user password could be compromised. SSH or other encrypted file transfer methods must be used in place of this service. - -Removing the "vsftpd" package decreases the risk of accidental activation. - -Satisfies: SRG-OS-000074-GPOS-00042, SRG-OS-000095-GPOS-00049, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000197CCI-000366CCI-000381The ftp package can be removed with the following command (using vsftpd as an example): - -$ sudo dnf remove vsftpdVerify that RHEL 9 does not have a File Transfer Protocol (FTP) server package installed with the following command: - -$ sudo dnf list --installed | grep ftp - -If the "ftp" package is installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-215020RHEL 9 must not have the sendmail package installed.<VulnDiscussion>The sendmail software was not developed with security in mind, and its design prevents it from being effectively contained by SELinux. Postfix must be used instead. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000095-GPOS-00049</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000381Remove the sendmail package with the following command: - -$ sudo dnf remove sendmailVerify that the sendmail package is not installed with the following command: - -$ sudo dnf list --installed sendmail - -Error: No matching Packages to list - -If the "sendmail" package is installed, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-215025RHEL 9 must not have the nfs-utils package installed.<VulnDiscussion>"nfs-utils" provides a daemon for the kernel NFS server and related tools. This package also contains the "showmount" program. "showmount" queries the mount daemon on a remote host for information about the Network File System (NFS) server on the remote host. For example, "showmount" can display the clients that are mounted on that host.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381Remove the nfs-utils package with the following command: - -$ sudo dnf remove nfs-utilsVerify that the nfs-utils package is not installed with the following command: - -$ sudo dnf list --installed nfs-utils - -Error: No matching Packages to list - -If the "nfs-utils" package is installed, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-215030RHEL 9 must not have the ypserv package installed.<VulnDiscussion>The NIS service provides an unencrypted authentication service, which does not provide for the confidentiality and integrity of user passwords or the remote session. - -Removing the "ypserv" package decreases the risk of the accidental (or intentional) activation of NIS or NIS+ services.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381Remove the ypserv package with the following command: - -$ sudo dnf remove ypservVerify that the ypserv package is not installed with the following command: - -$ sudo dnf list --installed ypserv - -Error: No matching Packages to list - -If the "ypserv" package is installed, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-215035RHEL 9 must not have the rsh-server package installed.<VulnDiscussion>The "rsh-server" service provides unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session and has very weak authentication. If a privileged user were to login using this service, the privileged user password could be compromised. The "rsh-server" package provides several obsolete and insecure network services. Removing it decreases the risk of accidental (or intentional) activation of those services.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381Remove the rsh-server package with the following command: - -$ sudo dnf remove rsh-serverVerify that the rsh-server package is not installed with the following command: - -$ sudo dnf list --installed rsh-server - -Error: No matching Packages to list - -If the "rsh-server" package is installed, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-215040RHEL 9 must not have the telnet-server package installed.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities are often overlooked and therefore, may remain unsecure. They increase the risk to the platform by providing additional attack vectors. - -The telnet service provides an unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session. If a privileged user were to login using this service, the privileged user password could be compromised. - -Removing the "telnet-server" package decreases the risk of accidental (or intentional) activation of the telnet service.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381Remove the telnet-server package with the following command: - -$ sudo dnf remove telnet-serverVerify that the telnet-server package is not installed with the following command: - -$ sudo dnf list --installed telnet-server - -Error: No matching Packages to list - -If the "telnet-server" package is installed, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-215045RHEL 9 must not have the gssproxy package installed.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore, may remain unsecured. They increase the risk to the platform by providing additional attack vectors. - -Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations (e.g., key missions, functions). - -The gssproxy package is a proxy for GSS API credential handling and could expose secrets on some networks. It is not needed for normal function of the OS. - -Satisfies: SRG-OS-000095-GPOS-00049, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000381Remove the gssproxy package with the following command: - -$ sudo dnf remove gssproxyVerify that the gssproxy package is not installed with the following command: - -$ sudo dnf list --installed gssproxy - -Error: No matching Packages to list - -If the "gssproxy" package is installed and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-215050RHEL 9 must not have the iprutils package installed.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. - -Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). - -The iprutils package provides a suite of utilities to manage and configure SCSI devices supported by the ipr SCSI storage device driver. - -Satisfies: SRG-OS-000095-GPOS-00049, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000381Remove the iprutils package with the following command: - -$ sudo dnf remove iprutilsVerify that the iprutils package is not installed with the following command: - -$ sudo dnf list --installed iprutils - -Error: No matching Packages to list - -If the "iprutils" package is installed and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-215055RHEL 9 must not have the tuned package installed.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. - -Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services, provided by default, may not be necessary to support essential organizational operations (e.g., key missions, functions). - -The tuned package contains a daemon that tunes the system settings dynamically. It does so by monitoring the usage of several system components periodically. Based on that information, components will then be put into lower or higher power savings modes to adapt to the current usage. The tuned package is not needed for normal OS operations. - -Satisfies: SRG-OS-000095-GPOS-00049, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000381Remove the tuned package with the following command: - -$ sudo dnf remove tunedVerify that the tuned package is not installed with the following command: - -$ sudo dnf list --installed tuned - -Error: No matching Packages to list - -If the "tuned" package is installed and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-215060RHEL 9 must not have a Trivial File Transfer Protocol (TFTP) server package installed.<VulnDiscussion>Removing the "tftp-server" package decreases the risk of the accidental (or intentional) activation of tftp services. - -If TFTP is required for operational support (such as transmission of router configurations), its use must be documented with the information systems security manager (ISSM), restricted to only authorized personnel, and have access control rules established.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366The tftp package can be removed with the following command: - -$ sudo dnf remove tftpVerify that RHEL 9 does not have a tftp server package installed with the following command: - -$ sudo dnf list --installed | grep tftp - -If the "tftp" package is installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-215065RHEL 9 must not have the quagga package installed.<VulnDiscussion>Quagga is a network routing software suite providing implementations of Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP) for Unix and Linux platforms. - -If there is no need to make the router software available, removing it provides a safeguard against its activation.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove the quagga package with the following command: - -$ sudo dnf remove quaggaVerify that the quagga package is not installed with the following command: - -$ sudo dnf list --installed quagga - -Error: No matching Packages to list - -If the "quagga" package is installed, and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-215070A graphical display manager must not be installed on RHEL 9 unless approved.<VulnDiscussion>Unnecessary service packages must not be installed to decrease the attack surface of the system. Graphical display managers have a long history of security vulnerabilities and must not be used, unless approved and documented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Document the requirement for a graphical user interface with the ISSO or remove all xorg packages with the following command: - -Warning: If you are accessing the system through the graphical user interface, change to the multi-user.target with the following command: - -$ sudo systemctl isolate multi-user.target - -Warning: Removal of the graphical user interface will immediately render it useless. The following commands must not be run from a virtual terminal emulator in the graphical interface. - -$ sudo dnf remove "xorg*" -$ sudo systemctl set-default multi-user.targetVerify that a graphical user interface is not installed with the following command: - -$ sudo dnf list --installed "xorg*common" - -Error: No matching Packages to list - -If the "x11-server-common" package is installed, and the use of a graphical user interface has not been documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000105-GPOS-00052<GroupDescription></GroupDescription>RHEL-09-215075RHEL 9 must have the openssl-pkcs11 package installed.<VulnDiscussion>Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. The DOD CAC with DOD-approved PKI is an example of multifactor authentication. - -Satisfies: SRG-OS-000105-GPOS-00052, SRG-OS-000375-GPOS-00160, SRG-OS-000376-GPOS-00161, SRG-OS-000377-GPOS-00162</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000765CCI-001948CCI-001953CCI-001954The openssl-pkcs11 package can be installed with the following command: - -$ sudo dnf install openssl-pkcs11Verify that RHEL 9 has the openssl-pkcs11 package installed with the following command: - -$ sudo dnf list --installed openssl-pkcs11 - -Example output: - -openssl-pkcs.i686 0.4.11-7.el9 -openssl-pkcs.x86_64 0.4.11-7.el9 - -If the "openssl-pkcs11" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-215080RHEL 9 must have the gnutls-utils package installed.<VulnDiscussion>GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them. It provides a simple C language application programming interface (API) to access the secure communications protocols as well as APIs to parse and write X.509, PKCS #12, OpenPGP and other required structures. This package contains command line TLS client and server and certificate manipulation tools.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366The gnutls-utils package can be installed with the following command: - -$ sudo dnf install gnutls-utilsVerify that RHEL 9 has the gnutls-utils package installed with the following command: - -$ dnf list --installed gnutls-utils - -Example output: - -gnutls-utils.x86_64 3.7.3-9.el9 - -If the "gnutls-utils" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-215085RHEL 9 must have the nss-tools package installed.<VulnDiscussion>Network Security Services (NSS) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Install the "nss-tools" package to install command-line tools to manipulate the NSS certificate and key database.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366The nss-tools package can be installed with the following command: - -$ sudo dnf install nss-toolsVerify that RHEL 9 has the nss-tools package installed with the following command: - -$ dnf list --installed nss-tools - -Example output: - -nss-tools.x86_64 3.71.0-7.el9 - -If the "nss-tools" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-215090RHEL 9 must have the rng-tools package installed.<VulnDiscussion>"rng-tools" provides hardware random number generator tools, such as those used in the formation of x509/PKI certificates.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366The rng-tools package can be installed with the following command: - -$ sudo dnf install rng-toolsVerify that RHEL 9 has the rng-tools package installed with the following command: - -$ sudo dnf list --installed rng-tools - -Example output: - -rng-tools.x86_64 6.14-2.git.b2b7934e.el9 - -If the "rng-tools" package is not installed, this is a finding.SRG-OS-000363-GPOS-00150<GroupDescription></GroupDescription>RHEL-09-215095RHEL 9 must have the s-nail package installed.<VulnDiscussion>The "s-nail" package provides the mail command required to allow sending email notifications of unauthorized configuration changes to designated personnel.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001744The s-nail package can be installed with the following command: - -$ sudo dnf install s-nailVerify that RHEL 9 is configured to allow sending email notifications. - -Note: The "s-nail" package provides the "mail" command that is used to send email messages. - -Verify that the "s-nail" package is installed on the system: - -$ sudo dnf list --installed s-nail - -s-nail.x86_64 14.9.22-6.el9 - -If "s-nail" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231010A separate RHEL 9 file system must be used for user home directories (such as /home or an equivalent).<VulnDiscussion>Ensuring that "/home" is mounted on its own partition enables the setting of more restrictive mount options, and also helps ensure that users cannot trivially fill partitions used for log or audit data storage.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Migrate the "/home" directory onto a separate file system/partition.Verify that a separate file system/partition has been created for "/home" with the following command: - -$ mount | grep /home - -UUID=fba5000f-2ffa-4417-90eb-8c54ae74a32f on /home type ext4 (rw,nodev,nosuid,noexec,seclabel) - -If a separate entry for "/home" is not in use, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231015RHEL 9 must use a separate file system for /tmp.<VulnDiscussion>The "/tmp" partition is used as temporary storage by many programs. Placing "/tmp" in its own partition enables the setting of more restrictive mount options, which can help protect programs that use it.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Migrate the "/tmp" path onto a separate file system.Verify that a separate file system/partition has been created for "/tmp" with the following command: - -$ mount | grep /tmp - -tmpfs /tmp tmpfs noatime,mode=1777 0 0 - -If a separate entry for "/tmp" is not in use, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231020RHEL 9 must use a separate file system for /var.<VulnDiscussion>Ensuring that "/var" is mounted on its own partition enables the setting of more restrictive mount options. This helps protect system services such as daemons or other programs which use it. It is not uncommon for the "/var" directory to contain world-writable directories installed by other software packages.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Migrate the "/var" path onto a separate file system.Verify that a separate file system/partition has been created for "/var" with the following command: - -$ mount | grep /var - -UUID=c274f65f-c5b5-4481-b007-bee96feb8b05 /var xfs noatime 1 2 - -If a separate entry for "/var" is not in use, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231025RHEL 9 must use a separate file system for /var/log.<VulnDiscussion>Placing "/var/log" in its own partition enables better separation between log files and other files in "/var/".</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Migrate the "/var/log" path onto a separate file system.Verify that a separate file system/partition has been created for "/var/log" with the following command: - -$ mount | grep /var/log - -UUID=c274f65f-c5b5-4486-b021-bee96feb8b21 /var/log xfs noatime 1 2 - -If a separate entry for "/var/log" is not in use, this is a finding.SRG-OS-000341-GPOS-00132<GroupDescription></GroupDescription>RHEL-09-231030RHEL 9 must use a separate file system for the system audit data path.<VulnDiscussion>Placing "/var/log/audit" in its own partition enables better separation between audit files and other system files, and helps ensure that auditing cannot be halted due to the partition running out of space. - -Satisfies: SRG-OS-000341-GPOS-00132, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001849Migrate the system audit data path onto a separate file system.Verify that a separate file system/partition has been created for the system audit data path with the following command: - -Note: /var/log/audit is used as the example as it is a common location. - -$ mount | grep /var/log/audit - -UUID=2efb2979-45ac-82d7-0ae632d11f51 on /var/log/home type xfs (rw,realtime,seclabel,attr2,inode64) - -If no line is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231035RHEL 9 must use a separate file system for /var/tmp.<VulnDiscussion>The "/var/tmp" partition is used as temporary storage by many programs. Placing "/var/tmp" in its own partition enables the setting of more restrictive mount options, which can help protect programs that use it.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Migrate the "/var/tmp" path onto a separate file system.Verify that a separate file system/partition has been created for "/var/tmp" with the following command: - -$ mount | grep /var/tmp - -UUID=c274f65f-c5b5-4379-b017-bee96feb7a34 /var/log xfs noatime 1 2 - -If a separate entry for "/var/tmp" is not in use, this is a finding.SRG-OS-000114-GPOS-00059<GroupDescription></GroupDescription>RHEL-09-231040RHEL 9 file system automount function must be disabled unless required.<VulnDiscussion>An authentication process resists replay attacks if it is impractical to achieve a successful authentication by recording and replaying a previous authentication message. - -Satisfies: SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000778CCI-001958Configure RHEL 9 to disable the ability to automount devices. - -The autofs service can be disabled with the following command: - -$ sudo systemctl mask --now autofs.serviceVerify that RHEL 9 file system automount function has been disabled with the following command: - -$ sudo systemctl is-enabled autofs - -masked - -If the returned value is not "masked", "disabled", "Failed to get unit file state for autofs.service for autofs", or "enabled", and is not documented as operational requirement with the information system security officer ISSO, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231045RHEL 9 must prevent device files from being interpreted on file systems that contain user home directories.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/home" directory.Verify "/home" is mounted with the "nodev" option with the following command: - -Note: If a separate file system has not been created for the user home directories (user home directories are mounted under "/"), this is automatically a finding, as the "nodev" option cannot be used on the "/" system. - -$ mount | grep /home - -tmpfs on /home type tmpfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/home" file system is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231050RHEL 9 must prevent files with the setuid and setgid bit set from being executed on file systems that contain user home directories.<VulnDiscussion>The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -Satisfies: SRG-OS-000368-GPOS-00154, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/home" directory.Verify "/home" is mounted with the "nosuid" option with the following command: - -Note: If a separate file system has not been created for the user home directories (user home directories are mounted under "/"), this is automatically a finding, as the "nosuid" option cannot be used on the "/" system. - -$ mount | grep /home - -tmpfs on /home type tmpfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/home" file system is mounted without the "nosuid" option, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231055RHEL 9 must prevent code from being executed on file systems that contain user home directories.<VulnDiscussion>The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Modify "/etc/fstab" to use the "noexec" option on the "/home" directory.Verify "/home" is mounted with the "noexec" option with the following command: - -Note: If a separate file system has not been created for the user home directories (user home directories are mounted under "/"), this is automatically a finding, as the "noexec" option cannot be used on the "/" system. - -$ mount | grep /home - -tmpfs on /home type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/home" file system is mounted without the "noexec" option, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231060RHEL 9 must be configured so that the Network File System (NFS) is configured to use RPCSEC_GSS.<VulnDiscussion>When an NFS server is configured to use RPCSEC_SYS, a selected userid and groupid are used to handle requests from the remote user. The userid and groupid could mistakenly or maliciously be set incorrectly. The RPCSEC_GSS method of authentication uses certificates on the server and client systems to more securely authenticate the remote mount request.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Update the "/etc/fstab" file so the option "sec" is defined for each NFS mounted file system and the "sec" option does not have the "sys" setting. - -Ensure the "sec" option is defined as "krb5p:krb5i:krb5".Verify RHEL 9 has the "sec" option configured for all NFS mounts with the following command: - -Note: If no NFS mounts are configured, this requirement is Not Applicable. - -$ cat /etc/fstab | grep nfs - -192.168.22.2:/mnt/export /data nfs4 rw,nosuid,nodev,noexec,sync,soft,sec=krb5p:krb5i:krb5 - -If the system is mounting file systems via NFS and has the sec option without the "krb5:krb5i:krb5p" settings, the "sec" option has the "sys" setting, or the "sec" option is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231065RHEL 9 must prevent special devices on file systems that are imported via Network File System (NFS).<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Update each NFS mounted file system to use the "nodev" option on file systems that are being imported via NFS.Verify RHEL 9 has the "nodev" option configured for all NFS mounts with the following command: - -$ cat /etc/fstab | grep nfs - -192.168.22.2:/mnt/export /data nfs4 rw,nosuid,nodev,noexec,sync,soft,sec=krb5:krb5i:krb5p - -Note: If no NFS mounts are configured, this requirement is Not Applicable. - -If the system is mounting file systems via NFS and the "nodev" option is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231070RHEL 9 must prevent code from being executed on file systems that are imported via Network File System (NFS).<VulnDiscussion>The "noexec" mount option causes the system not to execute binary files. This option must be used for mounting any file system not containing approved binary as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Update each NFS mounted file system to use the "noexec" option on file systems that are being imported via NFS.Verify RHEL 9 has the "noexec" option configured for all NFS mounts with the following command: - -$ cat /etc/fstab | grep nfs - -192.168.22.2:/mnt/export /data nfs4 rw,nosuid,nodev,noexec,sync,soft,sec=krb5:krb5i:krb5p - -If no NFS mounts are configured, this requirement is Not Applicable. - -If the system is mounting file systems via NFS and the "noexec" option is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231075RHEL 9 must prevent files with the setuid and setgid bit set from being executed on file systems that are imported via Network File System (NFS).<VulnDiscussion>The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Update each NFS mounted file system to use the "nosuid" option on file systems that are being imported via NFS.Verify RHEL 9 has the "nosuid" option configured for all NFS mounts with the following command: - -Note: If no NFS mounts are configured, this requirement is Not Applicable. - -$ cat /etc/fstab | grep nfs - -192.168.22.2:/mnt/export /data nfs4 rw,nosuid,nodev,noexec,sync,soft,sec=krb5:krb5i:krb5p - -If the system is mounting file systems via NFS and the "nosuid" option is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231080RHEL 9 must prevent code from being executed on file systems that are used with removable media.<VulnDiscussion>The "noexec" mount option causes the system not to execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "/etc/fstab" to use the "noexec" option on file systems that are associated with removable media.Verify file systems that are used for removable media are mounted with the "noexec" option with the following command: - -$ more /etc/fstab - -UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat noauto,owner,ro,nosuid,nodev,noexec 0 0 - -If a file system found in "/etc/fstab" refers to removable media and it does not have the "noexec" option set, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231085RHEL 9 must prevent special devices on file systems that are used with removable media.<VulnDiscussion>The "nodev" mount option causes the system not to interpret character or block special devices. Executing character or blocking special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "/etc/fstab" to use the "nodev" option on file systems that are associated with removable media.Verify file systems that are used for removable media are mounted with the "nodev" option with the following command: - -$ more /etc/fstab - -UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat noauto,owner,ro,nosuid,nodev,noexec 0 0 - -If a file system found in "/etc/fstab" refers to removable media and it does not have the "nodev" option set, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231090RHEL 9 must prevent files with the setuid and setgid bit set from being executed on file systems that are used with removable media.<VulnDiscussion>The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "/etc/fstab" to use the "nosuid" option on file systems that are associated with removable media.Verify file systems that are used for removable media are mounted with the "nosuid" option with the following command: - -$ more /etc/fstab - -UUID=2bc871e4-e2a3-4f29-9ece-3be60c835222 /mnt/usbflash vfat noauto,owner,ro,nosuid,nodev,noexec 0 0 - -If a file system found in "/etc/fstab" refers to removable media and it does not have the "nosuid" option set, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231095RHEL 9 must mount /boot with the nodev option.<VulnDiscussion>The only legitimate location for device files is the "/dev" directory located on the root partition. The only exception to this is chroot jails.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/boot" directory.Verify that the "/boot" mount point has the "nodev" option is with the following command: - -Note: This control is not applicable to RHEL 9 system booted UEFI. - -$ sudo mount | grep '\s/boot\s' - -/dev/sda1 on /boot type xfs (rw,nodev,relatime,seclabel,attr2) - -If the "/boot" file system does not have the "nodev" option set, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231100RHEL 9 must prevent files with the setuid and setgid bit set from being executed on the /boot directory.<VulnDiscussion>The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -Satisfies: SRG-OS-000368-GPOS-00154, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/boot" directory.Note: For systems that use UEFI, this requirement is Not Applicable. - -Verify the /boot directory is mounted with the "nosuid" option with the following command: - -$ mount | grep '\s/boot\s' - -/dev/sda1 on /boot type xfs (rw,nosuid,relatime,seclabe,attr2,inode64,noquota) - -If the /boot file system does not have the "nosuid" option set, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231105RHEL 9 must prevent files with the setuid and setgid bit set from being executed on the /boot/efi directory.<VulnDiscussion>The "nosuid" mount option causes the system not to execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -Satisfies: SRG-OS-000368-GPOS-00154, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/boot/efi" directory.Note: For systems that use BIOS, this requirement is Not Applicable. - -Verify the /boot/efi directory is mounted with the "nosuid" option with the following command: - -$ mount | grep '\s/boot/efi\s' - -/dev/sda1 on /boot/efi type vfat (rw,nosuid,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro) - -If the /boot/efi file system does not have the "nosuid" option set, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231110RHEL 9 must mount /dev/shm with the nodev option.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/dev/shm" file system.Verify "/dev/shm" is mounted with the "nodev" option with the following command: - -$ mount | grep /dev/shm - -tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel) - -If the /dev/shm file system is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231115RHEL 9 must mount /dev/shm with the noexec option.<VulnDiscussion>The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "noexec" option on the "/dev/shm" file system.Verify "/dev/shm" is mounted with the "noexec" option with the following command: - -$ mount | grep /dev/shm - -tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel) - -If the /dev/shm file system is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231120RHEL 9 must mount /dev/shm with the nosuid option.<VulnDiscussion>The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/dev/shm" file system.Verify "/dev/shm" is mounted with the "nosuid" option with the following command: - -$ mount | grep /dev/shm - -tmpfs on /dev/shm type tmpfs (rw,nodev,nosuid,noexec,seclabel) - -If the /dev/shm file system is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231125RHEL 9 must mount /tmp with the nodev option.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/tmp" directory.Verify "/tmp" is mounted with the "nodev" option: - -$ mount | grep /tmp - -/dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/tmp" file system is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231130RHEL 9 must mount /tmp with the noexec option.<VulnDiscussion>The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "noexec" option on the "/tmp" directory.Verify "/tmp" is mounted with the "noexec" option: - -$ mount | grep /tmp - -/dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/tmp" file system is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231135RHEL 9 must mount /tmp with the nosuid option.<VulnDiscussion>The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/tmp" directory.Verify "/tmp" is mounted with the "nosuid" option: - -$ mount | grep /tmp - -/dev/mapper/rhel-tmp on /tmp type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/tmp" file system is mounted without the "nosuid" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231140RHEL 9 must mount /var with the nodev option.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/var" directory.Verify "/var" is mounted with the "nodev" option: - -$ mount | grep /var - -/dev/mapper/rhel-var on /var type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var" file system is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231145RHEL 9 must mount /var/log with the nodev option.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/var/log" directory.Verify "/var/log" is mounted with the "nodev" option: - -$ mount | grep /var/log - -/dev/mapper/rhel-var-log on /var/log type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/log" file system is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231150RHEL 9 must mount /var/log with the noexec option.<VulnDiscussion>The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "noexec" option on the "/var/log" directory.Verify "/var/log" is mounted with the "noexec" option: - -$ mount | grep /var/log - -/dev/mapper/rhel-var-log on /var/log type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/log" file system is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231155RHEL 9 must mount /var/log with the nosuid option.<VulnDiscussion>The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/var/log" directory.Verify "/var/log" is mounted with the "nosuid" option: - -$ mount | grep /var/log - -/dev/mapper/rhel-var-log on /var/log type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/log" file system is mounted without the "nosuid" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231160RHEL 9 must mount /var/log/audit with the nodev option.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/var/log/audit" directory.Verify "/var/log/audit" is mounted with the "nodev" option: - -$ mount | grep /var/log/audit - -/dev/mapper/rhel-var-log-audit on /var/log/audit type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/log/audit" file system is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231165RHEL 9 must mount /var/log/audit with the noexec option.<VulnDiscussion>The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "noexec" option on the "/var/log/audit" directory.Verify "/var/log/audit" is mounted with the "noexec" option: - -$ mount | grep /var/log/audit - -/dev/mapper/rhel-var-log-audit on /var/log/audit type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/log/audit" file system is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231170RHEL 9 must mount /var/log/audit with the nosuid option.<VulnDiscussion>The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/var/log/audit" directory.Verify "/var/log/audit" is mounted with the "nosuid" option: - -$ mount | grep /var/log/audit - -/dev/mapper/rhel-var-log-audit on /var/log/audit type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/log/audit" file system is mounted without the "nosuid" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231175RHEL 9 must mount /var/tmp with the nodev option.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nodev" option on the "/var/tmp" directory.Verify "/var/tmp" is mounted with the "nodev" option: - -$ mount | grep /var/tmp - -/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/tmp" file system is mounted without the "nodev" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231180RHEL 9 must mount /var/tmp with the noexec option.<VulnDiscussion>The "noexec" mount option causes the system to not execute binary files. This option must be used for mounting any file system not containing approved binary files, as they may be incompatible. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "noexec" option on the "/var/tmp" directory.Verify "/var/tmp" is mounted with the "noexec" option: - -$ mount | grep /var/tmp - -/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/tmp" file system is mounted without the "noexec" option, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-231185RHEL 9 must mount /var/tmp with the nosuid option.<VulnDiscussion>The "nosuid" mount option causes the system to not execute "setuid" and "setgid" files with owner privileges. This option must be used for mounting any file system not containing approved "setuid" and "setguid" files. Executing files from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Modify "/etc/fstab" to use the "nosuid" option on the "/var/tmp" directory.Verify "/var/tmp" is mounted with the "nosuid" option: - -$ mount | grep /var/tmp - -/dev/mapper/rhel-var-tmp on /var/tmp type xfs (rw,nodev,nosuid,noexec,seclabel) - -If the "/var/tmp" file system is mounted without the "nosuid" option, this is a finding.SRG-OS-000405-GPOS-00184<GroupDescription></GroupDescription>RHEL-09-231190RHEL 9 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at rest protection.<VulnDiscussion>RHEL 9 systems handling data requiring "data at rest" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. - -Selection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields). - -Satisfies: SRG-OS-000405-GPOS-00184, SRG-OS-000185-GPOS-00079, SRG-OS-000404-GPOS-00183</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001199CCI-002475CCI-002476Configure RHEL 9 to prevent unauthorized modification of all information at rest by using disk encryption. - -Encrypting a partition in an already installed system is more difficult, because existing partitions will need to be resized and changed. - -To encrypt an entire partition, dedicate a partition for encryption in the partition layout.Verify RHEL 9 prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption. - -Note: If there is a documented and approved reason for not having data-at-rest encryption, this requirement is Not Applicable. - -Verify all system partitions are encrypted with the following command: - -$ blkid - -/dev/map per/rhel-root: UUID="67b7d7fe-de60-6fd0-befb-e6748cf97743" TYPE="crypto_LUKS" - -Every persistent disk partition present must be of type "crypto_LUKS". If any partitions other than the boot partition or pseudo file systems (such as /proc or /sys) or temporary file systems (that are tmpfs) are not type "crypto_LUKS", ask the administrator to indicate how the partitions are encrypted. If there is no evidence that these partitions are encrypted, this is a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-231195RHEL 9 must disable mounting of cramfs.<VulnDiscussion>It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. - -Removing support for unneeded filesystem types reduces the local attack surface of the server. - -Compressed ROM/RAM file system (or cramfs) is a read-only file system designed for simplicity and space-efficiency. It is mainly used in embedded and small-footprint systems.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381To configure the system to prevent the cramfs kernel module from being loaded, add the following line to the file /etc/modprobe.d/blacklist.conf (or create blacklist.conf if it does not exist): - -install cramfs /bin/false -blacklist cramfsVerify that RHEL 9 disables the ability to load the cramfs kernel module with the following command: - -$ sudo grep -r cramfs /etc/modprobe.conf /etc/modprobe.d/* - -blacklist cramfs - -If the command does not return any output, or the line is commented out, and use of cramfs is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-231200RHEL 9 must prevent special devices on non-root local partitions.<VulnDiscussion>The "nodev" mount option causes the system to not interpret character or block special devices. Executing character or block special devices from untrusted file systems increases the opportunity for nonprivileged users to attain unauthorized administrative access. - -The only legitimate location for device files is the "/dev" directory located on the root partition, with the exception of chroot jails if implemented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "/etc/fstab" to use the "nodev" option on all non-root local partitions.Verify all non-root local partitions are mounted with the "nodev" option with the following command: - -$ sudo mount | grep '^/dev\S* on /\S' | grep --invert-match 'nodev' - -If any output is produced, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232010RHEL 9 system commands must have mode 755 or less permissive.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system commands to be protected from unauthorized access. - -Run the following command, replacing "[FILE]" with any system command with a mode more permissive than "755". - -$ sudo chmod 755 [FILE]Verify the system commands contained in the following directories have mode "755" or less permissive with the following command: - -$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/libexec /usr/local/bin /usr/local/sbin -perm /022 -exec ls -l {} \; - -If any system commands are found to be group-writable or world-writable, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232015RHEL 9 library directories must have mode 755 or less permissive.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. - -Run the following command, replacing "[DIRECTORY]" with any library directory with a mode more permissive than 755. - -$ sudo chmod 755 [DIRECTORY]Verify the system-wide shared library directories have mode "755" or less permissive with the following command: - -$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type d -exec ls -l {} \; - -If any system-wide shared library file is found to be group-writable or world-writable, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232020RHEL 9 library files must have mode 755 or less permissive.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the library files to be protected from unauthorized access. Run the following command, replacing "[FILE]" with any library file with a mode more permissive than 755. - -$ sudo chmod 755 [FILE]Verify the system-wide shared library files contained in the following directories have mode "755" or less permissive with the following command: - -$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type f -exec ls -l {} \; - -If any system-wide shared library file is found to be group-writable or world-writable, this is a finding.SRG-OS-000206-GPOS-00084<GroupDescription></GroupDescription>RHEL-09-232025RHEL 9 /var/log directory must have mode 0755 or less permissive.<VulnDiscussion>Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. - -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001314Configure the "/var/log" directory to a mode of "0755" by running the following command: - -$ sudo chmod 0755 /var/logVerify that the "/var/log" directory has a mode of "0755" or less permissive with the following command: - -$ ls -ld /var/log - -drwxr-xr-x. 16 root root 4096 July 11 11:34 /var/log - -If "/var/log" does not have a mode of "0755" or less permissive, this is a finding.SRG-OS-000206-GPOS-00084<GroupDescription></GroupDescription>RHEL-09-232030RHEL 9 /var/log/messages file must have mode 0640 or less permissive.<VulnDiscussion>Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. - -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001314Configure the "/var/log/messages" file to have a mode of "0640" by running the following command: - -$ sudo chmod 0640 /var/log/messagesVerify the "/var/log/messages" file has a mode of "0640" or less permissive with the following command: - -$ ls -la /var/log/messages - -rw-------. 1 root root 564223 July 11 11:34 /var/log/messages - -If "/var/log/messages" does not have a mode of "0640" or less permissive, this is a finding.SRG-OS-000256-GPOS-00097<GroupDescription></GroupDescription>RHEL-09-232035RHEL 9 audit tools must have a mode of 0755 or less permissive.<VulnDiscussion>Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. - -RHEL 9 systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools, and the corresponding rights the user enjoys, to make access decisions regarding the access to audit tools. - -Audit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001493Configure the audit tools to have a mode of "0755" by running the following command: - -$ sudo chmod 0755 [audit_tool] - -Replace "[audit_tool]" with each audit tool that has a more permissive mode than 0755.Verify the audit tools have a mode of "0755" or less with the following command: - -$ stat -c "%a %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules - -755 /sbin/auditctl -755 /sbin/aureport -755 /sbin/ausearch -750 /sbin/autrace -755 /sbin/auditd -755 /sbin/rsyslogd -755 /sbin/augenrules - -If any of the audit tool files have a mode more permissive than "0755", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232040RHEL 9 cron configuration directories must have a mode of 0700 or less permissive.<VulnDiscussion>Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should have the correct access rights to prevent unauthorized changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure any RHEL 9 cron configuration directory with a mode more permissive than "0700" as follows: - -chmod 0700 [cron configuration directory]Verify the permissions of the cron directories with the following command: - -$ find /etc/cron* -type d | xargs stat -c "%a %n" - -700 /etc/cron.d -700 /etc/cron.daily -700 /etc/cron.hourly -700 /etc/cron.monthly -700 /etc/cron.weekly - -If any cron configuration directory is more permissive than "700", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232045All RHEL 9 local initialization files must have mode 0740 or less permissive.<VulnDiscussion>Local initialization files are used to configure the user's shell environment upon logon. Malicious modification of these files could compromise accounts upon logon.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Set the mode of the local initialization files to "0740" with the following command: - -Note: The example will be for the wadea user, who has a home directory of "/home/wadea". - -$ sudo chmod 0740 /home/wadea/.<INIT_FILE>Verify that all local initialization files have a mode of "0740" or less permissive with the following command: - -Note: The example will be for the "wadea" user, who has a home directory of "/home/wadea". - -$ sudo ls -al /home/wadea/.[^.]* | more - --rwxr-xr-x 1 wadea users 896 Mar 10 2011 .profile --rwxr-xr-x 1 wadea users 497 Jan 6 2007 .login --rwxr-xr-x 1 wadea users 886 Jan 6 2007 .something - -If any local initialization files have a mode more permissive than "0740", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232050All RHEL 9 local interactive user home directories must have mode 0750 or less permissive.<VulnDiscussion>Excessive permissions on local interactive user home directories may allow unauthorized access to user files by other users.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of interactive user's home directories to "0750". To change the mode of a local interactive user's home directory, use the following command: - -Note: The example will be for the user "wadea". - -$ sudo chmod 0750 /home/wadeaVerify the assigned home directory of all local interactive users has a mode of "0750" or less permissive with the following command: - -Note: This may miss interactive users that have been assigned a privileged user identifier (UID). Evidence of interactive use may be obtained from a number of log files containing system logon information. - -$ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd) - -drwxr-x--- 2 wadea admin 4096 Jun 5 12:41 wadea - -If home directories referenced in "/etc/passwd" do not have a mode of "0750" or less permissive, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232055RHEL 9 /etc/group file must have mode 0644 or less permissive to prevent unauthorized access.<VulnDiscussion>The "/etc/group" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/group" to "0644" by running the following command: - -$ sudo chmod 0644 /etc/groupVerify that the "/etc/group" file has mode "0644" or less permissive with the following command: - -$ sudo stat -c "%a %n" /etc/group - -644 /etc/group - -If a value of "0644" or less permissive is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232060RHEL 9 /etc/group- file must have mode 0644 or less permissive to prevent unauthorized access.<VulnDiscussion>The "/etc/group-" file is a backup file of "/etc/group", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/group-" to "0644" by running the following command: - -$ sudo chmod 0644 /etc/group-Verify that the "/etc/group-" file has mode "0644" or less permissive with the following command: - -$ sudo stat -c "%a %n" /etc/group- - -644 /etc/group- - -If a value of "0644" or less permissive is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232065RHEL 9 /etc/gshadow file must have mode 0000 or less permissive to prevent unauthorized access.<VulnDiscussion>The "/etc/gshadow" file contains group password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/gshadow" to "0000" by running the following command: - -$ sudo chmod 0000 /etc/gshadowVerify that the "/etc/gshadow" file has mode "0000" with the following command: - -$ sudo stat -c "%a %n" /etc/gshadow - -0 /etc/gshadow - -If a value of "0" is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232070RHEL 9 /etc/gshadow- file must have mode 0000 or less permissive to prevent unauthorized access.<VulnDiscussion>The "/etc/gshadow-" file is a backup of "/etc/gshadow", and as such, contains group password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/gshadow-" to "0000" by running the following command: - -$ sudo chmod 0000 /etc/gshadow-Verify that the "/etc/gshadow-" file has mode "0000" with the following command: - -$ sudo stat -c "%a %n" /etc/gshadow- - -0 /etc/gshadow- - -If a value of "0" is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232075RHEL 9 /etc/passwd file must have mode 0644 or less permissive to prevent unauthorized access.<VulnDiscussion>If the "/etc/passwd" file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the list of accounts on the system and associated information, and protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/passwd" to "0644" by running the following command: - -$ sudo chmod 0644 /etc/passwdVerify that the "/etc/passwd" file has mode "0644" or less permissive with the following command: - -$ sudo stat -c "%a %n" /etc/passwd - -644 /etc/passwd - -If a value of "0644" or less permissive is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232080RHEL 9 /etc/passwd- file must have mode 0644 or less permissive to prevent unauthorized access.<VulnDiscussion>The "/etc/passwd-" file is a backup file of "/etc/passwd", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/passwd-" to "0644" by running the following command: - -$ sudo chmod 0644 /etc/passwd-Verify that the "/etc/passwd-" file has mode "0644" or less permissive with the following command: - -$ sudo stat -c "%a %n" /etc/passwd- - -644 /etc/passwd- - -If a value of "0644" or less permissive is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232085RHEL 9 /etc/shadow- file must have mode 0000 or less permissive to prevent unauthorized access.<VulnDiscussion>The "/etc/shadow-" file is a backup file of "/etc/shadow", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/shadow-" to "0000" by running the following command: - -$ sudo chmod 0000 /etc/shadow-Verify that the "/etc/shadow-" file has mode "0000" with the following command: - -$ sudo stat -c "%a %n" /etc/shadow- - -0 /etc/shadow- - -If a value of "0" is not returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232090RHEL 9 /etc/group file must be owned by root.<VulnDiscussion>The "/etc/group" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/group to root by running the following command: - -$ sudo chown root /etc/groupVerify the ownership of the "/etc/group" file with the following command: - -$ sudo stat -c "%U %n" /etc/group - -root /etc/group - -If "/etc/group" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232095RHEL 9 /etc/group file must be group-owned by root.<VulnDiscussion>The "/etc/group" file contains information regarding groups that are configured on the system. Protection of this file is important for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/group to root by running the following command: - -$ sudo chgrp root /etc/groupVerify the group ownership of the "/etc/group" file with the following command: - -$ sudo stat -c "%G %n" /etc/group - -root /etc/group - -If "/etc/group" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232100RHEL 9 /etc/group- file must be owned by root.<VulnDiscussion>The "/etc/group-" file is a backup file of "/etc/group", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/group- to root by running the following command: - -$ sudo chown root /etc/group-Verify the ownership of the "/etc/group-" file with the following command: - -$ sudo stat -c "%U %n" /etc/group- - -root /etc/group- - -If "/etc/group-" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232105RHEL 9 /etc/group- file must be group-owned by root.<VulnDiscussion>The "/etc/group-" file is a backup file of "/etc/group", and as such, contains information regarding groups that are configured on the system. Protection of this file is important for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/group- to root by running the following command: - -$ sudo chgrp root /etc/group-Verify the group ownership of the "/etc/group-" file with the following command: - -$ sudo stat -c "%G %n" /etc/group- - -root /etc/group- - -If "/etc/group-" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232110RHEL 9 /etc/gshadow file must be owned by root.<VulnDiscussion>The "/etc/gshadow" file contains group password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/gshadow to root by running the following command: - -$ sudo chown root /etc/gshadowVerify the ownership of the "/etc/gshadow" file with the following command: - -$ sudo stat -c "%U %n" /etc/gshadow - -root /etc/gshadow - -If "/etc/gshadow" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232115RHEL 9 /etc/gshadow file must be group-owned by root.<VulnDiscussion>The "/etc/gshadow" file contains group password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/gshadow to root by running the following command: - -$ sudo chgrp root /etc/gshadowVerify the group ownership of the "/etc/gshadow" file with the following command: - -$ sudo stat -c "%G %n" /etc/gshadow - -root /etc/gshadow - -If "/etc/gshadow" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232120RHEL 9 /etc/gshadow- file must be owned by root.<VulnDiscussion>The "/etc/gshadow-" file is a backup of "/etc/gshadow", and as such, contains group password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/gshadow- to root by running the following command: - -$ sudo chown root /etc/gshadow-Verify the ownership of the "/etc/gshadow-" file with the following command: - -$ sudo stat -c "%U %n" /etc/gshadow- - -root /etc/gshadow- - -If "/etc/gshadow-" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232125RHEL 9 /etc/gshadow- file must be group-owned by root.<VulnDiscussion>The "/etc/gshadow-" file is a backup of "/etc/gshadow", and as such, contains group password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/gshadow- to root by running the following command: - -$ sudo chgrp root /etc/gshadow-Verify the group ownership of the "/etc/gshadow-" file with the following command: - -$ sudo stat -c "%G %n" /etc/gshadow- - -root /etc/gshadow- - -If "/etc/gshadow-" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232130RHEL 9 /etc/passwd file must be owned by root.<VulnDiscussion>The "/etc/passwd" file contains information about the users that are configured on the system. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/passwd to root by running the following command: - -$ sudo chown root /etc/passwdVerify the ownership of the "/etc/passwd" file with the following command: - -$ sudo stat -c "%U %n" /etc/passwd - -root /etc/passwd - -If "/etc/passwd" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232135RHEL 9 /etc/passwd file must be group-owned by root.<VulnDiscussion>The "/etc/passwd" file contains information about the users that are configured on the system. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/passwd to root by running the following command: - -$ sudo chgrp root /etc/passwdVerify the group ownership of the "/etc/passwd" file with the following command: - -$ sudo stat -c "%G %n" /etc/passwd - -root /etc/passwd - -If "/etc/passwd" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232140RHEL 9 /etc/passwd- file must be owned by root.<VulnDiscussion>The "/etc/passwd-" file is a backup file of "/etc/passwd", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/passwd- to root by running the following command: - -$ sudo chown root /etc/passwd-Verify the ownership of the "/etc/passwd-" file with the following command: - -$ sudo stat -c "%U %n" /etc/passwd- - -root /etc/passwd- - -If "/etc/passwd-" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232145RHEL 9 /etc/passwd- file must be group-owned by root.<VulnDiscussion>The "/etc/passwd-" file is a backup file of "/etc/passwd", and as such, contains information about the users that are configured on the system. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/passwd- to root by running the following command: - -$ sudo chgrp root /etc/passwd-Verify the group ownership of the "/etc/passwd-" file with the following command: - -$ sudo stat -c "%G %n" /etc/passwd- - -root /etc/passwd- - -If "/etc/passwd-" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232150RHEL 9 /etc/shadow file must be owned by root.<VulnDiscussion>The "/etc/shadow" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/shadow to root by running the following command: - -$ sudo chown root /etc/shadowVerify the ownership of the "/etc/shadow" file with the following command: - -$ sudo stat -c "%U %n" /etc/shadow - -root /etc/shadow - -If "/etc/shadow" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232155RHEL 9 /etc/shadow file must be group-owned by root.<VulnDiscussion>The "/etc/shadow" file stores password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/shadow to root by running the following command: - -$ sudo chgrp root /etc/shadowVerify the group ownership of the "/etc/shadow" file with the following command: - -$ sudo stat -c "%G %n" /etc/shadow - -root /etc/shadow - -If "/etc/shadow" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232160RHEL 9 /etc/shadow- file must be owned by root.<VulnDiscussion>The "/etc/shadow-" file is a backup file of "/etc/shadow", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the owner of the file /etc/shadow- to root by running the following command: - -$ sudo chown root /etc/shadow-Verify the ownership of the "/etc/shadow-" file with the following command: - -$ sudo stat -c "%U %n" /etc/shadow- - -root /etc/shadow- - -If "/etc/shadow-" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232165RHEL 9 /etc/shadow- file must be group-owned by root.<VulnDiscussion>The "/etc/shadow-" file is a backup file of "/etc/shadow", and as such, contains the list of local system accounts and password hashes. Protection of this file is critical for system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group of the file /etc/shadow- to root by running the following command: - -$ sudo chgrp root /etc/shadow-Verify the group ownership of the "/etc/shadow-" file with the following command: - -$ sudo stat -c "%G %n" /etc/shadow- - -root /etc/shadow- - -If "/etc/shadow-" file does not have a group owner of "root", this is a finding.SRG-OS-000206-GPOS-00084<GroupDescription></GroupDescription>RHEL-09-232170RHEL 9 /var/log directory must be owned by root.<VulnDiscussion>Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. - -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001314Configure the owner of the directory "/var/log" to "root" by running the following command: - -$ sudo chown root /var/logVerify the "/var/log" directory is owned by root with the following command: - -$ ls -ld /var/log - -drwxr-xr-x. 16 root root 4096 July 11 11:34 /var/log - -If "/var/log" does not have an owner of "root", this is a finding.SRG-OS-000206-GPOS-00084<GroupDescription></GroupDescription>RHEL-09-232175RHEL 9 /var/log directory must be group-owned by root.<VulnDiscussion>Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. - -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001314Configure the group owner of the directory "/var/log" to "root" by running the following command: - -$ sudo chgrp root /var/logVerify the "/var/log" directory is group-owned by root with the following command: - -$ ls -ld /var/log - -drwxr-xr-x. 16 root root 4096 July 11 11:34 /var/log - -If "/var/log" does not have a group owner of "root", this is a finding.SRG-OS-000206-GPOS-00084<GroupDescription></GroupDescription>RHEL-09-232180RHEL 9 /var/log/messages file must be owned by root.<VulnDiscussion>Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. - -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001314Change the owner of the "/var/log/messages" file to "root" by running the following command: - -$ sudo chown root /var/log/messagesVerify the "/var/log/messages" file is owned by root with the following command: - -$ ls -la /var/log/messages - -rw-------. 1 root root 564223 July 11 11:34 /var/log/messages - -If "/var/log/messages" does not have an owner of "root", this is a finding.SRG-OS-000206-GPOS-00084<GroupDescription></GroupDescription>RHEL-09-232185RHEL 9 /var/log/messages file must be group-owned by root.<VulnDiscussion>Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. - -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001314Change the group owner of the "/var/log/messages" file to "root" by running the following command: - -$ sudo chgrp root /var/log/messagesVerify the "/var/log/messages" file is group-owned by root with the following command: - -$ ls -la /var/log/messages - -rw-------. 1 root root 564223 July 11 11:34 /var/log/messages - -If "/var/log/messages" does not have a group owner of "root", this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232190RHEL 9 system commands must be owned by root.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system commands to be protected from unauthorized access. - -Run the following command, replacing "[FILE]" with any system command file not owned by "root". - -$ sudo chown root [FILE]Verify the system commands contained in the following directories are owned by "root" with the following command: - -$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/libexec /usr/local/bin /usr/local/sbin ! -user root -exec ls -l {} \; - -If any system commands are found to not be owned by root, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232195RHEL 9 system commands must be group-owned by root or a system account.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system commands to be protected from unauthorized access. - -Run the following command, replacing "[FILE]" with any system command file not group-owned by "root" or a required system account. - -$ sudo chgrp root [FILE]Verify the system commands contained in the following directories are group-owned by "root", or a required system account, with the following command: - -$ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -exec ls -l {} \; - -If any system commands are returned and is not group-owned by a required system account, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232200RHEL 9 library files must be owned by root.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system-wide shared library files (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. - -Run the following command, replacing "[FILE]" with any library file not owned by "root". - -$ sudo chown root [FILE]Verify the system-wide shared library files are owned by "root" with the following command: - -$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -user root -exec ls -l {} \; - -If any system-wide shared library file is not owned by root, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232205RHEL 9 library files must be group-owned by root or a system account.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system-wide shared library files (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. - -Run the following command, replacing "[FILE]" with any library file not group-owned by "root". - -$ sudo chgrp root [FILE]Verify the system-wide shared library files are group-owned by "root" with the following command: - -$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 ! -group root -exec ls -l {} \; - -If any system-wide shared library file is returned and is not group-owned by a required system account, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232210RHEL 9 library directories must be owned by root.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system-wide shared library directories within (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. - -Run the following command, replacing "[DIRECTORY]" with any library directory not owned by "root". - -$ sudo chown root [DIRECTORY]Verify the system-wide shared library directories are owned by "root" with the following command: - -$ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -user root -type d -exec stat -c "%n %U" '{}' \; - -If any system-wide shared library directory is not owned by root, this is a finding.SRG-OS-000259-GPOS-00100<GroupDescription></GroupDescription>RHEL-09-232215RHEL 9 library directories must be group-owned by root or a system account.<VulnDiscussion>If RHEL 9 allowed any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. - -This requirement applies to RHEL 9 with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001499Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access. - -Run the following command, replacing "[DIRECTORY]" with any library directory not group-owned by "root". - -$ sudo chgrp root [DIRECTORY]Verify the system-wide shared library directories are group-owned by "root" with the following command: - -$ sudo find /lib /lib64 /usr/lib /usr/lib64 ! -group root -type d -exec stat -c "%n %G" '{}' \; - -If any system-wide shared library directory is returned and is not group-owned by a required system account, this is a finding.SRG-OS-000256-GPOS-00097<GroupDescription></GroupDescription>RHEL-09-232220RHEL 9 audit tools must be owned by root.<VulnDiscussion>Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. - -RHEL 9 systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools, and the corresponding rights the user enjoys, to make access decisions regarding the access to audit tools. - -Audit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001493Configure the audit tools to be owned by "root" by running the following command: - -$ sudo chown root [audit_tool] - -Replace "[audit_tool]" with each audit tool not owned by "root".Verify the audit tools are owned by "root" with the following command: - -$ sudo stat -c "%U %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules - -root /sbin/auditctl -root /sbin/aureport -root /sbin/ausearch -root /sbin/autrace -root /sbin/auditd -root /sbin/rsyslogd -root /sbin/augenrules - -If any audit tools do not have an owner of "root", this is a finding.SRG-OS-000256-GPOS-00097<GroupDescription></GroupDescription>RHEL-09-232225RHEL 9 audit tools must be group-owned by root.<VulnDiscussion>Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data; therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. - -RHEL 9 systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools, and the corresponding rights the user enjoys, to make access decisions regarding the access to audit tools. - -Audit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001493Configure the audit tools to be group-owned by "root" by running the following command: - -$ sudo chgrp root [audit_tool] - -Replace "[audit_tool]" with each audit tool not group-owned by "root".Verify the audit tools are group owned by "root" with the following command: - -$ sudo stat -c "%G %n" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/rsyslogd /sbin/augenrules - -root /sbin/auditctl -root /sbin/aureport -root /sbin/ausearch -root /sbin/autrace -root /sbin/auditd -root /sbin/rsyslogd -root /sbin/augenrules - -If any audit tools do not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232230RHEL 9 cron configuration files directory must be owned by root.<VulnDiscussion>Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure any cron configuration not owned by root with the following command: - -$ sudo chown root [cron config file]Verify the ownership of all cron configuration files with the command: - -$ stat -c "%U %n" /etc/cron* - -root /etc/cron.d -root /etc/cron.daily -root /etc/cron.deny -root /etc/cron.hourly -root /etc/cron.monthly -root /etc/crontab -root /etc/cron.weekly - -If any crontab is not owned by root, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232235RHEL 9 cron configuration files directory must be group-owned by root.<VulnDiscussion>Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure any cron configuration not group-owned by root with the following command: - -$ sudo chgrp root [cron config file]Verify the group ownership of all cron configuration files with the following command: - -$ stat -c "%G %n" /etc/cron* - -root /etc/cron.d -root /etc/cron.daily -root /etc/cron.deny -root /etc/cron.hourly -root /etc/cron.monthly -root /etc/crontab -root /etc/cron.weekly - -If any crontab is not group owned by root, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232240All RHEL 9 world-writable directories must be owned by root, sys, bin, or an application user.<VulnDiscussion>If a world-writable directory is not owned by root, sys, bin, or an application user identifier (UID), unauthorized users may be able to modify files created by others. - -The only authorized public directories are those temporary directories supplied with the system or those designed to be temporary file repositories. The setting is normally reserved for directories used by the system and by users for temporary file storage, (e.g., /tmp), and for directories requiring global read/write access. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000138-GPOS-00069</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001090Configure all public directories to be owned by root or a system account to prevent unauthorized and unintended information transferred via shared system resources. - -Set the owner of all public directories as root or a system account using the command, replace "[Public Directory]" with any directory path not owned by root or a system account: - -$ sudo chown root [Public Directory]Verify that world writable directories are owned by root, a system account, or an application account with the following command. It will discover and print world-writable directories that are not owned by root. Run it once for each local partition [PART]: - -$ sudo find PART -xdev -type d -perm -0002 -uid +0 -print - -If there is output, this is a finding.SRG-OS-000138-GPOS-00069<GroupDescription></GroupDescription>RHEL-09-232245A sticky bit must be set on all RHEL 9 public directories.<VulnDiscussion>Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. - -This requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DOD or other government agencies.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001090Configure all world-writable directories to have the sticky bit set to prevent unauthorized and unintended information transferred via shared system resources. - -Set the sticky bit on all world-writable directories using the command, replace "[World-Writable Directory]" with any directory path missing the sticky bit: - -$ chmod a+t [World-Writable Directory]Verify that all world-writable directories have the sticky bit set. - -Determine if all world-writable directories have the sticky bit set by running the following command: - -$ sudo find / -type d \( -perm -0002 -a ! -perm -1000 \) -print 2>/dev/null - -drwxrwxrwt 7 root root 4096 Jul 26 11:19 /tmp - -If any of the returned directories are world-writable and do not have the sticky bit set, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232250All RHEL 9 local files and directories must have a valid group owner.<VulnDiscussion>Files without a valid group owner may be unintentionally inherited if a group is assigned the same Group Identifier (GID) as the GID of the files without a valid group owner.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Either remove all files and directories from RHEL 9 that do not have a valid group, or assign a valid group to all files and directories on the system with the "chgrp" command: - -$ sudo chgrp <group> <file>Verify all local files and directories on RHEL 9 have a valid group with the following command: - -$ df --local -P | awk {'if (NR!=1) print $6'} | sudo xargs -I '{}' find '{}' -xdev -nogroup - -If any files on the system do not have an assigned group, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232255All RHEL 9 local files and directories must have a valid owner.<VulnDiscussion>Unowned files and directories may be unintentionally inherited if a user is assigned the same user identifier "UID" as the UID of the unowned files.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Either remove all files and directories from the system that do not have a valid user, or assign a valid user to all unowned files and directories on RHEL 9 with the "chown" command: - -$ sudo chown <user> <file>Verify all local files and directories on RHEL 9 have a valid owner with the following command: - -$ df --local -P | awk {'if (NR!=1) print $6'} | sudo xargs -I '{}' find '{}' -xdev -nouser - -If any files on the system do not have an assigned owner, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232260RHEL 9 must be configured so that all system device files are correctly labeled to prevent unauthorized modification.<VulnDiscussion>If an unauthorized or modified device is allowed to exist on the system, there is the possibility the system may perform unintended or unauthorized operations.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Restore the SELinux policy for the affected device file from the system policy database using the following command: - -$ sudo restorecon -v <device_path> - -Substituting "<device_path>" with the path to the affected device file (from the output of the previous commands). An example device file path would be "/dev/ttyUSB0". If the output of the above command does not indicate that the device was relabeled to a more specific SELinux type label, then the SELinux policy of the system must be updated with more specific policy for the device class specified. If a package was used to install support for a device class, that package could be reinstalled using the following command: - -$ sudo dnf reinstall <package_name> - -If a package was not used to install the SELinux policy for a given device class, then it must be generated manually and provide specific type labels.Verify that all system device files are correctly labeled to prevent unauthorized modification. - -List all device files on the system that are incorrectly labeled with the following commands: - -Note: Device files are normally found under "/dev", but applications may place device files in other directories and may necessitate a search of the entire system. - -# find /dev -context *:device_t:* \( -type c -o -type b \) -printf "%p %Z\n" - -# find /dev -context *:unlabeled_t:* \( -type c -o -type b \) -printf "%p %Z\n" - -Note: There are device files, such as "/dev/vmci", that are used when the operating system is a host virtual machine. They will not be owned by a user on the system and require the "device_t" label to operate. These device files are not a finding. - -If there is output from either of these commands, other than already noted, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232265RHEL 9 /etc/crontab file must have mode 0600.<VulnDiscussion>Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations; therefore, service configuration files must have the correct access rights to prevent unauthorized changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the RHEL 9 file /etc/crontab with mode 600. - -$ sudo chmod 0600 /etc/crontabVerify the permissions of /etc/crontab with the following command: - -$ stat -c "%a %n" /etc/crontab - -0600 - -If /etc/crontab does not have a mode of "0600", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-232270RHEL 9 /etc/shadow file must have mode 0000 to prevent unauthorized access.<VulnDiscussion>The "/etc/shadow" file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information, which could weaken the system security posture.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of the file "/etc/shadow" to "0000" by running the following command: - -$ sudo chmod 0000 /etc/shadowVerify that the "/etc/shadow" file has mode "0000" with the following command: - -$ sudo stat -c "%a %n" /etc/shadow - -0 /etc/shadow - -If a value of "0" is not returned, this is a finding.SRG-OS-000096-GPOS-00050<GroupDescription></GroupDescription>RHEL-09-251010RHEL 9 must have the firewalld package installed.<VulnDiscussion>"Firewalld" provides an easy and effective way to block/limit remote access to the system via ports, services, and protocols. - -Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. - -Remote access is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -RHEL 9 functionality (e.g., SSH) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets). - -Satisfies: SRG-OS-000096-GPOS-00050, SRG-OS-000297-GPOS-00115, SRG-OS-000298-GPOS-00116, SRG-OS-000480-GPOS-00227, SRG-OS-000480-GPOS-00232</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000382CCI-002314CCI-002322To install the "firewalld" package run the following command: - -$ sudo dnf install firewalldRun the following command to determine if the firewalld package is installed with the following command: - -$ sudo dnf list --installed firewalld - -Example output: - -firewalld.noarch 1.0.0-4.el9 - -If the "firewall" package is not installed, this is a finding.SRG-OS-000096-GPOS-00050<GroupDescription></GroupDescription>RHEL-09-251015The firewalld service on RHEL 9 must be active.<VulnDiscussion>"Firewalld" provides an easy and effective way to block/limit remote access to the system via ports, services, and protocols. - -Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. - -Remote access is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -RHEL 9 functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets). - -Satisfies: SRG-OS-000096-GPOS-00050, SRG-OS-000297-GPOS-00115, SRG-OS-000480-GPOS-00227, SRG-OS-000480-GPOS-00232</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000382CCI-002314To enable the firewalld service run the following command: - -$ sudo systemctl enable --now firewalldVerify that "firewalld" is active with the following command: - -$ systemctl is-active firewalld - -active - -If the firewalld service is not active, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-251020A RHEL 9 firewall must employ a deny-all, allow-by-exception policy for allowing connections to other systems.<VulnDiscussion>Failure to restrict network connectivity only to authorized systems permits inbound connections from malicious systems. It also permits outbound connections that may facilitate exfiltration of DOD data. - -RHEL 9 incorporates the "firewalld" daemon, which allows for many different configurations. One of these configurations is zones. Zones can be utilized to a deny-all, allow-by-exception approach. The default "drop" zone will drop all incoming network packets unless it is explicitly allowed by the configuration file or is related to an outgoing network connection.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "firewalld" daemon to employ a deny-all, allow-by-exception with the following commands: - -Start by adding the exceptions that are required for mission functionality to the "drop" zone. If SSH access on port 22 is needed, for example, run the following: "sudo firewall-cmd --permanent --add-service=ssh --zone=drop" - -Reload the firewall rules to update the runtime configuration from the "--permanent" changes made above: -$ sudo firewall-cmd --reload - -Set the default zone to the drop zone: -$ sudo firewall-cmd --set-default-zone=drop -Note: This is a runtime and permanent change. - -Add any interfaces to the newly modified "drop" zone: -$ sudo firewall-cmd --permanent --zone=drop --change-interface=ens33 - -Reload the firewall rules for changes to take effect: -$ sudo firewall-cmd --reloadVerify the RHEL 9 "firewalld" is configured to employ a deny-all, allow-by-exception policy for allowing connections to other systems with the following commands: - -$ sudo firewall-cmd --state - -running - -$ sudo firewall-cmd --get-active-zones - -public - interfaces: ens33 - -$ sudo firewall-cmd --info-zone=public | grep target - - target: DROP - -$ sudo firewall-cmd --permanent --info-zone=public | grep target - - target: DROP - -If no zones are active on the RHEL 9 interfaces or if runtime and permanent targets are set to a different option other than "DROP", this is a finding.SRG-OS-000096-GPOS-00050<GroupDescription></GroupDescription>RHEL-09-251025RHEL 9 must control remote access methods.<VulnDiscussion>To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols on information systems. - -Operating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., VPN and IPS); however, doing so increases risk over limiting the services provided by one component. - -To support the requirements and principles of least functionality, the operating system must support the organizational requirements, providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business. - -Satisfies: SRG-OS-000096-GPOS-00050, SRG-OS-000297-GPOS-00115</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000382CCI-002314Configure RHEL 9 to allow approved settings and/or running services to comply with the PPSM CLSA for the site or program and the PPSM CAL. - -To open a port for a service, configure firewalld using the following command: - -$ sudo firewall-cmd --permanent --add-port=port_number/tcp -or -$ sudo firewall-cmd --permanent --add-service=service_nameInspect the list of enabled firewall ports and verify they are configured correctly by running the following command: - -$ sudo firewall-cmd --list-all - -Ask the system administrator for the site or program Ports, Protocols, and Services Management Component Local Service Assessment (PPSM CLSA). Verify the services allowed by the firewall match the PPSM CLSA. - -If there are additional ports, protocols, or services that are not in the PPSM CLSA, or there are ports, protocols, or services that are prohibited by the PPSM Category Assurance List (CAL), or there are no firewall rules configured, this is a finding.SRG-OS-000420-GPOS-00186<GroupDescription></GroupDescription>RHEL-09-251030RHEL 9 must protect against or limit the effects of denial-of-service (DoS) attacks by ensuring rate-limiting measures on impacted network interfaces are implemented.<VulnDiscussion>DoS is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. - -This requirement addresses the configuration of RHEL 9 to mitigate the impact of DoS attacks that have occurred or are ongoing on system availability. For each system, known and potential DoS attacks must be identified and solutions for each type implemented. A variety of technologies exists to limit or, in some cases, eliminate the effects of DoS attacks (e.g., limiting processes or establishing memory partitions). Employing increased capacity and bandwidth, combined with service redundancy, may reduce the susceptibility to some DoS attacks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002385Configure "nftables" to be the default "firewallbackend" for "firewalld" by adding or editing the following line in "etc/firewalld/firewalld.conf": - -FirewallBackend=nftables - -Establish rate-limiting rules based on organization-defined types of DoS attacks on impacted network interfaces.Verify "nftables" is configured to allow rate limits on any connection to the system with the following command: - -$ sudo grep -i firewallbackend /etc/firewalld/firewalld.conf - -# FirewallBackend -FirewallBackend=nftables - -If the "nftables" is not set as the "FirewallBackend" default, this is a finding.SRG-OS-000096-GPOS-00050<GroupDescription></GroupDescription>RHEL-09-251035RHEL 9 must be configured to prohibit or restrict the use of functions, ports, protocols, and/or services, as defined in the Ports, Protocols, and Services Management (PPSM) Category Assignments List (CAL) and vulnerability assessments.<VulnDiscussion>To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary ports, protocols, and services on information systems.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000382Update the host's firewall settings and/or running services to comply with the PPSM CLSA for the site or program and the PPSM CAL. - -Then run the following command to load the newly created rule(s): - -$ sudo firewall-cmd --reloadInspect the firewall configuration and running services to verify it is configured to prohibit or restrict the use of functions, ports, protocols, and/or services that are unnecessary or prohibited. - -Check which services are currently active with the following command: - -$ sudo firewall-cmd --list-all-zones - -custom (active) -target: DROP -icmp-block-inversion: no -interfaces: ens33 -sources: -services: dhcpv6-client dns http https ldaps rpc-bind ssh -ports: -masquerade: no -forward-ports: -icmp-blocks: -rich rules: - -Ask the system administrator for the site or program Ports, Protocols, and Services Management Component Local Service Assessment (PPSM CLSA). Verify the services allowed by the firewall match the PPSM CLSA. - -If there are additional ports, protocols, or services that are not in the PPSM CLSA, or there are ports, protocols, or services that are prohibited by the PPSM Category Assurance List (CAL), this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-251040RHEL 9 network interfaces must not be in promiscuous mode.<VulnDiscussion>Network interfaces in promiscuous mode allow for the capture of all network traffic visible to the system. If unauthorized individuals can access these applications, it may allow them to collect information such as logon IDs, passwords, and key exchanges between systems. - -If the system is being used to perform a network troubleshooting function, the use of these tools must be documented with the information systems security officer (ISSO) and restricted to only authorized personnel.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure network interfaces to turn off promiscuous mode unless approved by the ISSO and documented. - -Set the promiscuous mode of an interface to off with the following command: - -$ sudo ip link set dev <devicename> multicast off promisc offVerify network interfaces are not in promiscuous mode with the following command: - -$ ip link | grep -i promisc - -If network interfaces are found on the system in promiscuous mode and their use has not been approved by the ISSO and documented, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-251045RHEL 9 must enable hardening for the Berkeley Packet Filter just-in-time compiler.<VulnDiscussion>When hardened, the extended Berkeley Packet Filter (BPF) just-in-time (JIT) compiler will randomize any kernel addresses in the BPF programs and maps, and will not expose the JIT addresses in "/proc/kallsyms".</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to enable hardening for the BPF JIT compiler by adding the following line to a file, in the "/etc/sysctl.d" directory: - -net.core.bpf_jit_harden = 2 - -The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: - -$ sudo sysctl --systemVerify RHEL 9 enables hardening for the BPF JIT with the following commands: - -$ sudo sysctl net.core.bpf_jit_harden - -net.core.bpf_jit_harden = 2 - -If the returned line does not have a value of "2", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.core.bpf_jit_harden | tail -1 -net.core.bpf_jit_harden = 2 - -If the network parameter "net.core.bpf_jit_harden" is not equal to "2" or nothing is returned, this is a finding.SRG-OS-000355-GPOS-00143<GroupDescription></GroupDescription>RHEL-09-252010RHEL 9 must have the chrony package installed.<VulnDiscussion>Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001891The chrony package can be installed with the following command: - -$ sudo dnf install chronyVerify that RHEL 9 has the chrony package installed with the following command: - -$ sudo dnf list --installed chrony - -Example output: - -chrony.x86_64 4.1-3.el9 - -If the "chrony" package is not installed, this is a finding.SRG-OS-000355-GPOS-00143<GroupDescription></GroupDescription>RHEL-09-252015RHEL 9 chronyd service must be enabled.<VulnDiscussion>Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. - -Synchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001891To enable the chronyd service run the following command: - -$ sudo systemctl enable --now chronydVerify the chronyd service is active with the following command: - -$ systemctl is-active chronyd - -active - -If the chronyd service is not active, this is a finding.SRG-OS-000355-GPOS-00143<GroupDescription></GroupDescription>RHEL-09-252020RHEL 9 must securely compare internal information system clocks at least every 24 hours.<VulnDiscussion>Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. - -Synchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network. - -Depending on the infrastructure being used the "pool" directive may not be supported. - -Authoritative time sources include the United States Naval Observatory (USNO) time servers, a time server designated for the appropriate DOD network (NIPRNet/SIPRNet), and/or the Global Positioning System (GPS). - -Satisfies: SRG-OS-000355-GPOS-00143, SRG-OS-000356-GPOS-00144, SRG-OS-000359-GPOS-00146</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001890CCI-001891CCI-002046Configure RHEL 9 to securely compare internal information system clocks at least every 24 hours with an NTP server by adding/modifying the following line in the /etc/chrony.conf file. - -server [ntp.server.name] iburst maxpoll 16Verify RHEL 9 is securely comparing internal information system clocks at least every 24 hours with an NTP server with the following commands: - -$ sudo grep maxpoll /etc/chrony.conf - -server 0.us.pool.ntp.mil iburst maxpoll 16 - -If the "maxpoll" option is set to a number greater than 16 or the line is commented out, this is a finding. - -Verify the "chrony.conf" file is configured to an authoritative DOD time source by running the following command: - -$ sudo grep -i server /etc/chrony.conf -server 0.us.pool.ntp.mil - -If the parameter "server" is not set or is not set to an authoritative DOD time source, this is a finding.SRG-OS-000096-GPOS-00050<GroupDescription></GroupDescription>RHEL-09-252025RHEL 9 must disable the chrony daemon from acting as a server.<VulnDiscussion>Minimizing the exposure of the server functionality of the chrony daemon diminishes the attack surface. - -Satisfies: SRG-OS-000096-GPOS-00050, SRG-OS-000095-GPOS-00049</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381CCI-000382Configure RHEL 9 to disable the chrony daemon from acting as a server by adding/modifying the following line in the /etc/chrony.conf file: - -port 0Verify RHEL 9 disables the chrony daemon from acting as a server with the following command: - -$ grep -w port /etc/chrony.conf - -port 0 - -If the "port" option is not set to "0", is commented out, or is missing, this is a finding.SRG-OS-000096-GPOS-00050<GroupDescription></GroupDescription>RHEL-09-252030RHEL 9 must disable network management of the chrony daemon.<VulnDiscussion>Not exposing the management interface of the chrony daemon on the network diminishes the attack space. - -Satisfies: SRG-OS-000096-GPOS-00050, SRG-OS-000095-GPOS-00049</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381CCI-000382Configure RHEL 9 to disable network management of the chrony daemon by adding/modifying the following line in the /etc/chrony.conf file: - -cmdport 0Verify RHEL 9 disables network management of the chrony daemon with the following command: - -$ grep -w cmdport /etc/chrony.conf - -cmdport 0 - -If the "cmdport" option is not set to "0", is commented out, or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252035RHEL 9 systems using Domain Name Servers (DNS) resolution must have at least two name servers configured.<VulnDiscussion>To provide availability for name resolution services, multiple redundant name servers are mandated. A failure in name resolution could lead to the failure of security functions requiring name resolution, which may include time synchronization, centralized authentication, and remote system logging.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the operating system to use two or more name servers for DNS resolution based on the DNS mode of the system. - -If the NetworkManager DNS mode is set to "none", then add the following lines to "/etc/resolv.conf": - -nameserver [name server 1] -nameserver [name server 2] - -Replace [name server 1] and [name server 2] with the IPs of two different DNS resolvers. - -If the NetworkManager DNS mode is set to "default" then add two DNS servers to a NetworkManager connection. Using the following commands: - -$ sudo nmcli connection modify [connection name] ipv4.dns [name server 1] -$ sudo nmcli connection modify [connection name] ipv4.dns [name server 2] - -Replace [name server 1] and [name server 2] with the IPs of two different DNS resolvers. Replace [connection name] with a valid NetworkManager connection name on the system. Replace ipv4 with ipv6 if IPv6 DNS servers are used.Verify the name servers used by the system with the following command: - -$ grep nameserver /etc/resolv.conf - -nameserver 192.168.1.2 -nameserver 192.168.1.3 - -If less than two lines are returned that are not commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252040RHEL 9 must configure a DNS processing mode set be Network Manager.<VulnDiscussion>In order to ensure that DNS resolver settings are respected, a DNS mode in Network Manager must be configured.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure NetworkManager in RHEL 9 to use a DNS mode. - -In "/etc/NetworkManager/NetworkManager.conf" add the following line in the "[main]" section: - -dns = none - -NetworkManager must be reloaded for the change to take effect. - -$ sudo systemctl reload NetworkManagerVerify that RHEL 9 has a DNS mode configured in Network Manager. - -$ NetworkManager --print-config -[main] -dns=none - -If the dns key under main does not exist or is not set to "none" or "default", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252045RHEL 9 must not have unauthorized IP tunnels configured.<VulnDiscussion>IP tunneling mechanisms can be used to bypass network filtering. If tunneling is required, it must be documented with the information system security officer (ISSO).</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove all unapproved tunnels from the system, or document them with the ISSO.Verify that RHEL 9 does not have unauthorized IP tunnels configured. - -Determine if the "IPsec" service is active with the following command: - -$ systemctl status ipsec - -ipsec.service - Internet Key Exchange (IKE) Protocol Daemon for IPsec -Loaded: loaded (/usr/lib/systemd/system/ipsec.service; disabled) -Active: inactive (dead) - -If the "IPsec" service is active, check for configured IPsec connections ("conn"), with the following command: - -$ grep -rni conn /etc/ipsec.conf /etc/ipsec.d/ - -Verify any returned results are documented with the ISSO. - -If the IPsec tunnels are active and not approved, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252050RHEL 9 must be configured to prevent unrestricted mail relaying.<VulnDiscussion>If unrestricted mail relaying is permitted, unauthorized senders could use this host as a mail relay for the purpose of sending spam or other unauthorized activity.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Modify the postfix configuration file to restrict client connections to the local network with the following command: - -$ sudo postconf -e 'smtpd_client_restrictions = permit_mynetworks,reject'Verify RHEL 9 is configured to prevent unrestricted mail relaying with the following command: - -$ postconf -n smtpd_client_restrictions - -smtpd_client_restrictions = permit_mynetworks,reject - -If the "smtpd_client_restrictions" parameter contains any entries other than "permit_mynetworks" and "reject", and the additional entries have not been documented with the information system security officer (ISSO), this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252055If the Trivial File Transfer Protocol (TFTP) server is required, RHEL 9 TFTP daemon must be configured to operate in secure mode.<VulnDiscussion>Restricting TFTP to a specific directory prevents remote users from copying, transferring, or overwriting system files. Using the "-s" option causes the TFTP service to only serve files from the given directory.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the TFTP daemon to operate in secure mode. - -1. Find the path for the systemd service. - -$ sudo systemctl show tftp | grep FragmentPath= -FragmentPath=/etc/systemd/system/tftp.service - -2. Edit the ExecStart line on that file to add the -s option with a subdirectory. - -ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpbootVerify the TFTP daemon is configured to operate in secure mode. - -Check if a TFTP server is installed with the following command: - -$ sudo dnf list --installed tftp-server - -Example output: - -tftp-server.x86_64 5.2-35.el9.x86_64 - -Note: If a TFTP server is not installed, this requirement is Not Applicable. - -If a TFTP server is installed, check for the server arguments with the following command: - -$ systemctl cat tftp | grep ExecStart -ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpboot - -If the "ExecStart" line does not have a "-s" option, and a subdirectory is not assigned, this is a finding.SRG-OS-000046-GPOS-00022<GroupDescription></GroupDescription>RHEL-09-252060RHEL 9 must forward mail from postmaster to the root account using a postfix alias.<VulnDiscussion>It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. - -Audit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000139Configure a valid email address as an alias for the root account. - -Append the following line to "/etc/aliases": - -postmaster: root - -Then, run the following command: - -$ sudo newaliasesVerify that the administrators are notified in the event of an audit processing failure. - -Check that the "/etc/aliases" file has a defined value for "root". - -$ sudo grep "postmaster:\s*root$" /etc/aliases - -If the command does not return a line, or the line is commented out, ask the system administrator to indicate how they and the information systems security officer (ISSO) are notified of an audit process failure. If there is no evidence of the proper personnel being notified of an audit processing failure, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252065RHEL 9 libreswan package must be installed.<VulnDiscussion>Providing the ability for remote users or systems to initiate a secure VPN connection protects information when it is transmitted over a wide area network. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000120-GPOS-00061</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000803Install the libreswan service (if it is not already installed) with the following command: - -$ sudo dnf install libreswanVerify that RHEL 9 libreswan service package is installed. - -Check that the libreswan service package is installed with the following command: - -$ sudo dnf list --installed libreswan - -Example output: - -libreswan.x86_64 4.6-3.el9 - -If the "libreswan" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252070There must be no shosts.equiv files on RHEL 9.<VulnDiscussion>The shosts.equiv files are used to configure host-based authentication for the system via SSH. Host-based authentication is not sufficient for preventing unauthorized access to the system, as it does not require interactive identification and authentication of a connection request, or for the use of two-factor authentication.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove any found "shosts.equiv" files from the system. - -$ sudo rm /[path]/[to]/[file]/shosts.equivVerify there are no "shosts.equiv" files on RHEL 9 with the following command: - -$ sudo find / -name shosts.equiv - -If a "shosts.equiv" file is found, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-252075There must be no .shosts files on RHEL 9.<VulnDiscussion>The .shosts files are used to configure host-based authentication for individual users or the system via SSH. Host-based authentication is not sufficient for preventing unauthorized access to the system, as it does not require interactive identification and authentication of a connection request, or for the use of two-factor authentication.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove any found ".shosts" files from the system. - -$ sudo rm /[path]/[to]/[file]/.shostsVerify there are no ".shosts" files on RHEL 9 with the following command: - -$ sudo find / -name .shosts - -If a ".shosts" file is found, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253010RHEL 9 must be configured to use TCP syncookies.<VulnDiscussion>Denial of service (DoS) is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. - -Managing excess capacity ensures that sufficient capacity is available to counter flooding attacks. Employing increased capacity and service redundancy may reduce the susceptibility to some DoS attacks. Managing excess capacity may include, for example, establishing selected usage priorities, quotas, or partitioning. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000420-GPOS-00186, SRG-OS-000142-GPOS-00071</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001095CCI-002385Configure RHEL 9 to use TCP syncookies. - -Add or edit the following line in a system configuration file in the "/etc/sysctl.d/" directory: - net.ipv4.tcp_syncookies = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is configured to use IPv4 TCP syncookies. - -Determine if syncookies are used with the following command: - -Check the status of the kernel.perf_event_paranoid kernel parameter. - -$ sudo sysctl net.ipv4.tcp_syncookies - -net.ipv4.tcp_syncookies = 1 - -Check that the configuration files are present to enable this kernel parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.tcp_syncookies | tail -1 - -net.ipv4.tcp_syncookies = 1 - -If the network parameter "ipv4.tcp_syncookies" is not equal to "1" or nothing is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253015RHEL 9 must ignore Internet Protocol version 4 (IPv4) Internet Control Message Protocol (ICMP) redirect messages.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. - -This feature of the IPv4 protocol has few legitimate uses. It should be disabled unless absolutely required.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to ignore IPv4 ICMP redirect messages. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.all.accept_redirects = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 will not accept IPv4 ICMP redirect messages. - -Check the value of the all "accept_redirects" variables with the following command: - -$ sudo sysctl net.ipv4.conf.all.accept_redirects - -net.ipv4.conf.all.accept_redirects = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.all.accept_redirects | tail -1 - -net.ipv4.conf.all.accept_redirects = 0 - -If "net.ipv4.conf.all.accept_redirects" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253020RHEL 9 must not forward Internet Protocol version 4 (IPv4) source-routed packets.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routerd traffic, such as when IPv4 forwarding is enabled and the system is functioning as a router. - -Accepting source-routed packets in the IPv4 protocol has few legitimate uses. It must be disabled unless it is absolutely required.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to ignore IPv4 source-routed packets. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.all.accept_source_route = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 will not accept IPv4 source-routed packets. - -Check the value of the all "accept_source_route" variables with the following command: - -$ sudo sysctl net.ipv4.conf.all.accept_source_route - -net.ipv4.conf.all.accept_source_route = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.all.accept_source_route | tail -1 - -net.ipv4.conf.all.accept_source_route = 0 - -If "net.ipv4.conf.all.accept_source_route" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253025RHEL 9 must log IPv4 packets with impossible addresses.<VulnDiscussion>The presence of "martian" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to log martian packets on IPv4 interfaces. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.all.log_martians=1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 logs IPv4 martian packets. - -Check the value of the accept source route variable with the following command: - -$ sudo sysctl net.ipv4.conf.all.log_martians - -net.ipv4.conf.all.log_martians = 1 - -If the returned line does not have a value of "1", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.all.log_martians | tail -1 - -net.ipv4.conf.all.log_martians = 1 - -If "net.ipv4.conf.all.log_martians" is not set to "1" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253030RHEL 9 must log IPv4 packets with impossible addresses by default.<VulnDiscussion>The presence of "martian" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to log martian packets on IPv4 interfaces by default. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.default.log_martians=1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 logs IPv4 martian packets by default. - -Check the value of the accept source route variable with the following command: - -$ sudo sysctl net.ipv4.conf.default.log_martians - -net.ipv4.conf.default.log_martians = 1 - -If the returned line does not have a value of "1", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.log_martians | tail -1 - -net.ipv4.conf.default.log_martians = 1 - -If "net.ipv4.conf.default.log_martians" is not set to "1" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253035RHEL 9 must use reverse path filtering on all IPv4 interfaces.<VulnDiscussion>Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface on which they were received. It must not be used on systems that are routers for complicated networks, but is helpful for end hosts and routers serving small networks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to use reverse path filtering on all IPv4 interfaces. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.all.rp_filter = 1 - -The system configuration files need to be reloaded for the changes to take effect. To reload the contents of the files, run the following command: - -$ sudo sysctl --systemVerify RHEL 9 uses reverse path filtering on all IPv4 interfaces with the following commands: - -$ sudo sysctl net.ipv4.conf.all.rp_filter - -net.ipv4.conf.all.rp_filter = 1 - -If the returned line does not have a value of "1", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.all.rp_filter | tail -1 - -net.ipv4.conf.all.rp_filter = 1 - -If "net.ipv4.conf.all.rp_filter" is not set to "1" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253040RHEL 9 must prevent IPv4 Internet Control Message Protocol (ICMP) redirect messages from being accepted.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. - -This feature of the IPv4 protocol has few legitimate uses. It must be disabled unless absolutely required.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to prevent IPv4 ICMP redirect messages from being accepted. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.default.accept_redirects = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 will not accept IPv4 ICMP redirect messages. - -Check the value of the default "accept_redirects" variables with the following command: - -$ sudo sysctl net.ipv4.conf.default.accept_redirects - -net.ipv4.conf.default.accept_redirects = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.accept_redirects | tail -1 - -net.ipv4.conf.default.accept_redirects = 0 - -If "net.ipv4.conf.default.accept_redirects" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253045RHEL 9 must not forward IPv4 source-routed packets by default.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. - -Accepting source-routed packets in the IPv4 protocol has few legitimate uses. It must be disabled unless it is absolutely required, such as when IPv4 forwarding is enabled and the system is legitimately functioning as a router.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not forward IPv4 source-routed packets by default. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.default.accept_source_route = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not accept IPv4 source-routed packets by default. - -Check the value of the accept source route variable with the following command: - -$ sudo sysctl net.ipv4.conf.default.accept_source_route - -net.ipv4.conf.default.accept_source_route = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.accept_source_route | tail -1 - -net.ipv4.conf.default.accept_source_route = 0 - -If "net.ipv4.conf.default.accept_source_route" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253050RHEL 9 must use a reverse-path filter for IPv4 network traffic when possible by default.<VulnDiscussion>Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface on which they were received. It must not be used on systems that are routers for complicated networks, but is helpful for end hosts and routers serving small networks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to use reverse path filtering on IPv4 interfaces by default. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.default.rp_filter = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 uses reverse path filtering on IPv4 interfaces with the following commands: - -$ sudo sysctl net.ipv4.conf.default.rp_filter - -net.ipv4.conf.default.rp_filter = 1 - -If the returned line does not have a value of "1", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.rp_filter | tail -1 - -net.ipv4.conf.default.rp_filter = 1 - -If "net.ipv4.conf.default.rp_filter" is not set to "1" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253055RHEL 9 must not respond to Internet Control Message Protocol (ICMP) echoes sent to a broadcast address.<VulnDiscussion>Responding to broadcast (ICMP) echoes facilitates network mapping and provides a vector for amplification attacks. - -Ignoring ICMP echo requests (pings) sent to broadcast or multicast addresses makes the system slightly more difficult to enumerate on the network.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not respond to IPv4 ICMP echoes sent to a broadcast address. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.icmp_echo_ignore_broadcasts = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not respond to ICMP echoes sent to a broadcast address. - -Check the value of the "icmp_echo_ignore_broadcasts" variable with the following command: - -$ sudo sysctl net.ipv4.icmp_echo_ignore_broadcasts - -net.ipv4.icmp_echo_ignore_broadcasts = 1 - -If the returned line does not have a value of "1", a line is not returned, or the retuned line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|$)' | grep -F net.ipv4.icmp_echo_ignore_broadcasts | tail -1 - -net.ipv4.icmp_echo_ignore_broadcasts = 1 - -If "net.ipv4.icmp_echo_ignore_broadcasts" is not set to "1" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253060RHEL 9 must limit the number of bogus Internet Control Message Protocol (ICMP) response errors logs.<VulnDiscussion>Some routers will send responses to broadcast frames that violate RFC-1122, which fills up a log file system with many useless error messages. An attacker may take advantage of this and attempt to flood the logs with bogus error logs. Ignoring bogus ICMP error responses reduces log size, although some activity would not be logged.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not log bogus ICMP errors: - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.icmp_ignore_bogus_error_responses = 1 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemThe runtime status of the net.ipv4.icmp_ignore_bogus_error_responses kernel parameter can be queried by running the following command: - -$ sudo sysctl net.ipv4.icmp_ignore_bogus_error_responses - -net.ipv4.icmp_ignore_bogus_error_responses = 1 - -If "net.ipv4.icmp_ignore_bogus_error_responses" is not set to "1", this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.icmp_ignore_bogus_error_response | tail -1 - -net.ipv4.icmp_ignore_bogus_error_response = 1 - -If "net.ipv4.icmp_ignore_bogus_error_response" is not set to "1" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253065RHEL 9 must not send Internet Control Message Protocol (ICMP) redirects.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table possibly revealing portions of the network topology. - -The ability to send ICMP redirects is only appropriate for systems acting as routers.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not allow interfaces to perform IPv4 ICMP redirects. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.all.send_redirects = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not IPv4 ICMP redirect messages. - -Check the value of the "all send_redirects" variables with the following command: - -$ sudo sysctl net.ipv4.conf.all.send_redirects - -net.ipv4.conf.all.send_redirects = 0 - -If the returned line does not have a value of "0", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.all.send_redirects | tail -1 - -net.ipv4.conf.all.send_redirects = 0 - -If "net.ipv4.conf.all.send_redirects" is not set to "0" and is not documented with the information system security officer (ISSO) as an operational requirement or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253070RHEL 9 must not allow interfaces to perform Internet Control Message Protocol (ICMP) redirects by default.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table possibly revealing portions of the network topology. - -The ability to send ICMP redirects is only appropriate for systems acting as routers.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.default.send_redirects = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not allow interfaces to perform Internet Protocol version 4 (IPv4) ICMP redirects by default. - -Check the value of the "default send_redirects" variables with the following command: - -$ sudo sysctl net.ipv4.conf.default.send_redirects - -net.ipv4.conf.default.send_redirects=0 - -If the returned line does not have a value of "0", or a line is not returned, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv4.conf.default.send_redirects | tail -1 - -net.ipv4.conf.default.send_redirects = 0 - -If "net.ipv4.conf.default.send_redirects" is not set to "0" and is not documented with the information system security officer (ISSO) as an operational requirement or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-253075RHEL 9 must not enable IPv4 packet forwarding unless the system is a router.<VulnDiscussion>Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this capability is used when not required, system network information may be unnecessarily transmitted across the network.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not allow IPv4 packet forwarding, unless the system is a router. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv4.conf.all.forwarding = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is not performing IPv4 packet forwarding, unless the system is a router. - -Check that IPv4 forwarding is disabled using the following command: - -$ sudo sysctl net.ipv4.conf.all.forwarding - -net.ipv4.conf.all.forwarding = 0 - -If the IPv4 forwarding value is not "0" and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo (/usr/lib/systemd/systemd-sysctl --cat-config; cat /etc/sysctl.conf) | egrep -v '^(#|$)' | grep net.ipv4.conf.all.forwarding | tail -1 - -net.ipv4.conf.all.forwarding = 0 - -If "net.ipv4.conf.all.forwarding" is not set to "0" and is not documented with the ISSO as an operational requirement or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-254010RHEL 9 must not accept router advertisements on all IPv6 interfaces.<VulnDiscussion>An illicit router advertisement message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not accept router advertisements on all IPv6 interfaces unless the system is a router. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv6.conf.all.accept_ra = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not accept router advertisements on all IPv6 interfaces, unless the system is a router. - -Note: If IPv6 is disabled on the system, this requirement is Not Applicable. - -Determine if router advertisements are not accepted by using the following command: - -$ sudo sysctl net.ipv6.conf.all.accept_ra - -net.ipv6.conf.all.accept_ra = 0 - -If the "accept_ra" value is not "0" and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv6.conf.all.accept_ra | tail -1 - -net.ipv6.conf.all.accept_ra = 0 - -If "net.ipv6.conf.all.accept_ra" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-254015RHEL 9 must ignore IPv6 Internet Control Message Protocol (ICMP) redirect messages.<VulnDiscussion>An illicit ICMP redirect message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to ignore IPv6 ICMP redirect messages. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv6.conf.all.accept_redirects = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 ignores IPv6 ICMP redirect messages. - -Note: If IPv6 is disabled on the system, this requirement is Not Applicable. - -Check the value of the "accept_redirects" variables with the following command: - -$ sysctl net.ipv6.conf.all.accept_redirects - -net.ipv6.conf.all.accept_redirects = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv6.conf.all.accept_redirects | tail -1 - -net.ipv6.conf.all.accept_redirects = 0 - -If "net.ipv6.conf.all.accept_redirects" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-254020RHEL 9 must not forward IPv6 source-routed packets.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not forward IPv6 source-routed packets. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv6.conf.all.accept_source_route = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not accept IPv6 source-routed packets. - -Note: If IPv6 is disabled on the system, this requirement is Not Applicable. - -Check the value of the accept source route variable with the following command: - -$ sudo sysctl net.ipv6.conf.all.accept_source_route - -net.ipv6.conf.all.accept_source_route = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv6.conf.all.accept_source_route | tail -1 - -net.ipv6.conf.all.accept_source_route = 0 - -If "net.ipv6.conf.all.accept_source_route" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-254025RHEL 9 must not enable IPv6 packet forwarding unless the system is a router.<VulnDiscussion>IP forwarding permits the kernel to forward packets from one network interface to another. The ability to forward packets between two networks is only appropriate for systems acting as routers.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not allow IPv6 packet forwarding, unless the system is a router. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv6.conf.all.forwarding = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 is not performing IPv6 packet forwarding, unless the system is a router. - -Note: If IPv6 is disabled on the system, this requirement is Not Applicable. - -Check that IPv6 forwarding is disabled using the following commands: - -$ sudo sysctl net.ipv6.conf.all.forwarding - -net.ipv6.conf.all.forwarding = 0 - -If the IPv6 forwarding value is not "0" and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv6.conf.all.forwarding | tail -1 - -net.ipv6.conf.all.forwarding = 0 - -If "net.ipv6.conf.all.forwarding" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-254030RHEL 9 must not accept router advertisements on all IPv6 interfaces by default.<VulnDiscussion>An illicit router advertisement message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not accept router advertisements on all IPv6 interfaces by default unless the system is a router. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv6.conf.default.accept_ra = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not accept router advertisements on all IPv6 interfaces by default, unless the system is a router. - -Note: If IPv6 is disabled on the system, this requirement is Not Applicable. - -Determine if router advertisements are not accepted by default by using the following command: - -$ sudo sysctl net.ipv6.conf.default.accept_ra - -net.ipv6.conf.default.accept_ra = 0 - -If the "accept_ra" value is not "0" and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv6.conf.default.accept_ra | tail -1 - -net.ipv6.conf.default.accept_ra = 0 - -If "net.ipv6.conf.default.accept_ra" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-254035RHEL 9 must prevent IPv6 Internet Control Message Protocol (ICMP) redirect messages from being accepted.<VulnDiscussion>ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to prevent IPv6 ICMP redirect messages from being accepted. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv6.conf.default.accept_redirects = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 will not accept IPv6 ICMP redirect messages. - -Note: If IPv6 is disabled on the system, this requirement is Not Applicable. - -Check the value of the default "accept_redirects" variables with the following command: - -$ sudo sysctl net.ipv6.conf.default.accept_redirects - -net.ipv6.conf.default.accept_redirects = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv6.conf.default.accept_redirects | tail -1 - -net.ipv6.conf.default.accept_redirects = 0 - -If "net.ipv6.conf.default.accept_redirects" is not set to "0" or is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-254040RHEL 9 must not forward IPv6 source-routed packets by default.<VulnDiscussion>Source-routed packets allow the source of the packet to suggest that routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routed traffic, such as when forwarding is enabled and the system is functioning as a router. - -Accepting source-routed packets in the IPv6 protocol has few legitimate uses. It must be disabled unless it is absolutely required.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not forward IPv6 source-routed packets by default. - -Add or edit the following line in a single system configuration file, in the "/etc/sysctl.d/" directory: - -net.ipv6.conf.default.accept_source_route = 0 - -Load settings from all system configuration files with the following command: - -$ sudo sysctl --systemVerify RHEL 9 does not accept IPv6 source-routed packets by default. - -Note: If IPv6 is disabled on the system, this requirement is Not Applicable. - -Check the value of the accept source route variable with the following command: - -$ sudo sysctl net.ipv6.conf.default.accept_source_route - -net.ipv6.conf.default.accept_source_route = 0 - -If the returned line does not have a value of "0", a line is not returned, or the line is commented out, this is a finding. - -Check that the configuration files are present to enable this network parameter. - -$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F net.ipv6.conf.default.accept_source_route | tail -1 - -net.ipv6.conf.default.accept_source_route = 0 - -If "net.ipv6.conf.default.accept_source_route" is not set to "0" or is missing, this is a finding.SRG-OS-000423-GPOS-00187<GroupDescription></GroupDescription>RHEL-09-255010All RHEL 9 networked systems must have SSH installed.<VulnDiscussion>Without protection of the transmitted information, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read or altered. - -This requirement applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, and facsimile machines). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. - -Protecting the confidentiality and integrity of organizational information can be accomplished by physical means (e.g., employing physical distribution systems) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. - -Satisfies: SRG-OS-000423-GPOS-00187, SRG-OS-000424-GPOS-00188, SRG-OS-000425-GPOS-00189, SRG-OS-000426-GPOS-00190</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002418CCI-002420CCI-002421CCI-002422The openssh-server package can be installed with the following command: - -$ sudo dnf install openssh-serverVerify that RHEL 9 has the openssh-server package installed with the following command: - -$ sudo dnf list --installed openssh-server - -Example output: - -openssh-server.x86_64 8.7p1-8.el9 - -If the "openssh-server" package is not installed, this is a finding.SRG-OS-000423-GPOS-00187<GroupDescription></GroupDescription>RHEL-09-255015All RHEL 9 networked systems must have and implement SSH to protect the confidentiality and integrity of transmitted and received information, as well as information during preparation for transmission.<VulnDiscussion>Without protection of the transmitted information, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read or altered. - -This requirement applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, and facsimile machines). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. - -Protecting the confidentiality and integrity of organizational information can be accomplished by physical means (e.g., employing physical distribution systems) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. - -Satisfies: SRG-OS-000423-GPOS-00187, SRG-OS-000424-GPOS-00188, SRG-OS-000425-GPOS-00189, SRG-OS-000426-GPOS-00190</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002418CCI-002420CCI-002421CCI-002422To enable the sshd service run the following command: - -$ systemctl enable --now sshdVerify that "sshd" is active with the following command: - -$ systemctl is-active sshd - -active - -If the "sshd" service is not active, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255020RHEL 9 must have the openssh-clients package installed.<VulnDiscussion>This package includes utilities to make encrypted connections and transfer files securely to SSH servers.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366The openssh-clients package can be installed with the following command: - -$ sudo dnf install openssh-clientsVerify that RHEL 9 has the openssh-clients package installed with the following command: - -$ sudo dnf list --installed openssh-clients - -Example output: - -openssh-clients.x86_64 8.7p1-8.el9 - -If the "openssh-clients" package is not installed, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-09-255025RHEL 9 must display the Standard Mandatory DOD Notice and Consent Banner before granting local or remote access to the system via a SSH logon.<VulnDiscussion>The warning message reinforces policy awareness during the logon process and facilitates possible legal action against attackers. Alternatively, systems whose ownership should not be obvious should ensure usage of a banner that does not provide easy attribution. - -Satisfies: SRG-OS-000023-GPOS-00006, SRG-OS-000228-GPOS-00088</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000048CCI-001384CCI-001385CCI-001386CCI-001387CCI-001388Configure RHEL 9 to display the Standard Mandatory DOD Notice and Consent Banner before granting access to the system via ssh. - -Edit the "/etc/ssh/sshd_config" file to uncomment the banner keyword and configure it to point to a file that will contain the logon banner (this file may be named differently or be in a different location if using a version of SSH that is provided by a third-party vendor). - -An example configuration line is: - -Banner /etc/issueVerify any SSH connection to the operating system displays the Standard Mandatory DOD Notice and Consent Banner before granting access to the system. - -Check for the location of the banner file being used with the following command: - -$ sudo grep -ir banner /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -banner /etc/issue - -This command will return the banner keyword and the name of the file that contains the SSH banner (in this case "/etc/issue"). - -If the line is commented out, this is a finding.SRG-OS-000032-GPOS-00013<GroupDescription></GroupDescription>RHEL-09-255030RHEL 9 must log SSH connection attempts and failures to the server.<VulnDiscussion>SSH provides several logging levels with varying amounts of verbosity. "DEBUG" is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. "INFO" or "VERBOSE" level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000067Configure RHEL 9 to log connection attempts add or modify the following line in "/etc/ssh/sshd_config". - -LogLevel VERBOSE - -Restart the SSH daemon for the settings to take effect: - -$ sudo systemctl restart sshd.serviceVerify RHEL 9 logs SSH connection attempts and failures to the server. - -Check what the SSH daemon's "LogLevel" option is set to with the following command: - -$ sudo grep -ir LogLevel /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -LogLevel VERBOSE - -If a value of "VERBOSE" is not returned, the line is commented out, or is missing, this is a finding.SRG-OS-000105-GPOS-00052<GroupDescription></GroupDescription>RHEL-09-255035RHEL 9 SSHD must accept public key authentication.<VulnDiscussion>Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. A DOD CAC with DOD-approved PKI is an example of multifactor authentication. - -Satisfies: SRG-OS-000105-GPOS-00052, SRG-OS-000106-GPOS-00053, SRG-OS-000107-GPOS-00054, SRG-OS-000108-GPOS-00055</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000765CCI-000766CCI-000767CCI-000768To configure the system add or modify the following line in "/etc/ssh/sshd_config". - -PubkeyAuthentication yes - -Restart the SSH daemon for the settings to take effect: - -$ sudo systemctl restart sshd.serviceVerify that RHEL 9 SSH daemon accepts public key encryption with the following command: - -$ sudo grep -ir PubkeyAuthentication /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -PubkeyAuthentication yes - -If "PubkeyAuthentication" is set to no, the line is commented out, or the line is missing, this is a finding.SRG-OS-000106-GPOS-00053<GroupDescription></GroupDescription>RHEL-09-255040RHEL 9 SSHD must not allow blank passwords.<VulnDiscussion>If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments. - -Satisfies: SRG-OS-000106-GPOS-00053, SRG-OS-000480-GPOS-00229, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000766To configure the system to prevent SSH users from logging on with blank passwords edit the following line in "etc/ssh/sshd_config": - -PermitEmptyPasswords no - -Restart the SSH daemon for the settings to take effect: - -$ sudo systemctl restart sshd.serviceVerify RHEL 9 remote access using SSH prevents logging on with a blank password with the following command: - -$ sudo grep -ir PermitEmptyPasswords /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -PermitEmptyPassword no - -If the "PermitEmptyPassword" keyword is set to "yes", is missing, or is commented out, this is a finding.SRG-OS-000109-GPOS-00056<GroupDescription></GroupDescription>RHEL-09-255045RHEL 9 must not permit direct logons to the root account using remote access via SSH.<VulnDiscussion>Even though the communications channel may be encrypted, an additional layer of security is gained by extending the policy of not logging directly on as root. In addition, logging in with a user-specific account provides individual accountability of actions performed on the system and also helps to minimize direct attack attempts on root's password. - -Satisfies: SRG-OS-000109-GPOS-00056, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000770To configure the system to prevent SSH users from logging on directly as root add or modify the following line in "/etc/ssh/sshd_config". - - PermitRootLogin no - -Restart the SSH daemon for the settings to take effect: - -$ sudo systemctl restart sshd.serviceVerify RHEL 9 remote access using SSH prevents users from logging on directly as "root" with the following command: - -$ sudo grep -ir PermitRootLogin /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -PermitRootLogin no - -If the "PermitRootLogin" keyword is set to "yes", is missing, or is commented out, this is a finding.SRG-OS-000125-GPOS-00065<GroupDescription></GroupDescription>RHEL-09-255050RHEL 9 must enable the Pluggable Authentication Module (PAM) interface for SSHD.<VulnDiscussion>When UsePAM is set to "yes", PAM runs through account and session types properly. This is important when restricted access to services based off of IP, time, or other factors of the account is needed. Additionally, this ensures users can inherit certain environment variables on login or disallow access to the server.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000877Configure the RHEL 9 SSHD to use the UsePAM interface add or modify the following line in "/etc/ssh/sshd_config". - -UsePAM yes - -Restart the SSH daemon for the settings to take effect: - -$ sudo systemctl restart sshd.serviceVerify the RHEL 9 SSHD is configured to allow for the UsePAM interface with the following command: - -$ sudo grep -ir usepam /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -UsePAM yes - -If the "UsePAM" keyword is set to "no", is missing, or is commented out, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-255055RHEL 9 SSH daemon must be configured to use system-wide crypto policies.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Remote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453Configure the RHEL 9 SSH daemon to use system-wide crypto policies by running the following commands: - -$ sudo dnf reinstall openssh-serverVerify that system-wide crypto policies are in effect with the following command: - -$ sudo grep Include /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -/etc/ssh/sshd_config:Include /etc/ssh/sshd_config.d/*.conf -/etc/ssh/sshd_config.d/50-redhat.conf:Include /etc/crypto-policies/back-ends/opensshserver.config - -If "Include /etc/ssh/sshd_config.d/*.conf" or "Include /etc/crypto-policies/back-ends/opensshserver.config" are not included in the system sshd config or the file /etc/ssh/sshd_config.d/50-redhat.conf is missing, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-255060RHEL 9 must implement DOD-approved encryption ciphers to protect the confidentiality of SSH client connections.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Remote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -RHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453Configure the RHEL 9 SSH daemon to use system-wide crypto policies by running the following commands: - -$ sudo dnf reinstall openssh-clientsVerify that system-wide crypto policies are in effect with the following command: - -$ sudo grep Include /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -/etc/ssh/sshd_config:Include /etc/ssh/sshd_config.d/*.conf -/etc/ssh/sshd_config.d/50-redhat.conf:Include /etc/crypto-policies/back-ends/opensshserver.config - -If "Include /etc/ssh/sshd_config.d/*.conf" or "Include /etc/crypto-policies/back-ends/opensshserver.config" are not included in the system sshd config or the file "/etc/ssh/sshd_config.d/50-redhat.conf" is missing, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-255065RHEL 9 must implement DOD-approved encryption ciphers to protect the confidentiality of SSH server connections.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Remote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -RHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453Configure the RHEL 9 SSH client to use only ciphers employing FIPS 140-3 approved algorithms by updating the "/etc/crypto-policies/back-ends/openssh.config" file with the following line: - -Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr - -A reboot is required for the changes to take effect.Verify the SSH client is configured to use only ciphers employing FIPS 140-3 approved algorithms with the following command: - -$ sudo grep -i ciphers /etc/crypto-policies/back-ends/openssh.config - -Ciphers aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr - -If the cipher entries in the "openssh.config" file have any ciphers other than "aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr", the order differs from the example above, they are missing, or commented out, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-255070RHEL 9 SSH client must be configured to use only Message Authentication Codes (MACs) employing FIPS 140-3 validated cryptographic hash algorithms.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Remote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -RHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453Configure the RHEL 9 SSH client to use only MACs employing FIPS 140-3 approved algorithms by updating the "/etc/crypto-policies/back-ends/openssh.config" file with the following line: - -MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-512,hmac-sha2-256-etm@openssh.com,hmac-sha2-256 - -A reboot is required for the changes to take effect.Verify SSH client is configured to use only ciphers employing FIPS 140-3 approved algorithms with the following command: - -$ sudo grep -i macs /etc/crypto-policies/back-ends/openssh.config -MACs hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512 - -If the MACs entries in the "openssh.config" file have any hashes other than "hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512", the order differs from the example above, they are missing, or commented out, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-255075RHEL 9 SSH server must be configured to use only Message Authentication Codes (MACs) employing FIPS 140-3 validated cryptographic hash algorithms.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Remote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -RHEL 9 incorporates system-wide crypto policies by default. The SSH configuration file has no effect on the ciphers, MACs, or algorithms unless specifically defined in the /etc/sysconfig/sshd file. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/opensshserver.config file.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453Configure the RHEL 9 SSH client to use only MACs employing FIPS 140-3 approved algorithms by updating the "/etc/crypto-policies/back-ends/openssh.config" file with the following line: - -MACs hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 - -A reboot is required for the changes to take effect.Verify SSH client is configured to use only ciphers employing FIPS 140-3 approved algorithms with the following command: - -$ sudo grep -i macs /etc/crypto-policies/back-ends/openssh.config -MACs hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512 - -If the MACs entries in the "openssh.config" file have any hashes other than "hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512", the order differs from the example above, they are missing, or commented out, this is a finding.SRG-OS-000480-GPOS-00229<GroupDescription></GroupDescription>RHEL-09-255080RHEL 9 must not allow a noncertificate trusted host SSH logon to the system.<VulnDiscussion>SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366To configure RHEL 9 to not allow a noncertificate trusted host SSH logon to the system add or modify the following line in "/etc/ssh/sshd_config". - -HostbasedAuthentication no - -Restart the SSH daemon for the settings to take effect: - -$ sudo systemctl restart sshd.serviceVerify the operating system does not allow a noncertificate trusted host SSH logon to the system with the following command: - -$ sudo grep -ir hostbasedauthentication /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -HostbasedAuthentication no - -If the "HostbasedAuthentication" keyword is not set to "no", is missing, or is commented out, this is a finding. - -If the required value is not set, this is a finding.SRG-OS-000480-GPOS-00229<GroupDescription></GroupDescription>RHEL-09-255085RHEL 9 must not allow users to override SSH environment variables.<VulnDiscussion>SSH environment options potentially allow users to bypass access restriction in some configurations.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the RHEL 9 SSH daemon to not allow unattended or automatic logon to the system. - -Add or edit the following line in the "/etc/ssh/sshd_config" file: - -PermitUserEnvironment no - -Restart the SSH daemon for the setting to take effect: - -$ sudo systemctl restart sshd.serviceVerify that unattended or automatic logon via SSH is disabled with the following command: - -$ sudo grep -ir permituserenvironment /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -PermitUserEnvironment no - -If "PermitUserEnvironment" is set to "yes", is missing completely, or is commented out, this is a finding. - -If the required value is not set, this is a finding.SRG-OS-000423-GPOS-00187<GroupDescription></GroupDescription>RHEL-09-255090RHEL 9 must force a frequent session key renegotiation for SSH connections to the server.<VulnDiscussion>Without protection of the transmitted information, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read or altered. - -This requirement applies to both internal and external networks and all types of information system components from which information can be transmitted (e.g., servers, mobile devices, notebook computers, printers, copiers, scanners, and facsimile machines). Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. - -Protecting the confidentiality and integrity of organizational information can be accomplished by physical means (e.g., employing physical distribution systems) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. - -Session key regeneration limits the chances of a session key becoming compromised. - -Satisfies: SRG-OS-000423-GPOS-00187, SRG-OS-000033-GPOS-00014, SRG-OS-000424-GPOS-00188</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000068CCI-002418CCI-002421Configure RHEL 9 to force a frequent session key renegotiation for SSH connections to the server by adding or modifying the following line in the "/etc/ssh/sshd_config" file: - -RekeyLimit 1G 1h - -Restart the SSH daemon for the settings to take effect. - -$ sudo systemctl restart sshd.serviceVerify the SSH server is configured to force frequent session key renegotiation with the following command: - -$ sudo grep -ir rekeyLimit /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -RekeyLimit 1G 1h - -If "RekeyLimit" does not have a maximum data amount and maximum time defined, is missing or commented out, this is a finding.SRG-OS-000163-GPOS-00072<GroupDescription></GroupDescription>RHEL-09-255095RHEL 9 must be configured so that all network connections associated with SSH traffic terminate after becoming unresponsive.<VulnDiscussion>Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. - -Terminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session. - -RHEL 9 utilizes /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of "ClientAliveInterval" and "ClientAliveCountMax" are used to establish the inactivity threshold. The "ClientAliveInterval" is a timeout interval in seconds, after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The "ClientAliveCountMax" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages. - -Satisfies: SRG-OS-000163-GPOS-00072, SRG-OS-000279-GPOS-00109</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001133CCI-002361Note: This setting must be applied in conjunction with RHEL-09-255100 to function correctly. - -Configure the SSH server to terminate a user session automatically after the SSH client has become unresponsive. - -Modify or append the following lines in the "/etc/ssh/sshd_config" file: - -ClientAliveCountMax 1 - -In order for the changes to take effect, the SSH daemon must be restarted. - -$ sudo systemctl restart sshd.serviceVerify that the "ClientAliveCountMax" is set to "1" by performing the following command: - -$ sudo grep -i countmax /etc/ssh/sshd_config - -ClientAliveCountMax 1 - -If "ClientAliveCountMax" do not exist, is not set to a value of "1" in "/etc/ssh/sshd_config", or is commented out, this is a finding.SRG-OS-000126-GPOS-00066<GroupDescription></GroupDescription>RHEL-09-255100RHEL 9 must be configured so that all network connections associated with SSH traffic are terminated after 10 minutes of becoming unresponsive.<VulnDiscussion>Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. - -Terminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session. - -RHEL 9 utilizes /etc/ssh/sshd_config for configurations of OpenSSH. Within the sshd_config, the product of the values of "ClientAliveInterval" and "ClientAliveCountMax" are used to establish the inactivity threshold. The "ClientAliveInterval" is a timeout interval in seconds, after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The "ClientAliveCountMax" is the number of client alive messages that may be sent without sshd receiving any messages back from the client. If this threshold is met, sshd will disconnect the client. For more information on these settings and others, refer to the sshd_config man pages. - -Satisfies: SRG-OS-000126-GPOS-00066, SRG-OS-000163-GPOS-00072, SRG-OS-000279-GPOS-00109, SRG-OS-000395-GPOS-00175</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000879CCI-001133CCI-002361CCI-002891Note: This setting must be applied in conjunction with RHEL-09-255095 to function correctly. - -Configure the SSH server to terminate a user session automatically after the SSH client has been unresponsive for 10 minutes. - -Modify or append the following lines in the "/etc/ssh/sshd_config" file: - -ClientAliveInterval 600 - -In order for the changes to take effect, the SSH daemon must be restarted. - -$ sudo systemctl restart sshd.serviceVerify that the "ClientAliveInterval" variable is set to a value of "600" or less by performing the following command: - -$ sudo grep -ir interval /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -ClientAliveInterval 600 - -If "ClientAliveInterval" does not exist, does not have a value of "600" or less in "/etc/ssh/sshd_config", or is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255105RHEL 9 SSH server configuration file must be group-owned by root.<VulnDiscussion>Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "/etc/ssh/sshd_config" file to be group-owned by root with the following command: - -$ sudo chgrp root /etc/ssh/sshd_configVerify the group ownership of the "/etc/ssh/sshd_config" file with the following command: - -$ ls -al /etc/ssh/sshd_config - -rw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config - -If the "/etc/ssh/sshd_config" file does not have a group owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255110RHEL 9 SSH server configuration file must be owned by root.<VulnDiscussion>Service configuration files enable or disable features of their respective services, which if configured incorrectly, can lead to insecure and vulnerable configurations. Therefore, service configuration files must be owned by the correct group to prevent unauthorized changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "/etc/ssh/sshd_config" file to be owned by root with the following command: - -$ sudo chown root /etc/ssh/sshd_configVerify the ownership of the "/etc/ssh/sshd_config" file with the following command: - -$ ls -al /etc/ssh/sshd_config - -rw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config - -If the "/etc/ssh/sshd_config" file does not have an owner of "root", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255115RHEL 9 SSH server configuration file must have mode 0600 or less permissive.<VulnDiscussion>Service configuration files enable or disable features of their respective services that if configured incorrectly can lead to insecure and vulnerable configurations. Therefore, service configuration files should be owned by the correct group to prevent unauthorized changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the "/etc/ssh/sshd_config" permissions to be "0600" with the following command: - -$ sudo chmod 0600 /etc/ssh/sshd_configVerify the permissions of the "/etc/ssh/sshd_config" file with the following command: - -$ ls -al /etc/ssh/sshd_config - -rw-------. 1 root root 3669 Feb 22 11:34 /etc/ssh/sshd_config - -If the "/etc/ssh/sshd_config" permissions are not "0600", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255120RHEL 9 SSH private host key files must have mode 0640 or less permissive.<VulnDiscussion>If an unauthorized user obtains the private SSH host key file, the host could be impersonated.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the mode of SSH private host key files under "/etc/ssh" to "0640" with the following command: - -$ sudo chmod 0640 /etc/ssh/ssh_host*key - -Restart the SSH daemon for the changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH private host key files have a mode of "0640" or less permissive with the following command: - -$ ls -l /etc/ssh/*_key - -640 /etc/ssh/ssh_host_dsa_key -640 /etc/ssh/ssh_host_ecdsa_key -640 /etc/ssh/ssh_host_ed25519_key -640 /etc/ssh/ssh_host_rsa_key - -If any private host key file has a mode more permissive than "0640", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255125RHEL 9 SSH public host key files must have mode 0644 or less permissive.<VulnDiscussion>If a public host key file is modified by an unauthorized user, the SSH service may be compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the mode of public host key files under "/etc/ssh" to "0644" with the following command: - -$ sudo chmod 0644 /etc/ssh/*key.pub - -Restart the SSH daemon for the changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH public host key files have a mode of "0644" or less permissive with the following command: - -Note: SSH public key files may be found in other directories on the system depending on the installation. - -$ sudo stat -c "%a %n" /etc/ssh/*.pub - -644 /etc/ssh/ssh_host_dsa_key.pub -644 /etc/ssh/ssh_host_ecdsa_key.pub -644 /etc/ssh/ssh_host_ed25519_key.pub -644 /etc/ssh/ssh_host_rsa_key.pub - -If any key.pub file has a mode more permissive than "0644", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255130RHEL 9 SSH daemon must not allow compression or must only allow compression after successful authentication.<VulnDiscussion>If compression is allowed in an SSH connection prior to authentication, vulnerabilities in the compression software could result in compromise of the system from an unauthenticated connection, potentially with root privileges.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to not allow compression. - -Uncomment the "Compression" keyword in "/etc/ssh/sshd_config" on the system and set the value to "delayed" or "no": - -Compression no - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon performs compression after a user successfully authenticates with the following command: - -$ sudo grep -ir compression /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -Compression delayed - -If the "Compression" keyword is set to "yes", is missing, or the returned line is commented out, this is a finding.SRG-OS-000364-GPOS-00151<GroupDescription></GroupDescription>RHEL-09-255135RHEL 9 SSH daemon must not allow GSSAPI authentication.<VulnDiscussion>Generic Security Service Application Program Interface (GSSAPI) authentication is used to provide additional authentication mechanisms to applications. Allowing GSSAPI authentication through SSH exposes the system's GSSAPI to remote hosts, increasing the attack surface of the system. - -Satisfies: SRG-OS-000364-GPOS-00151, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001813Configure the SSH daemon to not allow GSSAPI authentication. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "no": - -GSSAPIAuthentication no - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon does not allow GSSAPI authentication with the following command: - -$ sudo grep -ir gssapiauth /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -GSSAPIAuthentication no - -If the value is returned as "yes", the returned line is commented out, no output is returned, and the use of GSSAPI authentication has not been documented with the information system security officer (ISSO), this is a finding. - -If the required value is not set, this is a finding.SRG-OS-000364-GPOS-00151<GroupDescription></GroupDescription>RHEL-09-255140RHEL 9 SSH daemon must not allow Kerberos authentication.<VulnDiscussion>Kerberos authentication for SSH is often implemented using Generic Security Service Application Program Interface (GSSAPI). If Kerberos is enabled through SSH, the SSH daemon provides a means of access to the system's Kerberos implementation. Vulnerabilities in the system's Kerberos implementations may be subject to exploitation. - -Satisfies: SRG-OS-000364-GPOS-00151, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001813Configure the SSH daemon to not allow Kerberos authentication. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "no": - -KerberosAuthentication no - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon does not allow Kerberos authentication with the following command: - -$ sudo grep -i kerberosauth /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -KerberosAuthentication no - -If the value is returned as "yes", the returned line is commented out, no output is returned, and the use of Kerberos authentication has not been documented with the information system security officer (ISSO), this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255145RHEL 9 SSH daemon must not allow rhosts authentication.<VulnDiscussion>SSH trust relationships mean a compromise on one host can allow an attacker to move trivially to other hosts.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to not allow rhosts authentication. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "yes": - -IgnoreRhosts yes - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon does not allow rhosts authentication with the following command: - -$ sudo grep -ir ignorerhosts /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -IgnoreRhosts yes - -If the value is returned as "no", the returned line is commented out, or no output is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255150RHEL 9 SSH daemon must not allow known hosts authentication.<VulnDiscussion>Configuring the IgnoreUserKnownHosts setting for the SSH daemon provides additional assurance that remote login via SSH will require a password, even in the event of misconfiguration elsewhere.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to not allow known hosts authentication. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "yes": - -IgnoreUserKnownHosts yes - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon does not allow known hosts authentication with the following command: - -$ sudo grep -ir ignoreuser /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -IgnoreUserKnownHosts yes - -If the value is returned as "no", the returned line is commented out, or no output is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255155RHEL 9 SSH daemon must disable remote X connections for interactive users.<VulnDiscussion>When X11 forwarding is enabled, there may be additional exposure to the server and client displays if the sshd proxy display is configured to listen on the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the DISPLAY environment variable to localhost. This prevents remote hosts from connecting to the proxy display.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to not allow X11 forwarding. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "no": - -X11forwarding no - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon does not allow X11Forwarding with the following command: - -$ sudo grep -ir x11for /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -X11forwarding no - -If the value is returned as "yes", the returned line is commented out, or no output is returned, and X11 forwarding is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255160RHEL 9 SSH daemon must perform strict mode checking of home directory configuration files.<VulnDiscussion>If other users have access to modify user-specific SSH configuration files, they may be able to log into the system as another user.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to perform strict mode checking of home directory configuration files. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "yes": - -StrictModes yes - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon performs strict mode checking of home directory configuration files with the following command: - -$ sudo grep -ir strictmodes /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -StrictModes yes - -If the "StrictModes" keyword is set to "no", the returned line is commented out, or no output is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255165RHEL 9 SSH daemon must display the date and time of the last successful account logon upon an SSH logon.<VulnDiscussion>Providing users feedback on when account accesses last occurred facilitates user recognition and reporting of unauthorized account use.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to provide users with feedback on when account accesses last occurred. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "yes": - -PrintLastLog yes - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon provides users with feedback on when account accesses last occurred with the following command: - -$ sudo grep -ir printlast /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -PrintLastLog yes - -If the "PrintLastLog" keyword is set to "no", the returned line is commented out, or no output is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255170RHEL 9 SSH daemon must be configured to use privilege separation.<VulnDiscussion>SSH daemon privilege separation causes the SSH process to drop root privileges when not needed, which would decrease the impact of software vulnerabilities in the nonprivileged section.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to perform privilege separation. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "yes" or "sandbox": - -UsePrivilegeSeparation sandbox - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon performs privilege separation with the following command: - -$ sudo grep -ir usepriv /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -UsePrivilegeSeparation sandbox - -If the "UsePrivilegeSeparation" keyword is set to "no", the returned line is commented out, or no output is returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-255175RHEL 9 SSH daemon must prevent remote hosts from connecting to the proxy display.<VulnDiscussion>When X11 forwarding is enabled, there may be additional exposure to the server and client displays if the sshd proxy display is configured to listen on the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the "DISPLAY" environment variable to localhost. This prevents remote hosts from connecting to the proxy display.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the SSH daemon to prevent remote hosts from connecting to the proxy display. - -Add the following line in "/etc/ssh/sshd_config", or uncomment the line and set the value to "yes": - -X11UseLocalhost yes - -The SSH service must be restarted for changes to take effect: - -$ sudo systemctl restart sshd.serviceVerify the SSH daemon prevents remote hosts from connecting to the proxy display with the following command: - -$ sudo grep -ir x11uselocal /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* - -X11UseLocalhost yes - -If the "X11UseLocalhost" keyword is set to "no", is missing, or is commented out, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-09-271010RHEL 9 must display the Standard Mandatory DOD Notice and Consent Banner before granting local or remote access to the system via a graphical user logon.<VulnDiscussion>Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. - -For U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist. - -Satisfies: SRG-OS-000023-GPOS-00006, SRG-OS-000228-GPOS-00088</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000048CCI-001384CCI-001385CCI-001386CCI-001387CCI-001388Configure RHEL 9 to display the Standard Mandatory DOD Notice and Consent Banner before granting access to the system via a graphical user logon. - -Create a database to contain the system-wide graphical user logon settings (if it does not already exist) with the following command: - -$ sudo touch /etc/dconf/db/local.d/01-banner-message - -Add the following lines to the [org/gnome/login-screen] section of the "/etc/dconf/db/local.d/01-banner-message": - -[org/gnome/login-screen] - -banner-message-enable=true - -Run the following command to update the database: - -$ sudo dconf updateVerify RHEL 9 displays a banner before granting access to the operating system via a graphical user logon. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine if the operating system displays a banner at the logon screen with the following command: - -$ sudo grep banner-message-enable /etc/dconf/db/local.d/* - -banner-message-enable=true - -If "banner-message-enable" is set to "false", is commented out, or is missing, this is a finding.SRG-OS-000023-GPOS-00006<GroupDescription></GroupDescription>RHEL-09-271015RHEL 9 must prevent a user from overriding the banner-message-enable setting for the graphical user interface.<VulnDiscussion>Display of a standardized and approved use notification before granting access to the operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. - -For U.S. Government systems, system use notifications are required only for access via login interfaces with human users and are not required when such human interfaces do not exist. - -Satisfies: SRG-OS-000023-GPOS-00006, SRG-OS-000228-GPOS-00088</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000048CCI-001384CCI-001385CCI-001386CCI-001387CCI-001388Configure RHEL 9 to prevent a user from overriding the banner setting for graphical user interfaces. - -Create a database to contain the system-wide graphical user logon settings (if it does not already exist) with the following command: - -$ sudo touch /etc/dconf/db/local.d/locks/session - -Add the following setting to prevent nonprivileged users from modifying it: - -banner-message-enable - -Run the following command to update the database: - -$ sudo dconf updateVerify RHEL 9 prevents a user from overriding settings for graphical user interfaces. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that graphical settings are locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ sudo grep banner-message-enable /etc/dconf/db/local.d/* - -/org/gnome/login-screen/banner-message-enable - -If the output is not "/org/gnome/login-screen/banner-message-enable", the line is commented out, or the line is missing, this is a finding.SRG-OS-000114-GPOS-00059<GroupDescription></GroupDescription>RHEL-09-271020RHEL 9 must disable the graphical user interface automount function unless required.<VulnDiscussion>Automatically mounting file systems permits easy introduction of unknown devices, thereby facilitating malicious activity. - -Satisfies: SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000778CCI-001958Configure the GNOME desktop to disable automated mounting of removable media. - -The dconf settings can be edited in the /etc/dconf/db/* location. - -Update the [org/gnome/desktop/media-handling] section of the "/etc/dconf/db/local.d/00-security-settings" database file and add or update the following lines: - -[org/gnome/desktop/media-handling] -automount-open=false - -Then update the dconf system databases: - -$ sudo dconf updateVerify RHEL 9 disables the graphical user interface automount function with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ gsettings get org.gnome.desktop.media-handling automount-open - -false - -If "automount-open" is set to "true", and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000114-GPOS-00059<GroupDescription></GroupDescription>RHEL-09-271025RHEL 9 must prevent a user from overriding the disabling of the graphical user interface automount function.<VulnDiscussion>A nonprivileged account is any operating system account with authorizations of a nonprivileged user. - -Satisfies: SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000778CCI-001958Configure the GNOME desktop to not allow a user to change the setting that disables automated mounting of removable media. - -Add the following line to "/etc/dconf/db/local.d/locks/00-security-settings-lock" to prevent user modification: - -/org/gnome/desktop/media-handling/automount-open - -Then update the dconf system databases: - -$ sudo dconf updateVerify RHEL 9 disables ability of the user to override the graphical user interface automount setting. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that the automount setting is locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ grep 'automount-open' /etc/dconf/db/local.d/locks/* - -/org/gnome/desktop/media-handling/automount-open - -If the command does not return at least the example result, this is a finding.SRG-OS-000368-GPOS-00154<GroupDescription></GroupDescription>RHEL-09-271030RHEL 9 must disable the graphical user interface autorun function unless required.<VulnDiscussion>Allowing autorun commands to execute may introduce malicious code to a system. Configuring this setting prevents autorun commands from executing.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764Configure the GNOME desktop to disable the autorun function on removable media. - -The dconf settings can be edited in the /etc/dconf/db/* location. - -Update the [org/gnome/desktop/media-handling] section of the "/etc/dconf/db/local.d/00-security-settings" database file and add or update the following lines: - -[org/gnome/desktop/media-handling] -autorun-never=true - -Then update the dconf system databases: - -$ sudo dconf updateVerify RHEL 9 disables the graphical user interface autorun function with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ gsettings get org.gnome.desktop.media-handling autorun-never - -true - -If "autorun-never" is set to "false", and is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000114-GPOS-00059<GroupDescription></GroupDescription>RHEL-09-271035RHEL 9 must prevent a user from overriding the disabling of the graphical user interface autorun function.<VulnDiscussion>Techniques used to address this include protocols using nonces (e.g., numbers generated for a specific one-time use) or challenges (e.g., TLS, WS_Security). Additional techniques include time-synchronous or challenge-response one-time authenticators. - -Satisfies: SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000778CCI-001958Configure the GNOME desktop to not allow a user to change the setting that disables autorun on removable media. - -Add the following line to "/etc/dconf/db/local.d/locks/00-security-settings-lock" to prevent user modification: - -/org/gnome/desktop/media-handling/autorun-never - -Then update the dconf system databases: - -$ sudo dconf updateVerify RHEL 9 disables ability of the user to override the graphical user interface autorun setting. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that the automount setting is locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ grep 'autorun-never' /etc/dconf/db/local.d/locks/* - -/org/gnome/desktop/media-handling/autorun-never - -If the command does not return at least the example result, this is a finding.SRG-OS-000480-GPOS-00229<GroupDescription></GroupDescription>RHEL-09-271040RHEL 9 must not allow unattended or automatic logon via the graphical user interface.<VulnDiscussion>Failure to restrict system access to authenticated users negatively impacts operating system security.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the GNOME desktop display manager to disable automatic login. - -Set AutomaticLoginEnable to false in the [daemon] section in /etc/gdm/custom.conf. For example: - -[daemon] -AutomaticLoginEnable=falseVerify RHEL 9 does not allow an unattended or automatic logon to the system via a graphical user interface. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Check for the value of the "AutomaticLoginEnable" in the "/etc/gdm/custom.conf" file with the following command: - -$ grep -i automaticlogin /etc/gdm/custom.conf - -[daemon] -AutomaticLoginEnable=false - -If the value of "AutomaticLoginEnable" is not set to "false", this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-09-271045RHEL 9 must be able to initiate directly a session lock for all connection types using smart card when the smart card is removed.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. - -The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. - -Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056CCI-000058Configure RHEL 9 to enable a user's session lock until that user re-establishes access using established identification and authentication procedures. - -Select or create an authselect profile and incorporate the "with-smartcard-lock-on-removal" feature with the following example: - -$ sudo authselect select sssd with-smartcard with-smartcard-lock-on-removal - -Alternatively, the dconf settings can be edited in the /etc/dconf/db/* location. - -Add or update the [org/gnome/settings-daemon/peripherals/smartcard] section of the /etc/dconf/db/local.d/00-security-settings" database file and add or update the following lines: - -[org/gnome/settings-daemon/peripherals/smartcard] -removal-action='lock-screen' - -Then update the dconf system databases: - -$ sudo dconf updateVerify RHEL 9 enables a user's session lock until that user re-establishes access using established identification and authentication procedures with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ grep -R removal-action /etc/dconf/db/* - -/etc/dconf/db/distro.d/20-authselect:removal-action='lock-screen' - -If the "removal-action='lock-screen'" setting is missing or commented out from the dconf database files, this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-09-271050RHEL 9 must prevent a user from overriding the disabling of the graphical user smart card removal action.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. - -The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 needs to provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. - -Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056CCI-000058Add the following line to "/etc/dconf/db/local.d/locks/00-security-settings-lock" to prevent user override of the smart card removal action: - -/org/gnome/settings-daemon/peripherals/smartcard/removal-action - -Then update the dconf system databases: - -$ sudo dconf updateVerify RHEL 9 disables ability of the user to override the smart card removal action setting. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that the removal action setting is locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ grep 'removal-action' /etc/dconf/db/local.d/locks/* - -/org/gnome/settings-daemon/peripherals/smartcard/removal-action - -If the command does not return at least the example result, this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-09-271055RHEL 9 must enable a user session lock until that user re-establishes access using established identification and authentication procedures for graphical user sessions.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. - -The session lock is implemented at the point where session activity can be determined. - -Regardless of where the session lock is determined and implemented, once invoked, the session lock must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system. - -Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056CCI-000058Configure RHEL 9 to enable a user's session lock until that user re-establishes access using established identification and authentication procedures. - -Create a database to contain the system-wide screensaver settings (if it does not already exist) with the following example: - -$ sudo vi /etc/dconf/db/local.d/00-screensaver - -Edit the "[org/gnome/desktop/screensaver]" section of the database file and add or update the following lines: - -# Set this to true to lock the screen when the screensaver activates -lock-enabled=true - -Update the system databases: - -$ sudo dconf updateVerify RHEL 9 enables a user's session lock until that user re-establishes access using established identification and authentication procedures with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ gsettings get org.gnome.desktop.screensaver lock-enabled - -true - -If the setting is "false", this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-09-271060RHEL 9 must prevent a user from overriding the screensaver lock-enabled setting for the graphical user interface.<VulnDiscussion>A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not log out because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, operating systems need to be able to identify when a user's session has idled and take action to initiate the session lock. - -The session lock is implemented at the point where session activity can be determined and/or controlled. - -Implementing session settings will have little value if a user is able to manipulate these settings from the defaults prescribed in the other requirements of this implementation guide. - -Satisfies: SRG-OS-000028-GPOS-00009, SRG-OS-000030-GPOS-00011</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056CCI-000058Configure RHEL 9 to prevent a user from overriding settings for graphical user interfaces. - -Create a database to contain the system-wide screensaver settings (if it does not already exist) with the following command: - -Note: The example below is using the database "local" for the system, so if the system is using another database in "/etc/dconf/profile/user", the file should be created under the appropriate subdirectory. - -$ sudo touch /etc/dconf/db/local.d/locks/session - -Add the following setting to prevent nonprivileged users from modifying it: - -/org/gnome/desktop/screensaver/lock-enabledVerify RHEL 9 prevents a user from overriding settings for graphical user interfaces. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, Gnome Shell. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that graphical settings are locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ sudo grep -i lock-enabled /etc/dconf/db/local.d/locks/* - -/org/gnome/desktop/screensaver/lock-enabled - -If the command does not return at least the example result, this is a finding.SRG-OS-000029-GPOS-00010<GroupDescription></GroupDescription>RHEL-09-271065RHEL 9 must automatically lock graphical user sessions after 15 minutes of inactivity.<VulnDiscussion>A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, the GNOME desktop can be configured to identify when a user's session has idled and take action to initiate a session lock. - -Satisfies: SRG-OS-000029-GPOS-00010, SRG-OS-000031-GPOS-00012</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000057CCI-000060Configure RHEL 9 to initiate a screensaver after a 15-minute period of inactivity for graphical user interfaces. - -Create a database to contain the system-wide screensaver settings (if it does not already exist) with the following command: - -$ sudo touch /etc/dconf/db/local.d/00-screensaver - -Edit /etc/dconf/db/local.d/00-screensaver and add or update the following lines: - -[org/gnome/desktop/session] -# Set the lock time out to 900 seconds before the session is considered idle -idle-delay=uint32 900 - -Update the system databases: - -$ sudo dconf updateVerify RHEL 9 initiates a session lock after a 15-minute period of inactivity for graphical user interfaces with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ sudo gsettings get org.gnome.desktop.session idle-delay - -uint32 900 - -If "idle-delay" is set to "0" or a value greater than "900", this is a finding.SRG-OS-000029-GPOS-00010<GroupDescription></GroupDescription>RHEL-09-271070RHEL 9 must prevent a user from overriding the session idle-delay setting for the graphical user interface.<VulnDiscussion>A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, the GNOME desktop can be configured to identify when a user's session has idled and take action to initiate the session lock. As such, users should not be allowed to change session settings. - -Satisfies: SRG-OS-000029-GPOS-00010, SRG-OS-000031-GPOS-00012</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000057CCI-000060Configure RHEL 9 to prevent a user from overriding settings for graphical user interfaces. - -Create a database to contain the system-wide screensaver settings (if it does not already exist) with the following command: - -Note: The example below is using the database "local" for the system, so if the system is using another database in "/etc/dconf/profile/user", the file should be created under the appropriate subdirectory. - -$ sudo touch /etc/dconf/db/local.d/locks/session - -Add the following setting to prevent nonprivileged users from modifying it: - -/org/gnome/desktop/session/idle-delayVerify RHEL 9 prevents a user from overriding settings for graphical user interfaces. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that graphical settings are locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ sudo grep -i idle /etc/dconf/db/local.d/locks/* - -/org/gnome/desktop/session/idle-delay - -If the command does not return at least the example result, this is a finding.SRG-OS-000029-GPOS-00010<GroupDescription></GroupDescription>RHEL-09-271075RHEL 9 must initiate a session lock for graphical user interfaces when the screensaver is activated.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to logout because of the temporary nature of the absence.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000057Configure RHEL 9 to initiate a session lock for graphical user interfaces when a screensaver is activated. - -Create a database to contain the system-wide screensaver settings (if it does not already exist) with the following command: - -Note: The example below is using the database "local" for the system, so if the system is using another database in "/etc/dconf/profile/user", the file should be created under the appropriate subdirectory. - -$ sudo touch /etc/dconf/db/local.d/00-screensaver - -[org/gnome/desktop/screensaver] -lock-delay=uint32 5 - -The "uint32" must be included along with the integer key values as shown. - -Update the system databases: - -$ sudo dconf updateVerify RHEL 9 initiates a session lock for graphical user interfaces when the screensaver is activated with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ gsettings get org.gnome.desktop.screensaver lock-delay - -uint32 5 - -If the "uint32" setting is not set to "5" or less, or is missing, this is a finding.SRG-OS-000029-GPOS-00010<GroupDescription></GroupDescription>RHEL-09-271080RHEL 9 must prevent a user from overriding the session lock-delay setting for the graphical user interface.<VulnDiscussion>A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, the GNOME desktop can be configured to identify when a user's session has idled and take action to initiate the session lock. As such, users should not be allowed to change session settings.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000057Configure RHEL 9 to prevent a user from overriding settings for graphical user interfaces. - -Create a database to contain the system-wide screensaver settings (if it does not already exist) with the following command: - -Note: The example below is using the database "local" for the system, so if the system is using another database in "/etc/dconf/profile/user", the file should be created under the appropriate subdirectory. - -$ sudo touch /etc/dconf/db/local.d/locks/session - -Add the following setting to prevent nonprivileged users from modifying it: - -/org/gnome/desktop/screensaver/lock-delayVerify RHEL 9 prevents a user from overriding settings for graphical user interfaces. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that graphical settings are locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ sudo grep -i lock-delay /etc/dconf/db/local.d/locks/* - -/org/gnome/desktop/screensaver/lock-delay - -If the command does not return at least the example result, this is a finding.SRG-OS-000031-GPOS-00012<GroupDescription></GroupDescription>RHEL-09-271085RHEL 9 must conceal, via the session lock, information previously visible on the display with a publicly viewable image.<VulnDiscussion>Setting the screensaver mode to blank-only conceals the contents of the display from passersby.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000060The dconf settings can be edited in the /etc/dconf/db/* location. - -First, add or update the [org/gnome/desktop/screensaver] section of the "/etc/dconf/db/local.d/00-security-settings" database file and add or update the following lines: - -[org/gnome/desktop/screensaver] -picture-uri='' - -Then, add the following line to "/etc/dconf/db/local.d/locks/00-security-settings-lock" to prevent user modification: - -/org/gnome/desktop/screensaver/picture-uri - -Finally, update the dconf system databases: - -$ sudo dconf updateTo ensure the screensaver is configured to be blank, run the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ gsettings get org.gnome.desktop.screensaver picture-uri - -If properly configured, the output should be "''". - -To ensure that users cannot set the screensaver background, run the following: - -$ grep picture-uri /etc/dconf/db/local.d/locks/* - -If properly configured, the output should be "/org/gnome/desktop/screensaver/picture-uri". - -If it is not set or configured properly, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-271090RHEL 9 effective dconf policy must match the policy keyfiles.<VulnDiscussion>Unlike text-based keyfiles, the binary database is impossible to check through most automated and all manual means; therefore, in order to evaluate dconf configuration, both have to be true at the same time - configuration files have to be compliant, and the database needs to be more recent than those keyfiles, which gives confidence that it reflects them.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Update the dconf databases by running the following command: - -$ sudo dconf updateCheck the last modification time of the local databases, comparing it to the last modification time of the related keyfiles. The following command will check every dconf database and compare its modification time to the related system keyfiles: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ function dconf_needs_update { for db in $(find /etc/dconf/db -maxdepth 1 -type f); do db_mtime=$(stat -c %Y "$db"); keyfile_mtime=$(stat -c %Y "$db".d/* | sort -n | tail -1); if [ -n "$db_mtime" ] && [ -n "$keyfile_mtime" ] && [ "$db_mtime" -lt "$keyfile_mtime" ]; then echo "$db needs update"; return 1; fi; done; }; dconf_needs_update - -If the command has any output, then a dconf database needs to be updated, and this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-271095RHEL 9 must disable the ability of a user to restart the system from the login screen.<VulnDiscussion>A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to disable a user's ability to restart the system. - -Add or update the [org/gnome/settings-daemon/] section of the /etc/dconf/db/local.d/00-security-settings" database file and add or update the following lines: - -[org/gnome/login-screen] -disable-restart-buttons='true' - -Then update the dconf system databases: - -$ sudo dconf updateVerify RHEL 9 disables a user's ability to restart the system with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, Gnome Shell. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ grep -R disable-restart-buttons /etc/dconf/db/* - -/etc/dconf/db/distro.d/20-authselect:disable-restart-buttons='true' - -If the "disable-restart-button" setting is not set to "true", is missing or commented out from the dconf database files, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-271100RHEL 9 must prevent a user from overriding the disable-restart-buttons setting for the graphical user interface.<VulnDiscussion>A user who is at the console can reboot the system at the login screen. If restart or shutdown buttons are pressed at the login screen, this can create the risk of short-term loss of availability of systems due to reboot.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to prevent a user from overriding the disable-restart-buttons setting for graphical user interfaces. - -Create a database to contain the system-wide graphical user logon settings (if it does not already exist) with the following command: - -$ sudo touch /etc/dconf/db/local.d/locks/session - -Add the following line to prevent nonprivileged users from modifying it: - -/org/gnome/login-screen/disable-restart-buttons - -Run the following command to update the database: - -$ sudo dconf updateVerify RHEL 9 prevents a user from overriding the disable-restart-buttons setting for graphical user interfaces. - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -Determine which profile the system database is using with the following command: - -$ sudo grep system-db /etc/dconf/profile/user - -system-db:local - -Check that graphical settings are locked from nonprivileged user modification with the following command: - -Note: The example below is using the database "local" for the system, so the path is "/etc/dconf/db/local.d". This path must be modified if a database other than "local" is being used. - -$ grep disable-restart-buttons /etc/dconf/db/local.d/locks/* - -/org/gnome/login-screen/disable-restart-buttons - -If the command does not return at least the example result, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-271105RHEL 9 must disable the ability of a user to accidentally press Ctrl-Alt-Del and cause a system to shut down or reboot.<VulnDiscussion>A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to ignore the Ctrl-Alt-Del sequence in the GNOME desktop. - -Add or update the [org/gnome/settings-daemon/plugins/media-keys] section of the /etc/dconf/db/local.d/00-security-settings database file and add or update the following lines: - -[org/gnome/settings-daemon/plugins/media-keys] -logout=[''] - -Run the following command to update the database: - -$ sudo dconf updateVerify RHEL 9 is configured to ignore the Ctrl-Alt-Del sequence in the GNOME desktop with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ gsettings get org.gnome.settings-daemon.plugins.media-keys logout - -"['']" - -If the GNOME desktop is configured to shut down when Ctrl-Alt-Del is pressed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-271110RHEL 9 must prevent a user from overriding the Ctrl-Alt-Del sequence settings for the graphical user interface.<VulnDiscussion>A locally logged-in user who presses Ctrl-Alt-Del, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to disallow the user changing the Ctrl-Alt-Del sequence in the GNOME desktop. - -Create a database to container system-wide graphical user logon settings (if it does not already exist) with the following command: - -$ sudo touch /etc/dconf/db/local.d/locks/session - -Add the following line to the session locks file to prevent nonprivileged users from modifying the Ctrl-Alt-Del setting: - -/org/gnome/settings-daemon/plugins/media-keys/logout - -Run the following command to update the database: - -$ sudo dconf updateVerify that users cannot enable the Ctrl-Alt-Del sequence in the GNOME desktop with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ grep logout /etc/dconf/db/local.d/locks/* - -/org/gnome/settings-daemon/plugins/media-keys/logout - -If the output is not "/org/gnome/settings-daemon/plugins/media-keys/logout", the line is commented out, or the line is missing, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-271115RHEL 9 must disable the user list at logon for graphical user interfaces.<VulnDiscussion>Leaving the user list enabled is a security risk since it allows anyone with physical access to the system to enumerate known user accounts without authenticated access to the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to disable the user list at logon for graphical user interfaces. - -Create a database to contain the system-wide screensaver settings (if it does not already exist) with the following command: -Note: The example below is using the database "local" for the system, so if the system is using another database in "/etc/dconf/profile/user", the file should be created under the appropriate subdirectory. - -$ sudo touch /etc/dconf/db/local.d/02-login-screen - -[org/gnome/login-screen] -disable-user-list=true - -Update the system databases: - -$ sudo dconf updateVerify that RHEL 9 disables the user logon list for graphical user interfaces with the following command: - -Note: This requirement assumes the use of the RHEL 9 default graphical user interface, the GNOME desktop environment. If the system does not have any graphical user interface installed, this requirement is Not Applicable. - -$ sudo gsettings get org.gnome.login-screen disable-user-list -true - -If the setting is "false", this is a finding.SRG-OS-000114-GPOS-00059<GroupDescription></GroupDescription>RHEL-09-291010RHEL 9 must be configured to disable USB mass storage.<VulnDiscussion>USB mass storage permits easy introduction of unknown devices, thereby facilitating malicious activity. - -Satisfies: SRG-OS-000114-GPOS-00059, SRG-OS-000378-GPOS-00163, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000778CCI-001958To configure the system to prevent the usb-storage kernel module from being loaded, add the following line to the file /etc/modprobe.d/usb-storage.conf (or create usb-storage.conf if it does not exist): - -install usb-storage /bin/false -blacklist usb-storageVerify that RHEL 9 disables the ability to load the USB Storage kernel module with the following command: - -$ sudo grep -r usb-storage /etc/modprobe.conf /etc/modprobe.d/* - -blacklist usb-storage - -If the command does not return any output, or the line is commented out, and use of USB Storage is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000378-GPOS-00163<GroupDescription></GroupDescription>RHEL-09-291015RHEL 9 must have the USBGuard package installed.<VulnDiscussion>The USBguard-daemon is the main component of the USBGuard software framework. It runs as a service in the background and enforces the USB device authorization policy for all USB devices. The policy is defined by a set of rules using a rule language described in the usbguard-rules.conf file. The policy and the authorization state of USB devices can be modified during runtime using the usbguard tool. - -The system administrator (SA) must work with the site information system security officer (ISSO) to determine a list of authorized peripherals and establish rules within the USBGuard software framework to allow only authorized devices.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001958Install the usbguard package with the following command: - -$ sudo dnf install usbguardVerify USBGuard is installed on the operating system with the following command: - -$ sudo dnf list installed usbguard - -Example output: - -Installed Packages -usbguard.x86_64 1.0.0-10.el9_1.2 @rhel-9-for-x86_64-appstream-rpms - -If the USBGuard package is not installed, ask the SA to indicate how unauthorized peripherals are being blocked. - -If there is no evidence that unauthorized peripherals are being blocked before establishing a connection, this is a finding.SRG-OS-000378-GPOS-00163<GroupDescription></GroupDescription>RHEL-09-291020RHEL 9 must have the USBGuard package enabled.<VulnDiscussion>The USBguard-daemon is the main component of the USBGuard software framework. It runs as a service in the background and enforces the USB device authorization policy for all USB devices. The policy is defined by a set of rules using a rule language described in the usbguard-rules.conf file. The policy and the authorization state of USB devices can be modified during runtime using the usbguard tool. - -The system administrator (SA) must work with the site information system security officer (ISSO) to determine a list of authorized peripherals and establish rules within the USBGuard software framework to allow only authorized devices.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001958To enable the USBGuard service run the following command: - -$ sudo systemctl enable --now usbguardVerify RHEL 9 has USBGuard enabled with the following command: - -$ systemctl is-active usbguard - -active - -If usbguard is not active, ask the SA to indicate how unauthorized peripherals are being blocked. - -If there is no evidence that unauthorized peripherals are being blocked before establishing a connection, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-09-291025RHEL 9 must enable Linux audit logging for the USBGuard daemon.<VulnDiscussion>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -The list of audited events is the set of events for which audits are to be generated. This set of events is typically a subset of the list of all events for which the system is capable of generating audit records. - -DOD has defined the list of events for which RHEL 9 will provide an audit record generation capability as the following: - -1) Successful and unsuccessful attempts to access, modify, or delete privileges, security objects, security levels, or categories of information (e.g., classification levels); - -2) Access actions, such as successful and unsuccessful logon attempts, privileged activities or other system-level access, starting and ending time for user access to the system, concurrent logons from different workstations, successful and unsuccessful accesses to objects, all program initiations, and all direct access to the information system; - -3) All account creations, modifications, disabling, and terminations; and - -4) All kernel module load, unload, and restart actions.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000169Configure RHEL 9 USBGuard AuditBackend to use the audit system. - -Add or edit the following line in /etc/usbguard/usbguard-daemon.conf - -AuditBackend=LinuxAuditTo verify that Linux Audit logging is enabled for the USBGuard daemon with the following command: - -$ sudo grep AuditBackend /etc/usbguard/usbguard-daemon.conf - -AuditBackend=LinuxAudit - -If "AuditBackend" is not set to "LinuxAudit", this is a finding.SRG-OS-000378-GPOS-00163<GroupDescription></GroupDescription>RHEL-09-291030RHEL 9 must block unauthorized peripherals before establishing a connection.<VulnDiscussion>The USBguard-daemon is the main component of the USBGuard software framework. It runs as a service in the background and enforces the USB device authorization policy for all USB devices. The policy is defined by a set of rules using a rule language described in the usbguard-rules.conf file. The policy and the authorization state of USB devices can be modified during runtime using the usbguard tool. - -The system administrator (SA) must work with the site information system security officer (ISSO) to determine a list of authorized peripherals and establish rules within the USBGuard software framework to allow only authorized devices.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001958Configure the operating system to enable the blocking of unauthorized peripherals with the following command: - -Note: This command must be run from a root shell and will create an allow list for any usb devices currently connect to the system. - -# usbguard generate-policy --no-hash > /etc/usbguard/rules.conf - -Note: Enabling and starting usbguard without properly configuring it for an individual system will immediately prevent any access over a usb device such as a keyboard or mouse.Verify the USBGuard has a policy configured with the following command: - -$ usbguard list-rules - -allow id 1d6b:0001 serial - -If the command does not return results or an error is returned, ask the SA to indicate how unauthorized peripherals are being blocked. - -If there is no evidence that unauthorized peripherals are being blocked before establishing a connection, this is a finding. - -If the system is virtual machine with no virtual or physical USB peripherals attached, this is not a finding.SRG-OS-000095-GPOS-00049<GroupDescription></GroupDescription>RHEL-09-291035RHEL 9 Bluetooth must be disabled.<VulnDiscussion>This requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with RHEL 9 systems. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR keyboards, mice and pointing devices, and near field communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the Authorizing Official (AO). Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the RHEL 9 operating system. - -Satisfies: SRG-OS-000095-GPOS-00049, SRG-OS-000300-GPOS-00118</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000381CCI-001443Configure RHEL 9 to disable the Bluetooth adapter when not in use. - -Create or modify the "/etc/modprobe.d/bluetooth.conf" file with the following line: - -install bluetooth /bin/false -blacklist bluetooth - -Reboot the system for the settings to take effect.Verify that RHEL 9 disables the ability to load the Bluetooth kernel module with the following command: - -$ sudo grep -r bluetooth /etc/modprobe.conf /etc/modprobe.d/* - -blacklist bluetooth - -If the command does not return any output, or the line is commented out, and use of Bluetooth is not documented with the information system security officer (ISSO) as an operational requirement, this is a finding.SRG-OS-000299-GPOS-00117<GroupDescription></GroupDescription>RHEL-09-291040RHEL 9 wireless network adapters must be disabled.<VulnDiscussion>This requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with RHEL 9 systems. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR keyboards, mice and pointing devices, and near field communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the Authorizing Official (AO). Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the RHEL 9 operating system. - -Satisfies: SRG-OS-000299-GPOS-00117, SRG-OS-000300-GPOS-00118, SRG-OS-000424-GPOS-00188, SRG-OS-000481-GPOS-00481</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001443CCI-001444CCI-002418CCI-002421Configure the system to disable all wireless network interfaces with the following command: - -$ nmcli radio all offVerify there are no wireless interfaces configured on the system with the following command: - -Note: This requirement is Not Applicable for systems that do not have physical wireless network radios. - -$ nmcli device status - -DEVICE TYPE STATE CONNECTION -virbr0 bridge connected virbr0 -wlp7s0 wifi connected wifiSSID -enp6s0 ethernet disconnected -- -p2p-dev-wlp7s0 wifi-p2p disconnected -- -lo loopback unmanaged -- -virbr0-nic tun unmanaged -- - -If a wireless interface is configured and has not been documented and approved by the information system security officer (ISSO), this is a finding.SRG-OS-000076-GPOS-00044<GroupDescription></GroupDescription>RHEL-09-411010RHEL 9 user account passwords for new users or password changes must have a 60-day maximum password lifetime restriction in /etc/login.defs.<VulnDiscussion>Any password, no matter how complex, can eventually be cracked; therefore, passwords need to be changed periodically. If the operating system does not limit the lifetime of passwords and force users to change their passwords, there is the risk that the operating system passwords could be compromised. - -Setting the password maximum age ensures users are required to periodically change their passwords. Requiring shorter password lifetimes increases the risk of users writing down the password in a convenient location subject to physical compromise.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000199Configure RHEL 9 to enforce a 60-day maximum password lifetime. - -Add or modify the following line in the "/etc/login.defs" file: - -PASS_MAX_DAYS 60Verify that RHEL 9 enforces a 60-day maximum password lifetime for new user accounts by running the following command: - -$ grep -i pass_max_days /etc/login.defs - -PASS_MAX_DAYS 60 - -If the "PASS_MAX_DAYS" parameter value is greater than "60", or commented out, this is a finding.SRG-OS-000076-GPOS-00044<GroupDescription></GroupDescription>RHEL-09-411015RHEL 9 user account passwords must have a 60-day maximum password lifetime restriction.<VulnDiscussion>Any password, no matter how complex, can eventually be cracked; therefore, passwords need to be changed periodically. If RHEL 9 does not limit the lifetime of passwords and force users to change their passwords, there is the risk that RHEL 9 passwords could be compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000199Configure noncompliant accounts to enforce a 60-day maximum password lifetime restriction. - -passwd -x 60 [user]Check whether the maximum time period for existing passwords is restricted to 60 days with the following commands: - -$ sudo awk -F: '$5 > 60 {print $1 "" "" $5}' /etc/shadow - -$ sudo awk -F: '$5 <= 0 {print $1 "" "" $5}' /etc/shadow - -If any results are returned that are not associated with a system account, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411020All RHEL 9 local interactive user accounts must be assigned a home directory upon creation.<VulnDiscussion>If local interactive users are not assigned a valid home directory, there is no place for the storage and control of files they should own.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to assign home directories to all new local interactive users by setting the "CREATE_HOME" parameter in "/etc/login.defs" to "yes" as follows. - -CREATE_HOME yesVerify all local interactive users on RHEL 9 are assigned a home directory upon creation with the following command: - -$ grep -i create_home /etc/login.defs - -CREATE_HOME yes - -If the value for "CREATE_HOME" parameter is not set to "yes", the line is missing, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411025RHEL 9 must set the umask value to 077 for all local interactive user accounts.<VulnDiscussion>The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove the umask statement from all local interactive user's initialization files. - -If the account is for an application, the requirement for a umask less restrictive than "077" can be documented with the information system security officer, but the user agreement for access to the account must specify that the local interactive user must log on to their account first and then switch the user to the application account with the correct option to gain the account's environment variables.Verify that the default umask for all local interactive users is "077". - -Identify the locations of all local interactive user home directories by looking at the "/etc/passwd" file. - -Check all local interactive user initialization files for interactive users with the following command: - -Note: The example is for a system that is configured to create users home directories in the "/home" directory. - -# grep -ri umask /home/ - -/home/wadea/.bash_history:grep -i umask /etc/bashrc /etc/csh.cshrc /etc/profile -/home/wadea/.bash_history:grep -i umask /etc/login.defs - -If any local interactive user initialization files are found to have a umask statement that sets a value less restrictive than "077", this is a finding.SRG-OS-000104-GPOS-00051<GroupDescription></GroupDescription>RHEL-09-411030RHEL 9 duplicate User IDs (UIDs) must not exist for interactive users.<VulnDiscussion>To ensure accountability and prevent unauthenticated access, interactive users must be identified and authenticated to prevent potential misuse and compromise of the system. - -Satisfies: SRG-OS-000104-GPOS-00051, SRG-OS-000121-GPOS-00062, SRG-OS-000042-GPOS-00020</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000135CCI-000764CCI-000804Edit the file "/etc/passwd" and provide each interactive user account that has a duplicate UID with a unique UID.Verify that RHEL 9 contains no duplicate UIDs for interactive users with the following command: - -$ sudo awk -F ":" 'list[$3]++{print $1, $3}' /etc/passwd - -If output is produced and the accounts listed are interactive user accounts, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411035RHEL 9 system accounts must not have an interactive login shell.<VulnDiscussion>Ensuring shells are not given to system accounts upon login makes it more difficult for attackers to make use of system accounts.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 so that all noninteractive accounts on the system do not have an interactive shell assigned to them. - -If the system account needs a shell assigned for mission operations, document the need with the information system security officer (ISSO). - -Run the following command to disable the interactive shell for a specific noninteractive user account: - -Replace <user> with the user that has a login shell. - -$ sudo usermod --shell /sbin/nologin <user> - -Do not perform the steps in this section on the root account. Doing so will cause the system to become inaccessible.Verify that system accounts must not have an interactive login shell with the following command: - -$ awk -F: '($3<1000){print $1 ":" $3 ":" $7}' /etc/passwd - -root:0:/bin/bash -bin:1:/sbin/nologin -daemon:2:/sbin/nologin -adm:3:/sbin/nologin -lp:4:/sbin/nologin - -Identify the system accounts from this listing that do not have a nologin shell. - -If any system account (other than the root account) has a login shell and it is not documented with the information system security officer (ISSO), this is a finding.SRG-OS-000123-GPOS-00064<GroupDescription></GroupDescription>RHEL-09-411040RHEL 9 must automatically expire temporary accounts within 72 hours.<VulnDiscussion>Temporary accounts are privileged or nonprivileged accounts that are established during pressing circumstances, such as new software or hardware configuration or an incident response, where the need for prompt account activation requires bypassing normal account authorization procedures. If any inactive temporary accounts are left enabled on the system and are not either manually removed or automatically expired within 72 hours, the security posture of the system will be degraded and exposed to exploitation by unauthorized users or insider threat actors. - -Temporary accounts are different from emergency accounts. Emergency accounts, also known as "last resort" or "break glass" accounts, are local logon accounts enabled on the system for emergency use by authorized system administrators to manage a system when standard logon methods are failing or not available. Emergency accounts are not subject to manual removal or scheduled expiration requirements. - -The automatic expiration of temporary accounts may be extended as needed by the circumstances but it must not be extended indefinitely. A documented permanent account should be established for privileged users who need long-term maintenance accounts. - -Satisfies: SRG-OS-000123-GPOS-00064, SRG-OS-000002-GPOS-00002</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000016CCI-001682Configure the operating system to expire temporary accounts after 72 hours with the following command: - -$ sudo chage -E $(date -d +3days +%Y-%m-%d) <temporary_account_name>Verify temporary accounts have been provisioned with an expiration date of 72 hours. - -For every existing temporary account, run the following command to obtain its account expiration information: - -$ sudo chage -l <temporary_account_name> | grep -i "account expires" - -Verify each of these accounts has an expiration date set within 72 hours. - -If any temporary accounts have no expiration date set or do not expire within 72 hours, this is a finding.SRG-OS-000104-GPOS-00051<GroupDescription></GroupDescription>RHEL-09-411045All RHEL 9 interactive users must have a primary group that exists.<VulnDiscussion>If a user is assigned the Group Identifier (GID) of a group that does not exist on the system, and a group with the GID is subsequently created, the user may have unintended rights to any files associated with the group.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000764Configure the system so that all GIDs are referenced in "/etc/passwd" are defined in "/etc/group". - -Edit the file "/etc/passwd" and ensure that every user's GID is a valid GID.Verify that all RHEL 9 interactive users have a valid GID. - -Check that the interactive users have a valid GID with the following command: - -$ sudo pwck -qr - -If the system has any interactive users with duplicate GIDs, this is a finding.SRG-OS-000118-GPOS-00060<GroupDescription></GroupDescription>RHEL-09-411050RHEL 9 must disable account identifiers (individuals, groups, roles, and devices) after 35 days of inactivity.<VulnDiscussion>Inactive identifiers pose a risk to systems and applications because attackers may exploit an inactive identifier and potentially obtain undetected access to the system. - -Disabling inactive accounts ensures that accounts which may not have been responsibly removed are not available to attackers who may have compromised their credentials. - -Owners of inactive accounts will not notice if unauthorized access to their user account has been obtained.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000795Configure RHEL 9 to disable account identifiers after 35 days of inactivity after the password expiration. - -Run the following command to change the configuration for useradd: - -$ sudo useradd -D -f 35 - -The recommendation is 35 days, but a lower value is acceptable.Verify that RHEL 9 account identifiers (individuals, groups, roles, and devices) are disabled after 35 days of inactivity with the following command: - -Check the account inactivity value by performing the following command: - -$ sudo grep -i inactive /etc/default/useradd - -INACTIVE=35 - -If "INACTIVE" is set to "-1", a value greater than "35", or is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411055Executable search paths within the initialization files of all local interactive RHEL 9 users must only contain paths that resolve to the system default or the users home directory.<VulnDiscussion>The executable search path (typically the PATH environment variable) contains a list of directories for the shell to search to find executables. If this path includes the current working directory (other than the users home directory), executables in these directories may be executed instead of system commands. - -This variable is formatted as a colon-separated list of directories. If there is an empty entry, such as a leading or trailing colon or two consecutive colons, this is interpreted as the current working directory. If deviations from the default system search path for the local interactive user are required, they must be documented with the information system security officer (ISSO).</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Edit the local interactive user initialization files to change any PATH variable statements that reference directories other than their home directory. - -If a local interactive user requires path variables to reference a directory owned by the application, it must be documented with the ISSO.Verify that all local interactive user initialization file executable search path statements do not contain statements that will reference a working directory other than user home directories with the following commands: - -$ sudo grep -i path= /home/*/.* - -/home/[localinteractiveuser]/.bash_profile:PATH=$PATH:$HOME/.local/bin:$HOME/bin - -If any local interactive user initialization files have executable search path statements that include directories outside of their home directory and is not documented with the ISSO as an operational requirement, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411060All RHEL 9 local interactive users must have a home directory assigned in the /etc/passwd file.<VulnDiscussion>If local interactive users are not assigned a valid home directory, there is no place for the storage and control of files they should own.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Create and assign home directories to all local interactive users on RHEL 9 that currently do not have a home directory assigned.Verify that interactive users on the system have a home directory assigned with the following command: - -$ sudo awk -F: '($3>=1000)&&($7 !~ /nologin/){print $1, $3, $6}' /etc/passwd - -smithk:x:1000:1000:smithk:/home/smithk:/bin/bash -scsaustin:x:1001:1001:scsaustin:/home/scsaustin:/bin/bash -djohnson:x:1002:1002:djohnson:/home/djohnson:/bin/bash - -Inspect the output and verify that all interactive users (normally users with a user identifier (UID) greater that 1000) have a home directory defined. - -If users home directory is not defined, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411065All RHEL 9 local interactive user home directories defined in the /etc/passwd file must exist.<VulnDiscussion>If a local interactive user has a home directory defined that does not exist, the user may be given access to the / directory as the current working directory upon logon. This could create a denial of service because the user would not be able to access their logon configuration files, and it may give them visibility to system files they normally would not be able to access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Create home directories to all local interactive users that currently do not have a home directory assigned. Use the following commands to create the user home directory assigned in "/etc/ passwd": - -Note: The example will be for the user wadea, who has a home directory of "/home/wadea", a user identifier (UID) of "wadea", and a Group Identifier (GID) of "users assigned" in "/etc/passwd". - -$ sudo mkdir /home/wadea -$ sudo chown wadea /home/wadea -$ sudo chgrp users /home/wadea -$ sudo chmod 0750 /home/wadeaVerify the assigned home directories of all interactive users on the system exist with the following command: - -$ sudo pwck -r - -user 'mailnull': directory 'var/spool/mqueue' does not exist - -The output should not return any interactive users. - -If users home directory does not exist, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411070All RHEL 9 local interactive user home directories must be group-owned by the home directory owner's primary group.<VulnDiscussion>If the Group Identifier (GID) of a local interactive users home directory is not the same as the primary GID of the user, this would allow unauthorized access to the users files, and users that share the same group may not be able to access files that they legitimately should.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the group owner of a local interactive user's home directory to the group found in "/etc/passwd". To change the group owner of a local interactive user's home directory, use the following command: - -Note: The example will be for the user "wadea", who has a home directory of "/home/wadea", and has a primary group of users. - -$ sudo chgrp users /home/wadeaVerify the assigned home directory of all local interactive users is group-owned by that user's primary GID with the following command: - -Note: This may miss local interactive users that have been assigned a privileged user identifier (UID). Evidence of interactive use may be obtained from a number of log files containing system logon information. The returned directory "/home/wadea" is used as an example. - -$ sudo ls -ld $(awk -F: '($3>=1000)&&($7 !~ /nologin/){print $6}' /etc/passwd) - -drwxr-x--- 2 wadea admin 4096 Jun 5 12:41 wadea - -Check the user's primary group with the following command: - -$ sudo grep $(grep wadea /etc/passwd | awk -F: ‘{print $4}') /etc/group - -admin:x:250:wadea,jonesj,jacksons - -If the user home directory referenced in "/etc/passwd" is not group-owned by that user's primary GID, this is a finding.SRG-OS-000329-GPOS-00128<GroupDescription></GroupDescription>RHEL-09-411075RHEL 9 must automatically lock an account when three unsuccessful logon attempts occur.<VulnDiscussion>By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-force attacks, is reduced. Limits are imposed by locking the account. - -Satisfies: SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044CCI-002238Configure RHEL 9 to lock an account when three unsuccessful logon attempts occur. - -Add/modify the "/etc/security/faillock.conf" file to match the following line: - -deny = 3Verify RHEL 9 is configured to lock an account after three unsuccessful logon attempts with the command: - -$ grep 'deny =' /etc/security/faillock.conf - -deny = 3 - -If the "deny" option is not set to "3" or less (but not "0"), is missing or commented out, this is a finding.SRG-OS-000329-GPOS-00128<GroupDescription></GroupDescription>RHEL-09-411080RHEL 9 must automatically lock the root account until the root account is released by an administrator when three unsuccessful logon attempts occur during a 15-minute time period.<VulnDiscussion>By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, also known as brute-forcing, is reduced. Limits are imposed by locking the account. - -Satisfies: SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044CCI-002238Configure RHEL 9 to lock out the "root" account after a number of incorrect login attempts using "pam_faillock.so", first enable the feature using the following command: - -$ sudo authselect enable-feature with-faillock - - Then edit the "/etc/security/faillock.conf" file as follows: - - add or uncomment the following line: - even_deny_rootVerify RHEL 9 is configured to lock the root account after three unsuccessful logon attempts with the command: - -$ grep even_deny_root /etc/security/faillock.conf - -even_deny_root - -If the "even_deny_root" option is not set, is missing or commented out, this is a finding.SRG-OS-000329-GPOS-00128<GroupDescription></GroupDescription>RHEL-09-411085RHEL 9 must automatically lock an account when three unsuccessful logon attempts occur during a 15-minute time period.<VulnDiscussion>By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account. - -Satisfies: SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044CCI-002238To configure RHEL 9 to lock out the "root" account after a number of incorrect login attempts within 15 minutes using "pam_faillock.so", enable the feature using the following command: - -$ authselect enable-feature with-faillock - -Then edit the "/etc/security/faillock.conf" file as follows: - -fail_interval = 900Verify RHEL 9 locks an account after three unsuccessful logon attempts within a period of 15 minutes with the following command: - -Note: If the system administrator demonstrates the use of an approved centralized account management method that locks an account after three unsuccessful logon attempts within a period of 15 minutes, this requirement is Not Applicable. - -$ grep fail_interval /etc/security/faillock.conf - -fail_interval = 900 - -If the "fail_interval" option is not set to "900" or less (but not "0"), the line is commented out, or the line is missing, this is a finding.SRG-OS-000329-GPOS-00128<GroupDescription></GroupDescription>RHEL-09-411090RHEL 9 must maintain an account lock until the locked account is released by an administrator.<VulnDiscussion>By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account. - -Satisfies: SRG-OS-000329-GPOS-00128, SRG-OS-000021-GPOS-00005</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044CCI-002238Configure RHEL 9 to lock an account until released by an administrator after three unsuccessful logon attempts with the command: - -$ authselect enable-feature with-faillock - -Then edit the "/etc/security/faillock.conf" file as follows: - -unlock_time = 0Verify RHEL 9 is configured to lock an account until released by an administrator after three unsuccessful logon attempts with the command: - -$ grep 'unlock_time =' /etc/security/faillock.conf - -unlock_time = 0 - -If the "unlock_time" option is not set to "0", the line is missing, or commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411095RHEL 9 must not have unauthorized accounts.<VulnDiscussion>Accounts providing no operational purpose provide additional opportunities for system compromise. Unnecessary accounts include user accounts for individuals not requiring access to the system and application accounts for applications not installed on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove unauthorized local interactive user accounts with the following command where <unauthorized_user> is the unauthorized account: - -$ sudo userdel <unauthorized_user>Verify that there are no unauthorized interactive user accounts with the following command: - -$ less /etc/passwd - -root:x:0:0:root:/root:/bin/bash -... -games:x:12:100:games:/usr/games:/sbin/nologin -scsaustin:x:1001:1001:scsaustin:/home/scsaustin:/bin/bash -djohnson:x:1002:1002:djohnson:/home/djohnson:/bin/bash - -Interactive user account, generally will have a user identifier (UID) of 1000 or greater, a home directory in a specific partition, and an interactive shell. - -Obtain the list of interactive user accounts authorized to be on the system from the system administrator or information system security officer (ISSO) and compare it to the list of local interactive user accounts on the system. - -If there are unauthorized local user accounts on the system, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411100The root account must be the only account having unrestricted access to RHEL 9 system.<VulnDiscussion>An account has root authority if it has a user identifier (UID) of "0". Multiple accounts with a UID of "0" afford more opportunity for potential intruders to guess a password for a privileged account. Proper configuration of sudo is recommended to afford multiple system administrators access to root privileges in an accountable manner.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Change the UID of any account on the system, other than root, that has a UID of "0". - -If the account is associated with system commands or applications, the UID should be changed to one greater than "0" but less than "1000". Otherwise, assign a UID of greater than "1000" that has not already been assigned.Verify that only the "root" account has a UID "0" assignment with the following command: - -$ awk -F: '$3 == 0 {print $1}' /etc/passwd - -root - -If any accounts other than "root" have a UID of "0", this is a finding.SRG-OS-000021-GPOS-00005<GroupDescription></GroupDescription>RHEL-09-411105RHEL 9 must ensure account lockouts persist.<VulnDiscussion>Having lockouts persist across reboots ensures that account is only unlocked by an administrator. If the lockouts did not persist across reboots, an attacker could simply reboot the system to continue brute force attacks against the accounts on the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044Configure RHEL 9 maintain the contents of the faillock directory after a reboot. - -Add/modify the "/etc/security/faillock.conf" file to match the following line: - -dir = /var/log/faillockVerify the "/etc/security/faillock.conf" file is configured use a nondefault faillock directory to ensure contents persist after reboot with the following command: - -$ grep 'dir =' /etc/security/faillock.conf - -dir = /var/log/faillock - -If the "dir" option is not set to a nondefault documented tally log directory, is missing or commented out, this is a finding.SRG-OS-000104-GPOS-00051<GroupDescription></GroupDescription>RHEL-09-411110RHEL 9 groups must have unique Group ID (GID).<VulnDiscussion>To ensure accountability and prevent unauthenticated access, groups must be identified uniquely to prevent potential misuse and compromise of the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000764Edit the file "/etc/group" and provide each group that has a duplicate GID with a unique GID.Verify that RHEL 9 contains no duplicate GIDs for interactive users with the following command: - - $ cut -d : -f 3 /etc/group | uniq -d - -If the system has duplicate GIDs, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-411115Local RHEL 9 initialization files must not execute world-writable programs.<VulnDiscussion>If user start-up files execute world-writable programs, especially in unprotected directories, they could be maliciously modified to destroy user files or otherwise compromise the system at the user level. If the system is compromised at the user level, it is easier to elevate privileges to eventually compromise the system at the root and network level.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Set the mode on files being executed by the local initialization files with the following command: - -$ sudo chmod 0755 <file>Verify that local initialization files do not execute world-writable programs with the following command: - -Note: The example will be for a system that is configured to create user home directories in the "/home" directory. - -$ sudo find /home -perm -002 -type f -name ".[^.]*" -exec ls -ld {} \; - -If any local initialization files are found to reference world-writable files, this is a finding.SRG-OS-000030-GPOS-00011<GroupDescription></GroupDescription>RHEL-09-412010RHEL 9 must have the tmux package installed.<VulnDiscussion>Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package. - -Satisfies: SRG-OS-000030-GPOS-00011, SRG-OS-000028-GPOS-00009</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056CCI-000058The tmux package can be installed with the following command: - -$ sudo dnf install tmuxVerify that RHEL 9 has the tmux package installed with the following command: - -$ sudo dnf list --installed tmux - -Example output: - -tmux.x86_64 3.2a-4.el9 - -If the "tmux" package is not installed, this is a finding.SRG-OS-000031-GPOS-00012<GroupDescription></GroupDescription>RHEL-09-412015RHEL 9 must ensure session control is automatically started at shell initialization.<VulnDiscussion>Tmux is a terminal multiplexer that enables a number of terminals to be created, accessed, and controlled from a single screen. Red Hat endorses tmux as the recommended session controlling package. - -Satisfies: SRG-OS-000031-GPOS-00012, SRG-OS-000028-GPOS-00009</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056CCI-000060Configure RHEL 9 to initialize the tmux terminal multiplexer as each shell is called by adding the following to file "/etc/profile.d/tmux.sh": - -if [ "$PS1" ]; then - parent=$(ps -o ppid= -p $$) - name=$(ps -o comm= -p $parent) - case "$name" in sshd|login) tmux ;; esac -fiVerify RHEL 9 shell initialization file is configured to start each shell with the tmux terminal multiplexer. - -Determine the location of the tmux script with the following command: - -$ sudo grep tmux /etc/bashrc /etc/profile.d/* - -/etc/profile.d/tmux.sh: case "$name" in (sshd|login) tmux ;; esac - -Review the tmux script by using the following example: - -$ cat /etc/profile.d/tmux.sh - -If [ "$PS1" ]; then -parent=$(ps -o ppid= -p $$) -name=$(ps -o comm= -p $parent) -case "$name" in (sshd|login) tmux ;; esac -fi - -If the shell file is not configured as the example above, is commented out, or is missing, this is a finding. - -Determine if tmux is currently running with the following command: - -$ sudo ps all | grep tmux | grep -v grep - -If the command does not produce output, this is a finding.SRG-OS-000028-GPOS-00009<GroupDescription></GroupDescription>RHEL-09-412020RHEL 9 must enable a user session lock until that user re-establishes access using established identification and authentication procedures for command line sessions.<VulnDiscussion>A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. - -The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 must provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056Configure RHEL 9 to enable a user to manually initiate a session lock via tmux. This configuration binds the uppercase letter "X" to manually initiate a session lock after the prefix key "Ctrl + b" has been sent. The complete key sequence is thus "Ctrl + b" then "Shift + x" to lock tmux. - -Create a global configuration file "/etc/tmux.conf" and add the following lines: - -set -g lock-command vlock -bind X lock-session - -Reload tmux configuration to take effect. This can be performed in tmux while it is running: - -$ tmux source-file /etc/tmux.confVerify RHEL 9 enables the user to initiate a session lock with the following command: - -$ sudo grep -Ei 'lock-command|lock-session' /etc/tmux.conf - -set -g lock-command vlock -bind X lock-session - -If the "lock-command" is not set and "lock-session" is not bound to a specific keyboard key in the global settings, this is a finding.SRG-OS-000029-GPOS-00010<GroupDescription></GroupDescription>RHEL-09-412025RHEL 9 must automatically lock command line user sessions after 15 minutes of inactivity.<VulnDiscussion>A session time-out lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not logout because of the temporary nature of the absence. Rather than relying on the user to manually lock their operating system session prior to vacating the vicinity, tmux can be configured to identify when a user's session has idled and take action to initiate a session lock. - -Satisfies: SRG-OS-000029-GPOS-00010, SRG-OS-000031-GPOS-00012</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000057CCI-000060Configure RHEL 9 to enforce session lock after a period of 15 minutes of inactivity by adding the following line to the "/etc/tmux.conf" global configuration file: - -set -g lock-after-time 900Verify RHEL 9 initiates a session lock after 15 minutes of inactivity. - -Check the value of the system inactivity timeout with the following command: - -$ grep -i lock-after-time /etc/tmux.conf - -set -g lock-after-time 900 - -If "lock-after-time" is not set to "900" or less in the global tmux configuration file to enforce session lock after inactivity, this is a finding.SRG-OS-000324-GPOS-00125<GroupDescription></GroupDescription>RHEL-09-412030RHEL 9 must prevent users from disabling session control mechanisms.<VulnDiscussion>The session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, RHEL 9 must provide users with the ability to manually invoke a session lock so users can secure their session if it is necessary to temporarily vacate the immediate physical vicinity. - -Satisfies: SRG-OS-000324-GPOS-00125, SRG-OS-000028-GPOS-00009</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000056CCI-002235Configure RHEL 9 to prevent users from disabling the tmux terminal multiplexer by editing the "/etc/shells" configuration file to remove any instances of tmux.Verify RHEL 9 prevents users from disabling the tmux terminal multiplexer with the following command: - -$ grep -i tmux /etc/shells - -If any output is produced, this is a finding.SRG-OS-000163-GPOS-00072<GroupDescription></GroupDescription>RHEL-09-412035RHEL 9 must automatically exit interactive command shell user sessions after 15 minutes of inactivity.<VulnDiscussion>Terminating an idle interactive command shell user session within a short time period reduces the window of opportunity for unauthorized personnel to take control of it when left unattended in a virtual terminal or physical console. - -Satisfies: SRG-OS-000163-GPOS-00072, SRG-OS-000029-GPOS-00010</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000057CCI-001133Configure RHEL 9 to exit interactive command shell user sessions after 15 minutes of inactivity. - -Add or edit the following line in "/etc/profile.d/tmout.sh": - -#!/bin/bash - -declare -xr TMOUT=900Verify RHEL 9 is configured to exit interactive command shell user sessions after 15 minutes of inactivity or less with the following command: - -$ sudo grep -i tmout /etc/profile /etc/profile.d/*.sh - -/etc/profile.d/tmout.sh:declare -xr TMOUT=900 - -If "TMOUT" is not set to "900" or less in a script located in the "/etc/'profile.d/ directory, is missing or is commented out, this is a finding.SRG-OS-000027-GPOS-00008<GroupDescription></GroupDescription>RHEL-09-412040RHEL 9 must limit the number of concurrent sessions to ten for all accounts and/or account types.<VulnDiscussion>Operating system management includes the ability to control the number of users and user sessions that utilize an operating system. Limiting the number of allowed users and sessions per user is helpful in reducing the risks related to denial-of-service (DoS) attacks. - -This requirement addresses concurrent sessions for information system accounts and does not address concurrent sessions by single users via multiple system accounts. The maximum number of concurrent sessions must be defined based on mission needs and the operational environment for each system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000054Configure RHEL 9 to limit the number of concurrent sessions to "10" for all accounts and/or account types. - -Add the following line to the top of the /etc/security/limits.conf or in a ".conf" file defined in /etc/security/limits.d/: - -* hard maxlogins 10Verify RHEL 9 limits the number of concurrent sessions to "10" for all accounts and/or account types with the following command: - -$ grep -r -s maxlogins /etc/security/limits.conf /etc/security/limits.d/*.conf - -/etc/security/limits.conf:* hard maxlogins 10 - -This can be set as a global domain (with the * wildcard) but may be set differently for multiple domains. - -If the "maxlogins" item is missing, commented out, or the value is set greater than "10" and is not documented with the information system security officer (ISSO) as an operational requirement for all domains that have the "maxlogins" item assigned, this is a finding.SRG-OS-000021-GPOS-00005<GroupDescription></GroupDescription>RHEL-09-412045RHEL 9 must log username information when unsuccessful logon attempts occur.<VulnDiscussion>Without auditing of these events, it may be harder or impossible to identify what an attacker did after an attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044Configure RHEL 9 to log username information when unsuccessful logon attempts occur. - -Add/modify the "/etc/security/faillock.conf" file to match the following line: - -auditVerify the "/etc/security/faillock.conf" file is configured to log username information when unsuccessful logon attempts occur with the following command: - -$ grep audit /etc/security/faillock.conf - -audit - -If the "audit" option is not set, is missing, or is commented out, this is a finding.SRG-OS-000480-GPOS-00226<GroupDescription></GroupDescription>RHEL-09-412050RHEL 9 must enforce a delay of at least four seconds between logon prompts following a failed logon attempt.<VulnDiscussion>Increasing the time between a failed authentication attempt and reprompting to enter credentials helps to slow a single-threaded brute force attack.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the RHEL 9 to enforce a delay of at least four seconds between logon prompts following a failed console logon attempt. - -Modify the "/etc/login.defs" file to set the "FAIL_DELAY" parameter to 4 or greater: - -FAIL_DELAY 4Verify RHEL 9 enforces a delay of at least four seconds between console logon prompts following a failed logon attempt with the following command: - -$ grep -i fail_delay /etc/login.defs - -FAIL_DELAY 4 - -If the value of "FAIL_DELAY" is not set to "4" or greater, or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00228<GroupDescription></GroupDescription>RHEL-09-412055RHEL 9 must define default permissions for the bash shell.<VulnDiscussion>The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system. - -Satisfies: SRG-OS-000480-GPOS-00228, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to define default permissions for all authenticated users using the bash shell. - -Add or edit the lines for the "umask" parameter in the "/etc/bashrc" file to "077": - -umask 077Verify the "umask" setting is configured correctly in the "/etc/bashrc" file with the following command: - -Note: If the value of the "umask" parameter is set to "000" "/etc/bashrc" file, the Severity is raised to a CAT I. - -$ grep umask /etc/bashrc - -umask 077 -umask 077 - -If the value for the "umask" parameter is not "077", or the "umask" parameter is missing or is commented out, this is a finding.SRG-OS-000480-GPOS-00228<GroupDescription></GroupDescription>RHEL-09-412060RHEL 9 must define default permissions for the c shell.<VulnDiscussion>The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system. - -Satisfies: SRG-OS-000480-GPOS-00228, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to define default permissions for all authenticated users using the c shell. - -Add or edit the lines for the "umask" parameter in the "/etc/csh.cshrc" file to "077": - -umask 077Verify the "umask" setting is configured correctly in the "/etc/csh.cshrc" file with the following command: - -Note: If the value of the "umask" parameter is set to "000" "/etc/csh.cshrc" file, the Severity is raised to a CAT I. - -$ grep umask /etc/csh.cshrc - -umask 077 -umask 077 - -If the value for the "umask" parameter is not "077", or the "umask" parameter is missing or is commented out, this is a finding.SRG-OS-000480-GPOS-00228<GroupDescription></GroupDescription>RHEL-09-412065RHEL 9 must define default permissions for all authenticated users in such a way that the user can only read and modify their own files.<VulnDiscussion>Setting the most restrictive default permissions ensures that when new accounts are created, they do not have unnecessary access.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to define default permissions for all authenticated users in such a way that the user can only read and modify their own files. - -Add or edit the lines for the "UMASK" parameter in the "/etc/login.defs" file to "077": - -UMASK 077Verify RHEL 9 defines default permissions for all authenticated users in such a way that the user can only read and modify their own files with the following command: - -Note: If the value of the "UMASK" parameter is set to "000" in "/etc/login.defs" file, the Severity is raised to a CAT I. - -# grep -i umask /etc/login.defs - -UMASK 077 - -If the value for the "UMASK" parameter is not "077", or the "UMASK" parameter is missing or is commented out, this is a finding.SRG-OS-000480-GPOS-00228<GroupDescription></GroupDescription>RHEL-09-412070RHEL 9 must define default permissions for the system default profile.<VulnDiscussion>The umask controls the default access mode assigned to newly created files. A umask of 077 limits new files to mode 600 or less permissive. Although umask can be represented as a four-digit number, the first digit representing special access modes is typically ignored or required to be "0". This requirement applies to the globally configured system defaults and the local interactive user defaults for each account on the system. - -Satisfies: SRG-OS-000480-GPOS-00228, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to define default permissions for all authenticated users in such a way that the user can only read and modify their own files. - -Add or edit the lines for the "umask" parameter in the "/etc/profile" file to "077": - -umask 077Verify the "umask" setting is configured correctly in the "/etc/profile" file with the following command: - -Note: If the value of the "umask" parameter is set to "000" "/etc/profile" file, the Severity is raised to a CAT I. - -$ grep umask /etc/profile - -umask 077 - -If the value for the "umask" parameter is not "077", or the "umask" parameter is missing or is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-412075RHEL 9 must display the date and time of the last successful account logon upon logon.<VulnDiscussion>Users need to be aware of activity that occurs regarding their account. Providing users with information regarding the number of unsuccessful attempts that were made to login to their account allows the user to determine if any unauthorized activity has occurred and gives them an opportunity to notify administrators.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to provide users with feedback on when account accesses last occurred by setting the required configuration options in "/etc/pam.d/postlogin". - -Add the following line to the top of "/etc/pam.d/postlogin": - -session required pam_lastlog.so showfailedVerify users are provided with feedback on when account accesses last occurred with the following command: - -$ sudo grep pam_lastlog /etc/pam.d/postlogin - -session required pam_lastlog.so showfailed - -If "pam_lastlog" is missing from "/etc/pam.d/postlogin" file, or the silent option is present, this is a finding.SRG-OS-000163-GPOS-00072<GroupDescription></GroupDescription>RHEL-09-412080RHEL 9 must terminate idle user sessions.<VulnDiscussion>Terminating an idle session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001133Configure RHEL 9 to log out idle sessions by editing the /etc/systemd/logind.conf file with the following line: - -StopIdleSessionSec=900 - -The "logind" service must be restarted for the changes to take effect. To restart the "logind" service, run the following command: - -$ sudo systemctl restart systemd-logind - -Note: To preserve running user programs such as tmux, uncomment and/or edit "KillUserProccesses=no" in "/etc/systemd/logind.conf".Verify that RHEL 9 logs out sessions that are idle for 15 minutes with the following command: - -$ sudo grep -i ^StopIdleSessionSec /etc/systemd/logind.conf - -StopIdleSessionSec=900 - -If "StopIdleSessionSec" is not configured to "900" seconds, this is a finding.SRG-OS-000445-GPOS-00199<GroupDescription></GroupDescription>RHEL-09-431010RHEL 9 must use a Linux Security Module configured to enforce limits on system services.<VulnDiscussion>Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. - -This requirement applies to operating systems performing security function verification/testing and/or systems and environments that require this functionality. - -Satisfies: SRG-OS-000445-GPOS-00199, SRG-OS-000134-GPOS-00068</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001084CCI-002696Configure RHEL 9 to verify correct operation of security functions. - -Edit the file "/etc/selinux/config" and add or modify the following line: - - SELINUX=enforcing - -A reboot is required for the changes to take effect.Ensure that RHEL 9 verifies correct operation of security functions through the use of SELinux with the following command: - -$ getenforce - -Enforcing - -If SELINUX is not set to "Enforcing", this is a finding. - -Verify that SELinux is configured to be enforcing at boot. - -grep "SELINUX=" /etc/selinux/config -# SELINUX= can take one of these three values: -# NOTE: In earlier Fedora kernel builds, SELINUX=disabled would also -SELINUX=enforcing - -If SELINUX line is missing, commented out, or not set to "enforcing", this is a finding.SRG-OS-000445-GPOS-00199<GroupDescription></GroupDescription>RHEL-09-431015RHEL 9 must enable the SELinux targeted policy.<VulnDiscussion>Setting the SELinux policy to "targeted" or a more specialized policy ensures the system will confine processes that are likely to be targeted for exploitation, such as network or system services. - -Note: During the development or debugging of SELinux modules, it is common to temporarily place nonproduction systems in "permissive" mode. In such temporary cases, SELinux policies should be developed, and once work is completed, the system should be reconfigured to "targeted".</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002696Configure RHEL 9 to use the targetd SELINUX policy. - -Edit the file "/etc/selinux/config" and add or modify the following line: - - SELINUXTYPE=targeted - -A reboot is required for the changes to take effect.Verify the SELINUX on RHEL 9 is using the targeted policy with the following command: - -$ sestatus | grep policy - -Loaded policy name: targeted - -If the loaded policy name is not "targeted", this is a finding.SRG-OS-000021-GPOS-00005<GroupDescription></GroupDescription>RHEL-09-431020RHEL 9 must configure SELinux context type to allow the use of a nondefault faillock tally directory.<VulnDiscussion>Not having the correct SELinux context on the faillock directory may lead to unauthorized access to the directory.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044Configure RHEL 9 to allow the use of a nondefault faillock tally directory while SELinux enforces a targeted policy. - -Create a nondefault faillock tally directory (if it does not already exist) with the following example: - -$ sudo mkdir /var/log/faillock - -Update the /etc/selinux/targeted/contexts/files/file_contexts.local with "faillog_t" context type for the nondefault faillock tally directory with the following command: - -$ sudo semanage fcontext -a -t faillog_t "/var/log/faillock(/.*)?" - -Next, update the context type of the nondefault faillock directory/subdirectories and files with the following command: - -$ sudo restorecon -R -v /var/log/faillockVerify the location of the nondefault tally directory for the pam_faillock module with the following command: - -Note: If the system does not have SELinux enabled and enforcing a targeted policy, or if the pam_faillock module is not configured for use, this requirement is Not Applicable. - -$ grep 'dir =' /etc/security/faillock.conf - -dir = /var/log/faillock - -Check the security context type of the nondefault tally directory with the following command: - -$ ls -Zd /var/log/faillock - -unconfined_u:object_r:faillog_t:s0 /var/log/faillock - -If the security context type of the nondefault tally directory is not "faillog_t", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-431025RHEL 9 must have policycoreutils package installed.<VulnDiscussion>Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. - -Policycoreutils contains the policy core utilities that are required for basic operation of an SELinux-enabled system. These utilities include load_policy to load SELinux policies, setfile to label filesystems, newrole to switch roles, and run_init to run /etc/init.d scripts in the proper context. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000134-GPOS-00068</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001084The policycoreutils package can be installed with the following command: - -$ sudo dnf install policycoreutilsVerify RHEL 9 has the policycoreutils package installed with the following command: - -$ sudo dnf list --installed policycoreutils - -Example output: - -policycoreutils.x86_64 3.3-6.el9_0 - -If the "policycoreutils" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-431030RHEL 9 policycoreutils-python-utils package must be installed.<VulnDiscussion>The policycoreutils-python-utils package is required to operate and manage an SELinux environment and its policies. It provides utilities such as semanage, audit2allow, audit2why, chcat, and sandbox.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Install the policycoreutils-python-utils service package (if the policycoreutils-python-utils service is not already installed) with the following command: - -$ sudo dnf install policycoreutils-python-utilsVerify that RHEL 9 policycoreutils-python-utils service package is installed with the following command: - -$ sudo dnf list --installed policycoreutils-python-utils - -Example output: - -policycoreutils-python-utils.noarch 3.3-6.el9_0 - -If the "policycoreutils-python-utils" package is not installed, this is a finding.SRG-OS-000324-GPOS-00125<GroupDescription></GroupDescription>RHEL-09-432010RHEL 9 must have the sudo package installed.<VulnDiscussion>"sudo" is a program designed to allow a system administrator to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow system users to get their work done.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002235The sudo package can be installed with the following command: - -$ sudo dnf install sudoVerify that RHEL 9 sudo package is installed with the following command: - -$ sudo dnf list --installed sudo - -Example output: - -sudo.x86_64 1.9.5p2-7.el9 - -If the "sudo" package is not installed, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-09-432015RHEL 9 must require reauthentication when using the "sudo" command.<VulnDiscussion>Without reauthentication, users may access resources or perform tasks for which they do not have authorization. - -When operating systems provide the capability to escalate a functional capability, it is critical the organization requires the user to reauthenticate when using the "sudo" command. - -If the value is set to an integer less than "0", the user's time stamp will not expire and the user will not have to reauthenticate for privileged actions until the user's session is terminated.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002038Configure RHEL 9 to reauthenticate "sudo" commands after the specified timeout: - -Add the following line to "/etc/sudoers": - -Defaults timestamp_timeout=0Verify RHEL 9 requires reauthentication when using the "sudo" command to elevate privileges with the following command: - -$ sudo grep -ir 'timestamp_timeout' /etc/sudoers /etc/sudoers.d/* - -/etc/sudoers:Defaults timestamp_timeout=0 - -If results are returned from more than one file location, this is a finding. - -If "timestamp_timeout" is set to a negative number, is commented out, or no results are returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-432020RHEL 9 must use the invoking user's password for privilege escalation when using "sudo".<VulnDiscussion>If the rootpw, targetpw, or runaspw flags are defined and not disabled, by default the operating system will prompt the invoking user for the "root" user password.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Define the following in the Defaults section of the /etc/sudoers file or a single configuration file in the /etc/sudoers.d/ directory: - -Defaults !targetpw -Defaults !rootpw -Defaults !runaspwVerify that the sudoers security policy is configured to use the invoking user's password for privilege escalation with the following command: - -$ sudo egrep -ir '(!rootpw|!targetpw|!runaspw)' /etc/sudoers /etc/sudoers.d/* | grep -v '#' - -/etc/sudoers:Defaults !targetpw -/etc/sudoers:Defaults !rootpw -/etc/sudoers:Defaults !runaspw - -If no results are returned, this is a finding. - -If results are returned from more than one file location, this is a finding. - -If "Defaults !targetpw" is not defined, this is a finding. - -If "Defaults !rootpw" is not defined, this is a finding. - -If "Defaults !runaspw" is not defined, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-09-432025RHEL 9 must require users to reauthenticate for privilege escalation.<VulnDiscussion>Without reauthentication, users may access resources or perform tasks for which they do not have authorization. - -When operating systems provide the capability to escalate a functional capability, it is critical that the user reauthenticate. - -Satisfies: SRG-OS-000373-GPOS-00156, SRG-OS-000373-GPOS-00157, SRG-OS-000373-GPOS-00158</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002038Configure RHEL 9 to not allow users to execute privileged actions without authenticating. - -Remove any occurrence of "!authenticate" found in "/etc/sudoers" file or files in the "/etc/sudoers.d" directory. - -$ sudo sed -i '/\!authenticate/ s/^/# /g' /etc/sudoers /etc/sudoers.d/*Verify that "/etc/sudoers" has no occurrences of "!authenticate" with the following command: - -$ sudo grep -ir '!authenticate' /etc/sudoers /etc/sudoers.d/* - -If any occurrences of "!authenticate" are returned, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-432030RHEL 9 must restrict privilege elevation to authorized personnel.<VulnDiscussion>If the "sudoers" file is not configured correctly, any user defined on the system can initiate privileged actions on the target system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove the following entries from the /etc/sudoers file or configuration file under /etc/sudoers.d/: - -ALL ALL=(ALL) ALL -ALL ALL=(ALL:ALL) ALLVerify RHEL 9 restricts privilege elevation to authorized personnel with the following command: - -$ sudo sh -c 'grep -iw ALL /etc/sudoers /etc/sudoers.d/*' - -If the either of the following entries are returned, this is a finding: -ALL ALL=(ALL) ALL -ALL ALL=(ALL:ALL) ALLSRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-09-432035RHEL 9 must restrict the use of the "su" command.<VulnDiscussion>The "su" program allows to run commands with a substitute user and group ID. It is commonly used to run commands as the root user. Limiting access to such commands is considered a good security practice. - -Satisfies: SRG-OS-000373-GPOS-00156, SRG-OS-000312-GPOS-00123</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002038CCI-002165Configure RHEL 9 to require users to be in the "wheel" group to run "su" command. - -In file "/etc/pam.d/su", uncomment the following line: - -"#auth required pam_wheel.so use_uid" - -$ sed '/^[[:space:]]*#[[:space:]]*auth[[:space:]]\+required[[:space:]]\+pam_wheel\.so[[:space:]]\+use_uid$/s/^[[:space:]]*#//' -i /etc/pam.d/su - -If necessary, create a "wheel" group and add administrative users to the group.Verify that RHEL 9 requires uses to be members of the "wheel" group with the following command: - -$ grep pam_wheel /etc/pam.d/su - -auth required pam_wheel.so use_uid - -If a line for "pam_wheel.so" does not exist, or is commented out, this is a finding.SRG-OS-000370-GPOS-00155<GroupDescription></GroupDescription>RHEL-09-433010RHEL 9 fapolicy module must be installed.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as allowlisting. - -Utilizing an allowlist provides a configuration management method for allowing the execution of only authorized software. Using only authorized software decreases risk by limiting the number of potential vulnerabilities. Verification of allowlisted software occurs prior to execution or at system startup. - -User home directories/folders may contain information of a sensitive nature. Nonprivileged users should coordinate any sharing of information with an SA through shared resources. - -RHEL 9 ships with many optional packages. One such package is a file access policy daemon called "fapolicyd". "fapolicyd" is a userspace daemon that determines access rights to files based on attributes of the process and file. It can be used to either blocklist or allowlist processes or file access. - -Proceed with caution with enforcing the use of this daemon. Improper configuration may render the system nonfunctional. The "fapolicyd" API is not namespace aware and can cause issues when launching or running containers. - -Satisfies: SRG-OS-000370-GPOS-00155, SRG-OS-000368-GPOS-00154</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764CCI-001774The fapolicyd package can be installed with the following command: - -$ sudo dnf install fapolicydVerify that RHEL 9 fapolicyd package is installed with the following command: - -$ sudo dnf list --installed fapolicyd - -Example output: - -fapolicyd.x86_64 1.1-103.el9_0 - -If the "fapolicyd" package is not installed, this is a finding.SRG-OS-000370-GPOS-00155<GroupDescription></GroupDescription>RHEL-09-433015RHEL 9 fapolicy module must be enabled.<VulnDiscussion>The organization must identify authorized software programs and permit execution of authorized software. The process used to identify software programs that are authorized to execute on organizational information systems is commonly referred to as allowlisting. - -Utilizing an allowlist provides a configuration management method for allowing the execution of only authorized software. Using only authorized software decreases risk by limiting the number of potential vulnerabilities. Verification of allowlisted software occurs prior to execution or at system startup. - -User home directories/folders may contain information of a sensitive nature. Nonprivileged users should coordinate any sharing of information with an SA through shared resources. - -RHEL 9 ships with many optional packages. One such package is a file access policy daemon called "fapolicyd". "fapolicyd" is a userspace daemon that determines access rights to files based on attributes of the process and file. It can be used to either blocklist or allowlist processes or file access. - -Proceed with caution with enforcing the use of this daemon. Improper configuration may render the system nonfunctional. The "fapolicyd" API is not namespace aware and can cause issues when launching or running containers. - -Satisfies: SRG-OS-000370-GPOS-00155, SRG-OS-000368-GPOS-00154</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001764CCI-001774Enable the fapolicyd with the following command: - -$ systemctl enable --now fapolicydVerify that RHEL 9 fapolicyd is active with the following command: - -$ systemctl is-active fapolicyd - -active - -If fapolicyd module is not active, this is a finding.SRG-OS-000069-GPOS-00037<GroupDescription></GroupDescription>RHEL-09-611010RHEL 9 must ensure the password complexity module in the system-auth file is configured for three retries or less.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. "pwquality" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system. - -RHEL 9 uses "pwquality" as a mechanism to enforce password complexity. This is set in both: -/etc/pam.d/password-auth -/etc/pam.d/system-auth - -By limiting the number of attempts to meet the pwquality module complexity requirements before returning with an error, the system will audit abnormal attempts at password changes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000192Configure RHEL 9 to limit the "pwquality" retry option to "3". - -Add the following line to the "/etc/pam.d/system-auth" file (or modify the line to have the required value): - -password required pam_pwquality.so retry=3Verify RHEL 9 is configured to limit the "pwquality" retry option to "3". - -Check for the use of the "pwquality" retry option in the system-auth file with the following command: - -$ cat /etc/pam.d/system-auth | grep pam_pwquality - -password required pam_pwquality.so retry=3 - -If the value of "retry" is set to "0" or greater than "3", or is missing, this is a finding.SRG-OS-000077-GPOS-00045<GroupDescription></GroupDescription>RHEL-09-611015RHEL 9 must be configured in the password-auth file to prohibit password reuse for a minimum of five generations.<VulnDiscussion>Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements. - -RHEL 9 uses "pwhistory" consecutively as a mechanism to prohibit password reuse. This is set in both: -/etc/pam.d/password-auth -/etc/pam.d/system-auth - -Note that manual changes to the listed files may be overwritten by the "authselect" program.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000200Configure the RHEL 9 password-auth file to prohibit password reuse for a minimum of five generations. - -Add the following line in "/etc/pam.d/password-auth" (or modify the line to have the required value): - -password required pam_pwhistory.so use_authtok remember=5 retry=3Verify RHEL 9 is configured in the password-auth file to prohibit password reuse for a minimum of five generations with the following command: - -$ grep -i remember /etc/pam.d/password-auth - -password required pam_pwhistory.so use_authtok remember=5 retry=3 - -If the line containing "pam_pwhistory.so" does not have the "remember" module argument set, is commented out, or the value of the "remember" module argument is set to less than "5", this is a finding.SRG-OS-000077-GPOS-00045<GroupDescription></GroupDescription>RHEL-09-611020RHEL 9 must be configured in the system-auth file to prohibit password reuse for a minimum of five generations.<VulnDiscussion>Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to reuse their password consecutively when that password has exceeded its defined lifetime, the end result is a password that is not changed per policy requirements. - -RHEL 9 uses "pwhistory" consecutively as a mechanism to prohibit password reuse. This is set in both: -/etc/pam.d/password-auth -/etc/pam.d/system-auth - -Note that manual changes to the listed files may be overwritten by the "authselect" program.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000200Configure the RHEL 9 system-auth file to prohibit password reuse for a minimum of five generations. - -Add the following line in "/etc/pam.d/system-auth" (or modify the line to have the required value): - -password required pam_pwhistory.so use_authtok remember=5 retry=3Verify RHEL 9 is configured in the system-auth file to prohibit password reuse for a minimum of five generations with the following command: - -$ grep -i remember /etc/pam.d/system-auth - -password required pam_pwhistory.so use_authtok remember=5 retry=3 - -If the line containing "pam_pwhistory.so" does not have the "remember" module argument set, is commented out, or the value of the "remember" module argument is set to less than "5", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-611025RHEL 9 must not allow blank or null passwords.<VulnDiscussion>If an account has an empty password, anyone could log in and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Remove any instances of the "nullok" option in the "/etc/pam.d/password-auth" and "/etc/pam.d/system-auth" files to prevent logons with empty passwords. - -Note: Manual changes to the listed file may be overwritten by the "authselect" program.Verify that null passwords cannot be used with the following command: - -$ sudo grep -i nullok /etc/pam.d/system-auth /etc/pam.d/password-auth - -If output is produced, this is a finding.SRG-OS-000021-GPOS-00005<GroupDescription></GroupDescription>RHEL-09-611030RHEL 9 must configure the use of the pam_faillock.so module in the /etc/pam.d/system-auth file.<VulnDiscussion>If the pam_faillock.so module is not loaded, the system will not correctly lockout accounts to prevent password guessing attacks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044Configure RHEL 9 to include the use of the pam_faillock.so module in the /etc/pam.d/system-auth file. - -Add/modify the appropriate sections of the "/etc/pam.d/system-auth" file to match the following lines: -Note: The "preauth" line must be listed before pam_unix.so. - -auth required pam_faillock.so preauth -auth required pam_faillock.so authfail -account required pam_faillock.soVerify the pam_faillock.so module is present in the "/etc/pam.d/system-auth" file: - -$ grep pam_faillock.so /etc/pam.d/system-auth - -auth required pam_faillock.so preauth -auth required pam_faillock.so authfail -account required pam_faillock.so - -If the pam_faillock.so module is not present in the "/etc/pam.d/system-auth" file with the "preauth" line listed before pam_unix.so, this is a finding.SRG-OS-000021-GPOS-00005<GroupDescription></GroupDescription>RHEL-09-611035RHEL 9 must configure the use of the pam_faillock.so module in the /etc/pam.d/password-auth file.<VulnDiscussion>If the pam_faillock.so module is not loaded, the system will not correctly lockout accounts to prevent password guessing attacks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000044Configure RHEL 9 to include the use of the pam_faillock.so module in the /etc/pam.d/password-auth file. - -Add/modify the appropriate sections of the "/etc/pam.d/password-auth" file to match the following lines: -Note: The "preauth" line must be listed before pam_unix.so. - -auth required pam_faillock.so preauth -auth required pam_faillock.so authfail -account required pam_faillock.soVerify the pam_faillock.so module is present in the "/etc/pam.d/password-auth" file: - -$ grep pam_faillock.so /etc/pam.d/password-auth - -auth required pam_faillock.so preauth -auth required pam_faillock.so authfail -account required pam_faillock.so - -If the pam_faillock.so module is not present in the "/etc/pam.d/password-auth" file with the "preauth" line listed before pam_unix.so, this is a finding.SRG-OS-000069-GPOS-00037<GroupDescription></GroupDescription>RHEL-09-611040RHEL 9 must ensure the password complexity module is enabled in the password-auth file.<VulnDiscussion>Enabling PAM password complexity permits enforcement of strong passwords and consequently makes the system less prone to dictionary attacks. - -Satisfies: SRG-OS-000069-GPOS-00037, SRG-OS-000070-GPOS-00038, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000192CCI-000193CCI-000366Configure RHEL 9 to use "pwquality" to enforce password complexity rules. - -Add the following line to the "/etc/pam.d/password-auth" file (or modify the line to have the required value): - -password required pam_pwquality.soVerify RHEL 9 uses "pwquality" to enforce the password complexity rules in the password-auth file with the following command: - -$ cat /etc/pam.d/password-auth | grep pam_pwquality - -password required pam_pwquality.so - -If the command does not return a line containing the value "pam_pwquality.so", or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-611045RHEL 9 must ensure the password complexity module is enabled in the system-auth file.<VulnDiscussion>Enabling PAM password complexity permits enforcement of strong passwords and consequently makes the system less prone to dictionary attacks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to use "pwquality" to enforce password complexity rules. - -Add the following line to the "/etc/pam.d/system-auth" file(or modify the line to have the required value): - -password required pam_pwquality.soVerify RHEL 9 uses "pwquality" to enforce the password complexity rules in the system-auth file with the following command: - -$ cat /etc/pam.d/system-auth | grep pam_pwquality - -password required pam_pwquality.so - -If the command does not return a line containing the value "pam_pwquality.so", or the line is commented out, this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-09-611050RHEL 9 password-auth must be configured to use a sufficient number of hashing rounds.<VulnDiscussion>Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text. - -Using more hashing rounds makes password cracking attacks more difficult. - -Satisfies: SRG-OS-000073-GPOS-00041, SRG-OS-000120-GPOS-00061</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000196CCI-000803Configure Red Hat Enterprise Linux 9 to use 5000 hashing rounds for hashing passwords. - -Add or modify the following line in "/etc/pam.d/password-auth" and set "rounds" to "5000". - -password sufficient pam_unix.so sha512 rounds=5000Verify the number of rounds for the password hashing algorithm is configured with the following command: - -$ sudo grep rounds /etc/pam.d/password-auth - -password sufficient pam_unix.so sha512 rounds=5000 - -If a matching line is not returned or "rounds" is less than "5000", this a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-09-611055RHEL 9 system-auth must be configured to use a sufficient number of hashing rounds.<VulnDiscussion>Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text. - -Using more hashing rounds makes password cracking attacks more difficult. - -Satisfies: SRG-OS-000073-GPOS-00041, SRG-OS-000120-GPOS-00061</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000196CCI-000803Configure Red Hat Enterprise Linux 9 to use 5000 hashing rounds for hashing passwords. - -Add or modify the following line in "/etc/pam.d/system-auth" and set "rounds" to 5000. - -password sufficient pam_unix.so sha512 rounds=5000'Verify the number of rounds for the password hashing algorithm is configured with the following command: - -$ sudo grep rounds /etc/pam.d/system-auth - -password sufficient pam_unix.so sha512 rounds=5000 - -If a matching line is not returned or "rounds" is less than 5000, this a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-09-611060RHEL 9 must enforce password complexity rules for the root account.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. - -Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. - -Satisfies: SRG-OS-000072-GPOS-00040, SRG-OS-000071-GPOS-00039, SRG-OS-000070-GPOS-00038, SRG-OS-000266-GPOS-00101, SRG-OS-000078-GPOS-00046, SRG-OS-000480-GPOS-00225, SRG-OS-000069-GPOS-00037</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000192CCI-000193CCI-000194CCI-000195CCI-000205CCI-000366CCI-001619Configure RHEL 9 to enforce password complexity on the root account. - -Add or update the following line in /etc/security/pwquality.conf: - -enforce_for_rootVerify that RHEL 9 enforces password complexity rules for the root account. - -Check if root user is required to use complex passwords with the following command: - -$ grep enforce_for_root /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf - -/etc/security/pwquality.conf:enforce_for_root - -If "enforce_for_root" is commented or missing, this is a finding.SRG-OS-000070-GPOS-00038<GroupDescription></GroupDescription>RHEL-09-611065RHEL 9 must enforce password complexity by requiring that at least one lowercase character be used.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. - -Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring a minimum number of lowercase characters makes password guessing attacks more difficult by ensuring a larger search space.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000193Configure RHEL 9 to enforce password complexity by requiring at least one lowercase character be used by setting the "lcredit" option. - -Add the following line to "/etc/security/pwquality.conf" (or modify the line to have the required value): - -lcredit = -1Verify that RHEL 9 enforces password complexity by requiring at least one lowercase character. - -Check the value for "lcredit" with the following command: - -$ sudo grep lcredit /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf - -/etc/security/pwquality.conf:lcredit = -1 - -If the value of "lcredit" is a positive number or is commented out, this is a finding.SRG-OS-000071-GPOS-00039<GroupDescription></GroupDescription>RHEL-09-611070RHEL 9 must enforce password complexity by requiring that at least one numeric character be used.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. - -Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring digits makes password guessing attacks more difficult by ensuring a larger search space.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000194Configure RHEL 9 to enforce password complexity by requiring at least one numeric character be used by setting the "dcredit" option. - -Add the following line to "/etc/security/pwquality.conf" (or modify the line to have the required value): - -dcredit = -1Verify that RHEL 9 enforces password complexity by requiring at least one numeric character. - -Check the value for "dcredit" with the following command: - -$ sudo grep dcredit /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf - -/etc/security/pwquality.conf:dcredit = -1 - -If the value of "dcredit" is a positive number or is commented out, this is a finding.SRG-OS-000075-GPOS-00043<GroupDescription></GroupDescription>RHEL-09-611075RHEL 9 passwords for new users or password changes must have a 24 hours minimum password lifetime restriction in /etc/login.defs.<VulnDiscussion>Enforcing a minimum password lifetime helps to prevent repeated password changes to defeat the password reuse or history enforcement requirement. If users are allowed to immediately and continually change their password, then the password could be repeatedly changed in a short period of time to defeat the organization's policy regarding password reuse. - -Setting the minimum password age protects against users cycling back to a favorite password after satisfying the password reuse requirement.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000198Configure RHEL 9 to enforce 24 hours as the minimum password lifetime. - -Add the following line in "/etc/login.defs" (or modify the line to have the required value): - -PASS_MIN_DAYS 1Verify RHEL 9 enforces 24 hours as the minimum password lifetime for new user accounts. - -Check for the value of "PASS_MIN_DAYS" in "/etc/login.defs" with the following command: - -$ grep -i pass_min_days /etc/login.defs - -PASS_MIN_DAYS 1 - -If the "PASS_MIN_DAYS" parameter value is not "1" or greater, or is commented out, this is a finding.SRG-OS-000075-GPOS-00043<GroupDescription></GroupDescription>RHEL-09-611080RHEL 9 passwords must have a 24 hours minimum password lifetime restriction in /etc/shadow.<VulnDiscussion>Enforcing a minimum password lifetime helps to prevent repeated password changes to defeat the password reuse or history enforcement requirement. If users are allowed to immediately and continually change their password, the password could be repeatedly changed in a short period of time to defeat the organization's policy regarding password reuse.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000198Configure noncompliant accounts to enforce a 24 hour minimum password lifetime: - -$ sudo passwd -n 1 [user]Verify that RHEL 9 has configured the minimum time period between password changes for each user account as one day or greater with the following command: - -$ sudo awk -F: '$4 < 1 {print $1 " " $4}' /etc/shadow - -If any results are returned that are not associated with a system account, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-09-611085RHEL 9 must require users to provide a password for privilege escalation.<VulnDiscussion>Without reauthentication, users may access resources or perform tasks for which they do not have authorization. - -When operating systems provide the capability to escalate a functional capability, it is critical that the user reauthenticate. - -Satisfies: SRG-OS-000373-GPOS-00156, SRG-OS-000373-GPOS-00157, SRG-OS-000373-GPOS-00158</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002038Configure RHEL 9 to not allow users to execute privileged actions without authenticating with a password. - -Remove any occurrence of "NOPASSWD" found in "/etc/sudoers" file or files in the "/etc/sudoers.d" directory. - -$ sudo sed -i '/NOPASSWD/ s/^/# /g' /etc/sudoers /etc/sudoers.d/*Verify that "/etc/sudoers" has no occurrences of "NOPASSWD" with the following command: - -$ sudo grep -ri nopasswd /etc/sudoers /etc/sudoers.d/* - -If any occurrences of "NOPASSWD" are returned, this is a finding.SRG-OS-000078-GPOS-00046<GroupDescription></GroupDescription>RHEL-09-611090RHEL 9 passwords must be created with a minimum of 15 characters.<VulnDiscussion>The shorter the password, the lower the number of possible combinations that need to be tested before the password is compromised. - -Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password length is one factor of several that helps to determine strength and how long it takes to crack a password. Use of more characters in a password helps to increase exponentially the time and/or resources required to compromise the password. - -RHEL 9 uses "pwquality" as a mechanism to enforce password complexity. Configurations are set in the "etc/security/pwquality.conf" file. - -The "minlen", sometimes noted as minimum length, acts as a "score" of complexity based on the credit components of the "pwquality" module. By setting the credit components to a negative value, not only will those components be required, but they will not count toward the total "score" of "minlen". This will enable "minlen" to require a 15-character minimum. - -The DOD minimum password requirement is 15 characters.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000205Configure RHEL 9 to enforce a minimum 15-character password length. - -Add the following line to "/etc/security/pwquality.conf" (or modify the line to have the required value): - -minlen = 15Verify that RHEL 9 enforces a minimum 15-character password length with the following command: - -$ grep minlen /etc/security/pwquality.conf - -minlen = 15 - -If the command does not return a "minlen" value of "15" or greater, does not return a line, or the line is commented out, this is a finding.SRG-OS-000078-GPOS-00046<GroupDescription></GroupDescription>RHEL-09-611095RHEL 9 passwords for new users must have a minimum of 15 characters.<VulnDiscussion>The shorter the password, the lower the number of possible combinations that need to be tested before the password is compromised. - -Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password length is one factor of several that helps to determine strength and how long it takes to crack a password. Use of more characters in a password helps to increase exponentially the time and/or resources required to compromise the password. - -The DOD minimum password requirement is 15 characters.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000205Configure RHEL 9 to enforce a minimum 15-character password length for new user accounts. - -Add or modify the following line in the "/etc/login.defs" file: - -PASS_MIN_LEN 15Verify that RHEL 9 enforces a minimum 15-character password length for new user accounts by running the following command: - -$ sudo grep -i pass_min_len /etc/login.defs - -PASS_MIN_LEN 15 - -If the command does not return a "PASS_MIN_LEN" value of "15" or greater, does not return a line, or the line is commented out, this is a finding.SRG-OS-000266-GPOS-00101<GroupDescription></GroupDescription>RHEL-09-611100RHEL 9 must enforce password complexity by requiring that at least one special character be used.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. RHEL 9 utilizes "pwquality" as a mechanism to enforce password complexity. Note that to require special characters without degrading the "minlen" value, the credit value must be expressed as a negative number in "/etc/security/pwquality.conf".</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001619Configure RHEL 9 to enforce password complexity by requiring at least one special character be used by setting the "ocredit" option. - -Add the following line to "/etc/security/pwquality.conf" (or modify the line to have the required value): - -ocredit = -1Verify that RHEL 9 enforces password complexity by requiring at least one special character with the following command: - -$ sudo grep ocredit /etc/security/pwquality.conf /etc/security/pwquality.conf.d/*.conf - -ocredit = -1 - -If the value of "ocredit" is a positive number or is commented out, this is a finding.SRG-OS-000480-GPOS-00225<GroupDescription></GroupDescription>RHEL-09-611105RHEL 9 must prevent the use of dictionary words for passwords.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If RHEL 9 allows the user to select passwords based on dictionary words, this increases the chances of password compromise by increasing the opportunity for successful guesses, and brute-force attacks.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to prevent the use of dictionary words for passwords. - -Add or update the following line in the "/etc/security/pwquality.conf" file or a configuration file in the /etc/pwquality.conf.d/ directory to contain the "dictcheck" parameter: - -dictcheck=1Verify RHEL 9 prevents the use of dictionary words for passwords with the following command: - -$ sudo grep dictcheck /etc/security/pwquality.conf /etc/pwquality.conf.d/*.conf - -/etc/security/pwquality.conf:dictcheck=1 - -If "dictcheck" does not have a value other than "0", or is commented out, this is a finding.SRG-OS-000069-GPOS-00037<GroupDescription></GroupDescription>RHEL-09-611110RHEL 9 must enforce password complexity by requiring that at least one uppercase character be used.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring a minimum number of uppercase characters makes password guessing attacks more difficult by ensuring a larger search space.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000192Configure RHEL 9 to enforce password complexity by requiring that at least one uppercase character be used by setting the "ucredit" option. - -Add the following line to /etc/security/pwquality.conf (or modify the line to have the required value): - -ucredit = -1Verify that RHEL 9 enforces password complexity by requiring that at least one uppercase character. - -Check the value for "ucredit" with the following command: - -$ sudo grep ucredit /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf - -ucredit = -1 - -If the value of "ucredit" is a positive number or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-09-611115RHEL 9 must require the change of at least eight characters when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute–force attacks. - -Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring a minimum number of different characters during password changes ensures that newly changed passwords will not resemble previously compromised ones. Note that passwords changed on compromised systems will still be compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000195Configure RHEL 9 to require the change of at least eight of the total number of characters when passwords are changed by setting the "difok" option. - -Add the following line to "/etc/security/pwquality.conf" (or modify the line to have the required value): - -difok = 8Verify the value of the "difok" option in "/etc/security/pwquality.conf" with the following command: - -$ sudo grep difok /etc/security/pwquality.conf - -difok = 8 - -If the value of "difok" is set to less than "8", or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-09-611120RHEL 9 must require the maximum number of repeating characters of the same character class be limited to four when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. - -Password complexity is one factor of several that determines how long it takes to crack a password. The more complex a password, the greater the number of possible combinations that need to be tested before the password is compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000195Configure RHEL 9 to require the change of the number of repeating characters of the same character class when passwords are changed by setting the "maxclassrepeat" option. - -Add the following line to "/etc/security/pwquality.conf" conf (or modify the line to have the required value): - -maxclassrepeat = 4Verify the value of the "maxclassrepeat" option in "/etc/security/pwquality.conf" with the following command: - -$ grep maxclassrepeat /etc/security/pwquality.conf - -maxclassrepeat = 4 - -If the value of "maxclassrepeat" is set to "0", more than "4", or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-09-611125RHEL 9 must require the maximum number of repeating characters be limited to three when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. - -Password complexity is one factor of several that determines how long it takes to crack a password. The more complex a password, the greater the number of possible combinations that need to be tested before the password is compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000195Configure RHEL 9 to require the change of the number of repeating consecutive characters when passwords are changed by setting the "maxrepeat" option. - -Add the following line to "/etc/security/pwquality.conf" (or modify the line to have the required value): - -maxrepeat = 3Verify the value of the "maxrepeat" option in "/etc/security/pwquality.conf" with the following command: - -$ grep maxrepeat /etc/security/pwquality.conf - -maxrepeat = 3 - -If the value of "maxrepeat" is set to more than "3", or is commented out, this is a finding.SRG-OS-000072-GPOS-00040<GroupDescription></GroupDescription>RHEL-09-611130RHEL 9 must require the change of at least four character classes when passwords are changed.<VulnDiscussion>Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. - -Password complexity is one factor of several that determines how long it takes to crack a password. The more complex a password, the greater the number of possible combinations that need to be tested before the password is compromised.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000195Configure RHEL 9 to require the change of at least four character classes when passwords are changed by setting the "minclass" option. - -Add the following line to "/etc/security/pwquality.conf" (or modify the line to have the required value): - -minclass = 4Verify the value of the "minclass" option in "/etc/security/pwquality.conf" with the following command: - -$ grep minclass /etc/security/pwquality.conf - -minclass = 4 - -If the value of "minclass" is set to less than "4", or is commented out, this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-09-611135RHEL 9 must be configured so that user and group account administration utilities are configured to store only encrypted representations of passwords.<VulnDiscussion>Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text. - -This setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the "crypt_style" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000196Configure RHEL 9 to use the SHA-512 algorithm for password hashing. - -Add or change the following line in the "[default]" section of "/etc/libuser.conf" file: - -crypt_style = sha512Verify the user and group account administration utilities are configured to store only encrypted representations of passwords with the following command: - -# grep crypt /etc/libuser.conf - -crypt_style = sha512 - -If the "crypt_style" variable is not set to "sha512", is not in the defaults section, is commented out, or does not exist, this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-09-611140RHEL 9 must be configured to use the shadow file to store only encrypted representations of passwords.<VulnDiscussion>Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text. - -This setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the "crypt_style" configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000196Configure RHEL 9 to store only SHA512 encrypted representations of passwords. - -Add or update the following line in the "/etc/login.defs" file: - -ENCRYPT_METHOD SHA512Verify the system's shadow file is configured to store only encrypted representations of passwords with a hash value of SHA512 with the following command: - -# grep -i encrypt_method /etc/login.defs - -ENCRYPT_METHOD SHA512 - -If "ENCRYPT_METHOD" does not have a value of "SHA512", or the line is commented out, this is a finding.SRG-OS-000373-GPOS-00156<GroupDescription></GroupDescription>RHEL-09-611145RHEL 9 must not be configured to bypass password requirements for privilege escalation.<VulnDiscussion>Without reauthentication, users may access resources or perform tasks for which they do not have authorization. When operating systems provide the capability to escalate a functional capability, it is critical the user reauthenticate. - -Satisfies: SRG-OS-000373-GPOS-00156, SRG-OS-000373-GPOS-00157, SRG-OS-000373-GPOS-00158</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002038Configure the operating system to require users to supply a password for privilege escalation. - -Remove any occurrences of " pam_succeed_if " in the "/etc/pam.d/sudo" file.Verify the operating system is not configured to bypass password requirements for privilege escalation with the following command: - -$ sudo grep pam_succeed_if /etc/pam.d/sudo - -If any occurrences of "pam_succeed_if" are returned, this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-09-611150RHEL 9 shadow password suite must be configured to use a sufficient number of hashing rounds.<VulnDiscussion>Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text. - -Using more hashing rounds makes password cracking attacks more difficult. - -Satisfies: SRG-OS-000073-GPOS-00041, SRG-OS-000120-GPOS-00061</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000196CCI-000803Configure RHEL 9 to encrypt all stored passwords with a strong cryptographic hash. - -Edit/modify the following line in the "/etc/login.defs" file and set "SHA_CRYPT_MIN_ROUNDS" to a value no lower than "5000": - -SHA_CRYPT_MIN_ROUNDS 5000Verify that RHEL 9 has a minimum number of hash rounds configured with the following command: - -$ grep -i sha_crypt /etc/login.defs - -If "SHA_CRYPT_MIN_ROUNDS" or "SHA_CRYPT_MAX_ROUNDS" is less than "5000", this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-611155RHEL 9 must not have accounts configured with blank or null passwords.<VulnDiscussion>If an account has an empty password, anyone could log in and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure all accounts on RHEL 9 to have a password or lock the account with the following commands: - -Perform a password reset: - -$ sudo passwd [username] - -To lock an account: - -$ sudo passwd -l [username]Verify that null or blank passwords cannot be used with the following command: - -$ sudo awk -F: '!$2 {print $1}' /etc/shadow - -If the command returns any results, this is a finding.SRG-OS-000104-GPOS-00051<GroupDescription></GroupDescription>RHEL-09-611160RHEL 9 must use the CAC smart card driver.<VulnDiscussion>Smart card login provides two-factor authentication stronger than that provided by a username and password combination. Smart cards leverage public key infrastructure to provide and verify credentials. Configuring the smart card driver in use by the organization helps to prevent users from using unauthorized smart cards. - -Satisfies: SRG-OS-000104-GPOS-00051, SRG-OS-000106-GPOS-00053, SRG-OS-000107-GPOS-00054, SRG-OS-000109-GPOS-00056, SRG-OS-000108-GPOS-00055, SRG-OS-000112-GPOS-00057, SRG-OS-000113-GPOS-00058</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000764CCI-000766CCI-000767CCI-000768CCI-000770CCI-001941CCI-001942Configure RHEL 9 to load the CAC driver. - -Add or modify the following line in the "/etc/opensc.conf" file: - -card_drivers = cac;Verify that RHEL loads the CAC driver with the following command: - -$ grep card_drivers /etc/opensc.conf - -card_drivers = cac; - -If "cac" is not listed as a card driver, or there is no line returned for "card_drivers", this is a finding.SRG-OS-000375-GPOS-00160<GroupDescription></GroupDescription>RHEL-09-611165RHEL 9 must enable certificate based smart card authentication.<VulnDiscussion>Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. Multifactor authentication requires using two or more factors to achieve authentication. A privileged account is defined as an information system account with authorizations of a privileged user. The DOD Common Access Card (CAC) with DOD-approved PKI is an example of multifactor authentication. - -Satisfies: SRG-OS-000375-GPOS-00160, SRG-OS-000105-GPOS-00052</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000765CCI-001948Edit the file "/etc/sssd/sssd.conf" and add or edit the following line: - -pam_cert_auth = TrueVerify that RHEL 9 has smart cards are enabled in System Security Services Daemon (SSSD), run the following command: - -$ sudo grep pam_cert_auth /etc/sssd/sssd.conf - -pam_cert_auth = True - -If "pam_cert_auth" is not set to "True", the line is commented out, or the line is missing, this is a finding.SRG-OS-000375-GPOS-00160<GroupDescription></GroupDescription>RHEL-09-611170RHEL 9 must implement certificate status checking for multifactor authentication.<VulnDiscussion>Using an authentication device, such as a DOD Common Access Card (CAC) or token that is separate from the information system, ensures that even if the information system is compromised, credentials stored on the authentication device will not be affected. - -Multifactor solutions that require devices separate from information systems gaining access include, for example, hardware tokens providing time-based or challenge-response authenticators and smart cards such as the U.S. Government Personal Identity Verification (PIV) card and the DOD CAC. - -RHEL 9 includes multiple options for configuring certificate status checking, but for this requirement focuses on the System Security Services Daemon (SSSD). By default, SSSD performs Online Certificate Status Protocol (OCSP) checking and certificate verification using a sha256 digest function. - -Satisfies: SRG-OS-000375-GPOS-00160, SRG-OS-000377-GPOS-00162</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001948CCI-001954Configure RHEL 9 to implement certificate status checking for multifactor authentication. - -Review the "/etc/sssd/conf.d/certificate_verification.conf" file to determine if the system is configured to prevent OCSP or certificate verification. - -Add the following line to the "/etc/sssd/conf.d/certificate_verification.conf" file: - -certificate_verification = ocsp_dgst=sha512 - -Set the correct ownership and permissions on the "/etc/sssd/conf.d/certificate_verification.conf" file by running these commands: - -$ sudo chown root:root "/etc/sssd/conf.d/certificate_verification.conf" -$ sudo chmod 600 "/etc/sssd/conf.d/certificate_verification.conf" - -The "sssd" service must be restarted for the changes to take effect. To restart the "sssd" service, run the following command: - -$ sudo systemctl restart sssd.serviceVerify the operating system implements Online Certificate Status Protocol (OCSP) and is using the proper digest value on the system with the following command: - -$ sudo grep certificate_verification /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf | grep -v "^#" - -certificate_verification = ocsp_dgst=sha512 - -If the certificate_verification line is missing from the [sssd] section, or is missing "ocsp_dgst=sha512", ask the administrator to indicate what type of multifactor authentication is being utilized and how the system implements certificate status checking. If there is no evidence of certificate status checking being used, this is a finding.SRG-OS-000375-GPOS-00160<GroupDescription></GroupDescription>RHEL-09-611175RHEL 9 must have the pcsc-lite package installed.<VulnDiscussion>The pcsc-lite package must be installed if it is to be available for multifactor authentication using smart cards.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001948The pcsc-lite package can be installed with the following command: - -$ sudo dnf install pcsc-liteVerify that RHEL 9 has the pcsc-lite package installed with the following command: - -$ sudo dnf list --installed pcsc-lite - -Example output: - -pcsc-lite.x86_64 1.9.4-1.el9 - -If the "pcsc-lite" package is not installed, this is a finding.SRG-OS-000375-GPOS-00160<GroupDescription></GroupDescription>RHEL-09-611180The pcscd service on RHEL 9 must be active.<VulnDiscussion>The information system ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device. - -The daemon program for pcsc-lite and the MuscleCard framework is pcscd. It is a resource manager that coordinates communications with smart card readers and smart cards and cryptographic tokens that are connected to the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001948To enable the pcscd service run the following command: - -$ sudo systemctl enable --now pcscdVerify that the "pcscd" service is active with the following command: - -$ systemctl is-active pcscd - -active - -If the pcscdservice is not active, this is a finding.SRG-OS-000375-GPOS-00160<GroupDescription></GroupDescription>RHEL-09-611185RHEL 9 must have the opensc package installed.<VulnDiscussion>The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access. - -The DOD has mandated the use of the Common Access Card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems. - -Satisfies: SRG-OS-000375-GPOS-00160, SRG-OS-000376-GPOS-00161</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001948CCI-001953The opensc package can be installed with the following command: - -$ sudo dnf install openscVerify that RHEL 9 has the opensc package installed with the following command: - -$ sudo dnf list --installed opensc - -Example output: - -opensc.x86_64 0.22.0-2.el9 - -If the "opensc" package is not installed, this is a finding.SRG-OS-000067-GPOS-00035<GroupDescription></GroupDescription>RHEL-09-611190RHEL 9, for PKI-based authentication, must enforce authorized access to the corresponding private key.<VulnDiscussion>If the private key is discovered, an attacker can use the key to authenticate as an authorized user and gain access to the network infrastructure. - -The cornerstone of the PKI is the private key used to encrypt or digitally sign information. - -If the private key is stolen, this will lead to the compromise of the authentication and nonrepudiation gained through PKI because the attacker can use the private key to digitally sign documents and pretend to be the authorized user. - -Both the holders of a digital certificate and the issuing authority must protect the computers, storage devices, or whatever they use to keep the private keys.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000186Create a new private and public key pair that utilizes a passcode with the following command: - -$ sudo ssh-keygen -n [passphrase]Verify the SSH private key files have a passcode. - -For each private key stored on the system, use the following command: - -$ sudo ssh-keygen -y -f /path/to/file - -If the contents of the key are displayed, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-09-611195RHEL 9 must require authentication to access emergency mode.<VulnDiscussion>To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. - -This requirement prevents attackers with physical access from trivially bypassing security on the machine and gaining root access. Such accesses are further prevented by configuring the bootloader password.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000213Configure RHEL 9 to require authentication for emergency mode. - -Add or modify the following line in the "/usr/lib/systemd/system/emergency.service" file: - -ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergencyVerify that RHEL 9 requires authentication for emergency mode with the following command: - -$ grep sulogin /usr/lib/systemd/system/emergency.service - -ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency - -If this line is not returned, or is commented out, this is a finding. If the output is different, this is a finding.SRG-OS-000080-GPOS-00048<GroupDescription></GroupDescription>RHEL-09-611200RHEL 9 must require authentication to access single-user mode.<VulnDiscussion>To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. Successful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. - -This requirement prevents attackers with physical access from trivially bypassing security on the machine and gaining root access. Such accesses are further prevented by configuring the bootloader password.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000213Configure RHEL 9 to require authentication for single-user mode. - -Add or modify the following line in the "/usr/lib/systemd/system/rescue.service" file: - -ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescueVerify that RHEL 9 requires authentication for single-user mode with the following command: - -$ grep sulogin /usr/lib/systemd/system/rescue.service - -ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue - -If this line is not returned, or is commented out, this is a finding.SRG-OS-000120-GPOS-00061<GroupDescription></GroupDescription>RHEL-09-611205RHEL 9 must prevent system daemons from using Kerberos for authentication.<VulnDiscussion>Unapproved mechanisms used for authentication to the cryptographic module are not verified; therefore, cannot be relied upon to provide confidentiality or integrity and DOD data may be compromised. - -RHEL 9 systems utilizing encryption are required to use FIPS-compliant mechanisms for authenticating to cryptographic modules. - -The key derivation function (KDF) in Kerberos is not FIPS compatible. Ensuring the system does not have any keytab files present prevents system daemons from using Kerberos for authentication. A keytab is a file containing pairs of Kerberos principals and encrypted keys. - -FIPS 140-3 is the current standard for validating that mechanisms used to access cryptographic modules utilize authentication that meets DOD requirements. This allows for Security Levels 1, 2, 3, or 4 for use on a general-purpose computing system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000803Configure RHEL 9 to prevent system daemons from using Kerberos for authentication. - -Remove any files with the .keytab extension from the operating system. - -rm -f /etc/*.keytabVerify that RHEL 9 prevents system daemons from using Kerberos for authentication with the following command: - -$ sudo ls -al /etc/*.keytab - -ls: cannot access '/etc/*.keytab': No such file or directory - -If this command produces any "keytab" file(s), this is a finding.SRG-OS-000066-GPOS-00034<GroupDescription></GroupDescription>RHEL-09-631010RHEL 9, for PKI-based authentication, must validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.<VulnDiscussion>Without path validation, an informed trust decision by the relying party cannot be made when presented with any certificate not already explicitly trusted. - -A trust anchor is an authoritative entity represented via a public key and associated data. It is used in the context of public key infrastructures, X.509 digital certificates, and DNSSEC. - -When there is a chain of trust, usually the top entity to be trusted becomes the trust anchor; it can be, for example, a Certification Authority (CA). A certification path starts with the subject certificate and proceeds through a number of intermediate certificates up to a trusted root certificate, typically issued by a trusted CA. - -This requirement verifies that a certification path to an accepted trust anchor is used for certificate validation and that the path includes status information. Path validation is necessary for a relying party to make an informed trust decision when presented with any certificate not already explicitly trusted. Status information for certification paths includes certificate revocation lists or online certificate status protocol responses. Validation of the certificate status information is out of scope for this requirement. - -Satisfies: SRG-OS-000066-GPOS-00034, SRG-OS-000384-GPOS-00167</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000185CCI-001991Configure RHEL 9, for PKI-based authentication, to validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor. - -Obtain a valid copy of the DoD root CA file from the PKI CA certificate bundle from cyber.mil and copy the DoD_PKE_CA_chain.pem into the following file: -/etc/sssd/pki/sssd_auth_ca_db.pemVerify RHEL 9 for PKI-based authentication has valid certificates by constructing a certification path (which includes status information) to an accepted trust anchor. - -Check that the system has a valid DoD root CA installed with the following command: - -$ sudo openssl x509 -text -in /etc/sssd/pki/sssd_auth_ca_db.pem - -Example output: - -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C = US, O = U.S. Government, OU = DoD, OU = PKI, CN = DoD Root CA 3 - Validity - Not Before: Mar 20 18:46:41 2012 GMT - Not After: Dec 30 18:46:41 2029 GMT - Subject: C = US, O = U.S. Government, OU = DoD, OU = PKI, CN = DoD Root CA 3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - -If the root CA file is not a DoD-issued certificate with a valid date and installed in the "/etc/sssd/pki/sssd_auth_ca_db.pem" location, this is a finding.SRG-OS-000068-GPOS-00036<GroupDescription></GroupDescription>RHEL-09-631015RHEL 9 must map the authenticated identity to the user or group account for PKI-based authentication.<VulnDiscussion>Without mapping the certificate used to authenticate to the user account, the ability to determine the identity of the individual user or group will not be available for forensic analysis.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000187Configure RHEL 9 to map the authenticated identity to the user or group account by adding or modifying the certmap section of the "/etc/sssd/sssd.conf" file based on the following example: - -[certmap/testing.test/rule_name] -matchrule = .*EDIPI@mil -maprule = (userCertificate;binary={cert!bin}) -dmains = testing.test - -The "sssd" service must be restarted for the changes to take effect. To restart the "sssd" service, run the following command: - -$ sudo systemctl restart sssd.serviceVerify the certificate of the user or group is mapped to the corresponding user or group in the "sssd.conf" file with the following command: - -$ sudo cat /etc/sssd/sssd.conf - -[certmap/testing.test/rule_name] -matchrule =<SAN>.*EDIPI@mil -maprule = (userCertificate;binary={cert!bin}) -domains = testing.test - -If the certmap section does not exist, ask the system administrator (SA) to indicate how certificates are mapped to accounts. If there is no evidence of certificate mapping, this is a finding.SRG-OS-000383-GPOS-00166<GroupDescription></GroupDescription>RHEL-09-631020RHEL 9 must prohibit the use of cached authenticators after one day.<VulnDiscussion>If cached authentication information is out-of-date, the validity of the authentication information may be questionable.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002007Configure the SSSD to prohibit the use of cached authentications after one day. - -Add or change the following line in "/etc/sssd/sssd.conf" just below the line [pam]: - -offline_credentials_expiration = 1Verify that the System Security Services Daemon (SSSD) prohibits the use of cached authentications after one day. - -Note: If smart card authentication is not being used on the system, this requirement is Not Applicable. - -Check that SSSD allows cached authentications with the following command: - -$ sudo grep cache_credentials /etc/sssd/sssd.conf - -cache_credentials = true - -If "cache_credentials" is set to "false" or missing from the configuration file, this is not a finding and no further checks are required. - -If "cache_credentials" is set to "true", check that SSSD prohibits the use of cached authentications after one day with the following command: - -$ sudo grep offline_credentials_expiration /etc/sssd/sssd.conf - -offline_credentials_expiration = 1 - -If "offline_credentials_expiration" is not set to a value of "1", this is a finding.SRG-OS-000363-GPOS-00150<GroupDescription></GroupDescription>RHEL-09-651010RHEL 9 must have the AIDE package installed.<VulnDiscussion>Without verification of the security functions, security functions may not operate correctly, and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. - -Satisfies: SRG-OS-000363-GPOS-00150, SRG-OS-000445-GPOS-00199</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001744CCI-002696Install AIDE, initialize it, and perform a manual check. - -Install AIDE: - -$ sudo dnf install aide - -Initialize AIDE: - -$ sudo /usr/sbin/aide --init - -Example output: - -Start timestamp: 2023-06-05 10:09:04 -0600 (AIDE 0.16) -AIDE initialized database at /var/lib/aide/aide.db.new.gz - -Number of entries: 86833 - ---------------------------------------------------- -The attributes of the (uncompressed) database(s): ---------------------------------------------------- - -/var/lib/aide/aide.db.new.gz - MD5 : coZUtPHhoFoeD7+k54fUvQ== - SHA1 : DVpOEMWJwo0uPgrKZAygIUgSxeM= - SHA256 : EQiZH0XNEk001tcDmJa+5STFEjDb4MPE - TGdBJ/uvZKc= - SHA512 : 86KUqw++PZhoPK0SZvT3zuFq9yu9nnPP - toei0nENVELJ1LPurjoMlRig6q69VR8l - +44EwO9eYyy9nnbzQsfG1g== - -End timestamp: 2023-06-05 10:09:57 -0600 (run time: 0m 53s) - -The new database will need to be renamed to be read by AIDE: - -$ sudo mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz - -Perform a manual check: - -$ sudo /usr/sbin/aide --check - -Example output: - -2023-06-05 10:16:08 -0600 (AIDE 0.16) -AIDE found NO differences between database and filesystem. Looks okay!! - -...Verify that RHEL 9 has the Advanced Intrusion Detection Environment (AIDE) package installed with the following command: - -$ sudo dnf list --installed aide - -Example output: - -aide.x86_64 0.16.100.el9 - -If AIDE is not installed, ask the system administrator (SA) how file integrity checks are performed on the system. - -If there is no application installed to perform integrity checks, this is a finding. - -If AIDE is installed, check if it has been initialized with the following command: - -$ sudo /usr/sbin/aide --check - -If the output is "Couldn't open file /var/lib/aide/aide.db.gz for reading", this is a finding.SRG-OS-000363-GPOS-00150<GroupDescription></GroupDescription>RHEL-09-651015RHEL 9 must routinely check the baseline configuration for unauthorized changes and notify the system administrator when anomalies in the operation of any security functions are discovered.<VulnDiscussion>Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security. - -Detecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's information management officer (IMO)/information system security officer (ISSO) and system administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item. - -Notifications provided by information systems include messages to local computer consoles, and/or hardware indications, such as lights. - -This capability must take into account operational requirements for availability for selecting an appropriate response. The organization may choose to shut down or restart the information system upon security function anomaly detection. - -Satisfies: SRG-OS-000363-GPOS-00150, SRG-OS-000446-GPOS-00200, SRG-OS-000447-GPOS-00201</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001744CCI-002699CCI-002702Configure the file integrity tool to run automatically on the system at least weekly and to notify designated personnel if baseline configurations are changed in an unauthorized manner. The AIDE tool can be configured to email designated personnel with the use of the cron system. - -The following example output is generic. It will set cron to run AIDE daily and to send email at the completion of the analysis - -$ sudo more /etc/cron.daily/aide - -#!/bin/bash -/usr/sbin/aide --check | /bin/mail -s "$HOSTNAME - Daily aide integrity check run" root@sysname.milVerify that RHEL 9 routinely executes a file integrity scan for changes to the system baseline. The command used in the example will use a daily occurrence. - -Check the cron directories for scripts controlling the execution and notification of results of the file integrity application. For example, if AIDE is installed on the system, use the following commands: - -$ ls -al /etc/cron.* | grep aide - --rwxr-xr-x 1 root root 29 Nov 22 2015 aide - -$ grep aide /etc/crontab /var/spool/cron/root - -/etc/crontab: 30 04 * * * root usr/sbin/aide -/var/spool/cron/root: 30 04 * * * root usr/sbin/aide - -$ sudo more /etc/cron.daily/aide - -#!/bin/bash -/usr/sbin/aide --check | /bin/mail -s "$HOSTNAME - Daily aide integrity check run" root@sysname.mil - -If the file integrity application does not exist, or a script file controlling the execution of the file integrity application does not exist, or the file integrity application does not notify designated personnel of changes, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-651020RHEL 9 must use a file integrity tool that is configured to use FIPS 140-3-approved cryptographic hashes for validating file contents and directories.<VulnDiscussion>RHEL 9 installation media ships with an optional file integrity tool called Advanced Intrusion Detection Environment (AIDE). AIDE is highly configurable at install time. This requirement assumes the "aide.conf" file is under the "/etc" directory. - -File integrity tools use cryptographic hashes for verifying file contents and directories have not been altered. These hashes must be FIPS 140-2/140-3-approved cryptographic hashes.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the file integrity tool to use FIPS 140-2/140-3 cryptographic hashes for validating file and directory contents. - -If AIDE is installed, ensure the "sha512" rule is present on all uncommented file and directory selection lists. Exclude any log files, or files expected to change frequently, to reduce unnecessary notifications.Verify that AIDE is configured to use FIPS 140-2/140-3 file hashing with the following command: - -$ grep sha512 /etc/aide.conf - -All=p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux - -If the "sha512" rule is not being used on all uncommented selection lines in the "/etc/aide.conf" file, or another file integrity tool is not using FIPS 140-2/140-3-approved cryptographic hashes for validating file contents and directories, this is a finding.SRG-OS-000256-GPOS-00097<GroupDescription></GroupDescription>RHEL-09-651025RHEL 9 must use cryptographic mechanisms to protect the integrity of audit tools.<VulnDiscussion>Protecting the integrity of the tools used for auditing purposes is a critical step toward ensuring the integrity of audit information. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. - -Audit tools include, but are not limited to, vendor-provided and open-source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators. - -It is not uncommon for attackers to replace the audit tools or inject code into the existing tools to provide the capability to hide or erase system activity from the audit logs. - -To address this risk, audit tools must be cryptographically signed to provide the capability to identify when the audit tools have been modified, manipulated, or replaced. An example is a checksum hash of the file or files. - -Satisfies: SRG-OS-000256-GPOS-00097, SRG-OS-000257-GPOS-00098, SRG-OS-000258-GPOS-00099, SRG-OS-000278-GPOS-00108</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001493CCI-001494CCI-001495CCI-001496Add or update the following lines to "/etc/aide.conf", to protect the integrity of the audit tools. - -/usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512Check that AIDE is properly configured to protect the integrity of the audit tools with the following command: - -$ sudo cat /etc/aide.conf | grep /usr/sbin/au - -/usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 -/usr/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512 - -If AIDE is not installed, ask the system administrator (SA) how file integrity checks are performed on the system. - -If any of the audit tools listed above do not have a corresponding line, ask the SA to indicate what cryptographic mechanisms are being used to protect the integrity of the audit tools. If there is no evidence of integrity protection, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-651030RHEL 9 must be configured so that the file integrity tool verifies Access Control Lists (ACLs).<VulnDiscussion>RHEL 9 installation media ships with an optional file integrity tool called Advanced Intrusion Detection Environment (AIDE). AIDE is highly configurable at install time. This requirement assumes the "aide.conf" file is under the "/etc" directory. - -ACLs can provide permissions beyond those permitted through the file mode and must be verified by the file integrity tools.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the file integrity tool to check file and directory ACLs. - -If AIDE is installed, ensure the "acl" rule is present on all uncommented file and directory selection lists.Verify that that AIDE is verifying ACLs with the following command: - -$ grep acl /etc/aide.conf - -All= p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux - -If the "acl" rule is not being used on all uncommented selection lines in the "/etc/aide.conf" file, or ACLs are not being checked by another file integrity tool, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-651035RHEL 9 must be configured so that the file integrity tool verifies extended attributes.<VulnDiscussion>RHEL 9 installation media ships with an optional file integrity tool called Advanced Intrusion Detection Environment (AIDE). AIDE is highly configurable at install time. This requirement assumes the "aide.conf" file is under the "/etc" directory. - -Extended attributes in file systems are used to contain arbitrary data and file metadata with security implications.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the file integrity tool to check file and directory extended attributes. - -If AIDE is installed, ensure the "xattrs" rule is present on all uncommented file and directory selection lists.Verify that AIDE is configured to verify extended attributes with the following command: - -$ grep xattrs /etc/aide.conf - -All= p+i+n+u+g+s+m+S+sha512+acl+xattrs+selinux - -If the "xattrs" rule is not being used on all uncommented selection lines in the "/etc/aide.conf" file, or extended attributes are not being checked by another file integrity tool, this is a finding.SRG-OS-000479-GPOS-00224<GroupDescription></GroupDescription>RHEL-09-652010RHEL 9 must have the rsyslog package installed.<VulnDiscussion>rsyslogd is a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Couple this utility with "gnutls" (which is a secure communications library implementing the SSL, TLS, and DTLS protocols), to create a method to securely encrypt and offload auditing. - -Satisfies: SRG-OS-000479-GPOS-00224, SRG-OS-000051-GPOS-00024, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000154CCI-000366CCI-001851The rsyslogd package can be installed with the following command: - -$ sudo dnf install rsyslogdVerify that RHEL 9 has the rsyslogd package installed with the following command: - -$ sudo dnf list --installed rsyslog - -Example output: - -rsyslog.x86_64 8.2102.0-101.el9_0.1 - -If the "rsyslogd" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-652015RHEL 9 must have the packages required for encrypting offloaded audit logs installed.<VulnDiscussion>The rsyslog-gnutls package provides Transport Layer Security (TLS) support for the rsyslog daemon, which enables secure remote logging. - -Satisfies: SRG-OS-000480-GPOS-00227, SRG-OS-000120-GPOS-00061</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-000803The rsyslog-gnutls package can be installed with the following command: - -$ sudo dnf install rsyslog-gnutlsVerify that RHEL 9 has the rsyslog-gnutls package installed with the following command: - -$ sudo dnf list --installed rsyslog-gnutls - -Example output: - -rsyslog-gnutls.x86_64 8.2102.0-101.el9_0.1 - -If the "rsyslog-gnutls" package is not installed, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-652020The rsyslog service on RHEL 9 must be active.<VulnDiscussion>The "rsyslog" service must be running to provide logging services, which are essential to system administration.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366To enable the rsyslog service, run the following command: - -$ sudo systemctl enable --now rsyslogVerify that "rsyslog" is active with the following command: - -$ systemctl is-active rsyslog - -active - -If the rsyslog service is not active, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-652025RHEL 9 must be configured so that the rsyslog daemon does not accept log messages from other servers unless the server is being used for log aggregation.<VulnDiscussion>Unintentionally running a rsyslog server accepting remote messages puts the system at increased risk. Malicious rsyslog messages sent to the server could exploit vulnerabilities in the server software itself, could introduce misleading information into the system's logs, or could fill the system's storage leading to a denial of service. - -If the system is intended to be a log aggregation server, its use must be documented with the information system security officer (ISSO).</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure RHEL 9 to not receive remote logs using rsyslog. - -Remove the lines in /etc/rsyslog.conf and any files in the /etc/rsyslog.d directory that match any of the following: - -$ModLoad imtcp -$ModLoad imudp -$ModLoad imrelp -$InputTCPServerRun [0-9]* -$UDPServerRun [0-9]* -$InputRELPServerRun [0-9]* - -The rsyslog daemon must be restarted for the changes to take effect: - -$ sudo systemctl restart rsyslog.serviceVerify that RHEL 9 is not configured to receive remote logs using rsyslog with the following commands: - -$ grep -i modload /etc/rsyslog.conf /etc/rsyslog.d/* -$ModLoad imtcp -$ModLoad imrelp - -$ grep -i serverrun /etc/rsyslog.conf /etc/rsyslog.d/* -$InputTCPServerRun 514 -$InputRELPServerRun 514 - -Note: An error about no files or directories may be returned. This is not a finding. - -If any lines are returned by the command, then rsyslog is configured to receive remote messages, and this is a finding.SRG-OS-000032-GPOS-00013<GroupDescription></GroupDescription>RHEL-09-652030All RHEL 9 remote access methods must be monitored.<VulnDiscussion>Logging remote access methods can be used to trace the decrease in the risks associated with remote user access management. It can also be used to spot cyberattacks and ensure ongoing compliance with organizational policies surrounding the use of remote access methods.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000067Add or update the following lines to the "/etc/rsyslog.conf" file: - -auth.*;authpriv.*;daemon.* /var/log/secure - -The "rsyslog" service must be restarted for the changes to take effect with the following command: - -$ sudo systemctl restart rsyslog.serviceVerify that RHEL 9 monitors all remote access methods. - -Check that remote access methods are being logged by running the following command: - -$ grep -rE '(auth.\*|authpriv.\*|daemon.\*)' /etc/rsyslog.conf - -/etc/rsyslog.conf:authpriv.* - -If "auth.*", "authpriv.*" or "daemon.*" are not configured to be logged, this is a finding.SRG-OS-000342-GPOS-00133<GroupDescription></GroupDescription>RHEL-09-652035RHEL 9 must be configured to offload audit records onto a different system from the system being audited via syslog.<VulnDiscussion>The auditd service does not include the ability to send audit records to a centralized server for management directly. However, it can use a plug-in for audit event multiplexor (audispd) to pass audit records to the local syslog server. - -Satisfies: SRG-OS-000342-GPOS-00133, SRG-OS-000479-GPOS-00224</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001851Edit the /etc/audit/plugins.d/syslog.conf file and add or update the "active" option: - -active = yes - -The audit daemon must be restarted for changes to take effect.Verify RHEL 9 is configured use the audisp-remote syslog service with the following command: - -$ sudo grep active /etc/audit/plugins.d/syslog.conf - -active = yes - -If the "active" keyword does not have a value of "yes", the line is commented out, or the line is missing, this is a finding.SRG-OS-000342-GPOS-00133<GroupDescription></GroupDescription>RHEL-09-652040RHEL 9 must authenticate the remote logging server for offloading audit logs via rsyslog.<VulnDiscussion>Information stored in one location is vulnerable to accidental or incidental deletion or alteration. - -Offloading is a common process in information systems with limited audit storage capacity. - -RHEL 9 installation media provides "rsyslogd", a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Coupling this utility with "gnutls" (a secure communications library implementing the SSL, TLS and DTLS protocols) creates a method to securely encrypt and offload auditing. - -"Rsyslog" supported authentication modes include: -anon - anonymous authentication -x509/fingerprint - certificate fingerprint authentication -x509/certvalid - certificate validation only -x509/name - certificate validation and subject name authentication - -Satisfies: SRG-OS-000342-GPOS-00133, SRG-OS-000479-GPOS-00224</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001851Configure RHEL 9 to authenticate the remote logging server for offloading audit logs by setting the following option in "/etc/rsyslog.conf" or "/etc/rsyslog.d/[customfile].conf": - -$ActionSendStreamDriverAuthMode x509/nameVerify RHEL 9 authenticates the remote logging server for offloading audit logs with the following command: - -$ sudo grep -i '$ActionSendStreamDriverAuthMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf - - /etc/rsyslog.conf:$ActionSendStreamDriverAuthMode x509/name - -If the value of the "$ActionSendStreamDriverAuthMode" option is not set to "x509/name" or the line is commented out, ask the system administrator (SA) to indicate how the audit logs are offloaded to a different system or media. - -If there is no evidence that the transfer of the audit logs being offloaded to another system or media is encrypted, this is a finding.SRG-OS-000342-GPOS-00133<GroupDescription></GroupDescription>RHEL-09-652045RHEL 9 must encrypt the transfer of audit records offloaded onto a different system or media from the system being audited via rsyslog.<VulnDiscussion>Information stored in one location is vulnerable to accidental or incidental deletion or alteration. - -Offloading is a common process in information systems with limited audit storage capacity. - -RHEL 9 installation media provides "rsyslogd", a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Coupling this utility with "gnutls" (a secure communications library implementing the SSL, TLS and DTLS protocols) creates a method to securely encrypt and offload auditing. - -"Rsyslog" supported authentication modes include: -anon - anonymous authentication -x509/fingerprint - certificate fingerprint authentication -x509/certvalid - certificate validation only -x509/name - certificate validation and subject name authentication - -Satisfies: SRG-OS-000342-GPOS-00133, SRG-OS-000479-GPOS-00224</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001851Configure RHEL 9 to encrypt offloaded audit records via rsyslog by setting the following options in "/etc/rsyslog.conf" or "/etc/rsyslog.d/[customfile].conf": - -$ActionSendStreamDriverMode 1Verify RHEL 9 encrypts audit records offloaded onto a different system or media from the system being audited via rsyslog with the following command: - -$ sudo grep -i '$ActionSendStreamDriverMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf - -/etc/rsyslog.conf:$ActionSendStreamDriverMode 1 - -If the value of the "$ActionSendStreamDriverMode" option is not set to "1" or the line is commented out, this is a finding.SRG-OS-000342-GPOS-00133<GroupDescription></GroupDescription>RHEL-09-652050RHEL 9 must encrypt via the gtls driver the transfer of audit records offloaded onto a different system or media from the system being audited via rsyslog.<VulnDiscussion>Information stored in one location is vulnerable to accidental or incidental deletion or alteration. - -Offloading is a common process in information systems with limited audit storage capacity. - -RHEL 9 installation media provides "rsyslogd", a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Coupling this utility with "gnutls" (a secure communications library implementing the SSL, TLS and DTLS protocols) creates a method to securely encrypt and offload auditing. - -Satisfies: SRG-OS-000342-GPOS-00133, SRG-OS-000479-GPOS-00224</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001851Configure RHEL 9 to use the gtls driver to encrypt offloaded audit records by setting the following options in "/etc/rsyslog.conf" or "/etc/rsyslog.d/[customfile].conf": - -$DefaultNetstreamDriver gtlsVerify RHEL 9 uses the gtls driver to encrypt audit records offloaded onto a different system or media from the system being audited with the following command: - -$ sudo grep -i '$DefaultNetstreamDriver' /etc/rsyslog.conf /etc/rsyslog.d/*.conf - -/etc/rsyslog.conf:$DefaultNetstreamDriver gtls - -If the value of the "$DefaultNetstreamDriver" option is not set to "gtls" or the line is commented out, this is a finding.SRG-OS-000479-GPOS-00224<GroupDescription></GroupDescription>RHEL-09-652055RHEL 9 must be configured to forward audit records via TCP to a different system or media from the system being audited via rsyslog.<VulnDiscussion>Information stored in one location is vulnerable to accidental or incidental deletion or alteration. - -Offloading is a common process in information systems with limited audit storage capacity. - -RHEL 9 installation media provides "rsyslogd", a system utility providing support for message logging. Support for both internet and Unix domain sockets enables this utility to support both local and remote logging. Coupling this utility with "gnutls" (a secure communications library implementing the SSL, TLS and DTLS protocols) creates a method to securely encrypt and offload auditing. - -Rsyslog provides three ways to forward message: the traditional UDP transport, which is extremely lossy but standard; the plain TCP based transport, which loses messages only during certain situations but is widely available; and the RELP transport, which does not lose messages but is currently available only as part of the rsyslogd 3.15.0 and above. - -Examples of each configuration: -UDP *.* @remotesystemname -TCP *.* @@remotesystemname -RELP *.* :omrelp:remotesystemname:2514 -Note that a port number was given as there is no standard port for RELP. - -Satisfies: SRG-OS-000479-GPOS-00224, SRG-OS-000480-GPOS-00227, SRG-OS-000342-GPOS-00133</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001851Configure RHEL 9 to offload audit records onto a different system or media from the system being audited via TCP using rsyslog by specifying the remote logging server in "/etc/rsyslog.conf"" or "/etc/rsyslog.d/[customfile].conf" with the name or IP address of the log aggregation server. - -*.* @@[remoteloggingserver]:[port]"Verify that RHEL 9 audit system offloads audit records onto a different system or media from the system being audited via rsyslog using TCP with the following command: - -$ sudo grep @@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf - -/etc/rsyslog.conf:*.* @@[remoteloggingserver]:[port] - -If a remote server is not configured, or the line is commented out, ask the system administrator (SA) to indicate how the audit logs are offloaded to a different system or media. - -If there is no evidence that the audit logs are being offloaded to another system or media, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-652060RHEL 9 must use cron logging.<VulnDiscussion>Cron logging can be used to trace the successful or unsuccessful execution of cron jobs. It can also be used to spot intrusions into the use of the cron facility by unauthorized and malicious users.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure "rsyslog" to log all cron messages by adding or updating the following line to "/etc/rsyslog.conf" or a configuration file in the /etc/rsyslog.d/ directory: - -cron.* /var/log/cron - -The rsyslog daemon must be restarted for the changes to take effect: - -$ sudo systemctl restart rsyslog.serviceVerify that "rsyslog" is configured to log cron events with the following command: - -Note: If another logging package is used, substitute the utility configuration file for "/etc/rsyslog.conf" or "/etc/rsyslog.d/*.conf" files. - -$ sudo grep -s cron /etc/rsyslog.conf /etc/rsyslog.d/*.conf - -/etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none /var/log/messages -/etc/rsyslog.conf:cron.* /var/log/cron - -If the command does not return a response, check for cron logging all facilities with the following command: - -$ sudo grep -s /var/log/messages /etc/rsyslog.conf /etc/rsyslog.d/*.conf - -/etc/rsyslog.conf:*.info;mail.none;authpriv.none;cron.none /var/log/messages - -If "rsyslog" is not logging messages for the cron facility or all facilities, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-09-653010RHEL 9 audit package must be installed.<VulnDiscussion>Without establishing what type of events occurred, the source of events, where events occurred, and the outcome of events, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. - -Audit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. - -Associating event types with detected events in audit logs provides a means of investigating an attack, recognizing resource utilization or capacity thresholds, or identifying an improperly configured RHEL 9 system. - -Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000038-GPOS-00016, SRG-OS-000039-GPOS-00017, SRG-OS-000040-GPOS-00018, SRG-OS-000041-GPOS-00019, SRG-OS-000042-GPOS-00021, SRG-OS-000051-GPOS-00024, SRG-OS-000054-GPOS-00025, SRG-OS-000122-GPOS-00063, SRG-OS-000254-GPOS-00095, SRG-OS-000255-GPOS-00096, SRG-OS-000337-GPOS-00129, SRG-OS-000348-GPOS-00136, SRG-OS-000349-GPOS-00137, SRG-OS-000350-GPOS-00138, SRG-OS-000351-GPOS-00139, SRG-OS-000352-GPOS-00140, SRG-OS-000353-GPOS-00141, SRG-OS-000354-GPOS-00142, SRG-OS-000358-GPOS-00145, SRG-OS-000365-GPOS-00152, SRG-OS-000392-GPOS-00172, SRG-OS-000475-GPOS-00220, SRG-OS-000055-GPOS-00026</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000131CCI-000132CCI-000133CCI-000134CCI-000135CCI-000154CCI-000158CCI-000159CCI-000169CCI-000172CCI-001464CCI-001487CCI-001814CCI-001875CCI-001876CCI-001877CCI-001878CCI-001879CCI-001880CCI-001881CCI-001882CCI-001889CCI-001914CCI-002884Install the audit service package (if the audit service is not already installed) with the following command: - -$ sudo dnf install auditVerify that RHEL 9 audit service package is installed. - -Check that the audit service package is installed with the following command: - -$ sudo dnf list --installed audit - -Example output: - -audit-3.0.7-101.el9_0.2.x86_64 - -If the "audit" package is not installed, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-09-653015RHEL 9 audit service must be enabled.<VulnDiscussion>Without establishing what type of events occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. Ensuring the "auditd" service is active ensures audit records generated by the kernel are appropriately recorded. - -Additionally, a properly configured audit subsystem ensures that actions of individual system users can be uniquely traced to those users so they can be held accountable for their actions. - -Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000037-GPOS-00015, SRG-OS-000038-GPOS-00016, SRG-OS-000039-GPOS-00017, SRG-OS-000040-GPOS-00018, SRG-OS-000041-GPOS-00019, SRG-OS-000042-GPOS-00021, SRG-OS-000051-GPOS-00024, SRG-OS-000054-GPOS-00025, SRG-OS-000122-GPOS-00063, SRG-OS-000254-GPOS-00095, SRG-OS-000255-GPOS-00096, SRG-OS-000337-GPOS-00129, SRG-OS-000348-GPOS-00136, SRG-OS-000349-GPOS-00137, SRG-OS-000350-GPOS-00138, SRG-OS-000351-GPOS-00139, SRG-OS-000352-GPOS-00140, SRG-OS-000353-GPOS-00141, SRG-OS-000354-GPOS-00142, SRG-OS-000358-GPOS-00145, SRG-OS-000365-GPOS-00152, SRG-OS-000392-GPOS-00172, SRG-OS-000475-GPOS-00220</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000131CCI-000132CCI-000133CCI-000134CCI-000135CCI-000154CCI-000158CCI-000169CCI-000172CCI-001464CCI-001487CCI-001814CCI-001875CCI-001876CCI-001877CCI-001878CCI-001879CCI-001880CCI-001881CCI-001882CCI-001889CCI-001914CCI-002884To enable the auditd service run the following command: - -$ sudo systemctl enable --now auditdVerify the audit service is configured to produce audit records with the following command: - -$ systemctl status auditd.service - -auditd.service - Security Auditing Service -Loaded:loaded (/usr/lib/systemd/system/auditd.service; enabled; vendor preset: enabled) -Active: active (running) since Tues 2022-05-24 12:56:56 EST; 4 weeks 0 days ago - -If the audit service is not "active" and "running", this is a finding.SRG-OS-000047-GPOS-00023<GroupDescription></GroupDescription>RHEL-09-653020RHEL 9 audit system must take appropriate action when an error writing to the audit storage volume occurs.<VulnDiscussion>It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000140Configure RHEL 9 to shut down by default upon audit failure (unless availability is an overriding concern). - -Add or update the following line (depending on configuration "disk_error_action" can be set to "SYSLOG" or "SINGLE" depending on configuration) in "/etc/audit/auditd.conf" file: - -disk_error_action = HALT - -If availability has been determined to be more important, and this decision is documented with the information system security officer (ISSO), configure the operating system to notify SA staff and ISSO staff in the event of an audit processing failure by setting the "disk_error_action" to "SYSLOG".Verify RHEL 9 takes the appropriate action when an audit processing failure occurs. - -Check that RHEL 9 takes the appropriate action when an audit processing failure occurs with the following command: - -$ sudo grep disk_error_action /etc/audit/auditd.conf - -disk_error_action = HALT - -If the value of the "disk_error_action" option is not "SYSLOG", "SINGLE", or "HALT", or the line is commented out, ask the system administrator (SA) to indicate how the system takes appropriate action when an audit process failure occurs. If there is no evidence of appropriate action, this is a finding.SRG-OS-000047-GPOS-00023<GroupDescription></GroupDescription>RHEL-09-653025RHEL 9 audit system must take appropriate action when the audit storage volume is full.<VulnDiscussion>It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000140Configure RHEL 9 to shut down by default upon audit failure (unless availability is an overriding concern). - -Add or update the following line (depending on configuration "disk_full_action" can be set to "SYSLOG" or "SINGLE" depending on configuration) in "/etc/audit/auditd.conf" file: - -disk_full_action = HALT - -If availability has been determined to be more important, and this decision is documented with the information system security officer (ISSO), configure the operating system to notify SA staff and ISSO staff in the event of an audit processing failure by setting the "disk_full_action" to "SYSLOG".Verify RHEL 9 takes the appropriate action when the audit storage volume is full. - -Check that RHEL 9 takes the appropriate action when the audit storage volume is full with the following command: - -$ sudo grep disk_full_action /etc/audit/auditd.conf - -disk_full_action = HALT - -If the value of the "disk_full_action" option is not "SYSLOG", "SINGLE", or "HALT", or the line is commented out, ask the system administrator (SA) to indicate how the system takes appropriate action when an audit storage volume is full. If there is no evidence of appropriate action, this is a finding.SRG-OS-000341-GPOS-00132<GroupDescription></GroupDescription>RHEL-09-653030RHEL 9 must allocate audit record storage capacity to store at least one week's worth of audit records.<VulnDiscussion>To ensure RHEL 9 systems have a sufficient storage capacity in which to write the audit logs, RHEL 9 needs to be able to allocate audit record storage capacity. - -The task of allocating audit record storage capacity is usually performed during initial installation of RHEL 9. - -Satisfies: SRG-OS-000341-GPOS-00132, SRG-OS-000342-GPOS-00133</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001849CCI-001851Allocate enough storage capacity for at least one week of audit records when audit records are not immediately sent to a central audit record storage facility. - -If audit records are stored on a partition made specifically for audit records, resize the partition with sufficient space to contain one week of audit records. - -If audit records are not stored on a partition made specifically for audit records, a new partition with sufficient space will need be to be created.Verify RHEL 9 allocates audit record storage capacity to store at least one week of audit records when audit records are not immediately sent to a central audit record storage facility. - -Note: The partition size needed to capture a week of audit records is based on the activity level of the system and the total storage capacity available. Typically 10.0 GB of storage space for audit records should be sufficient. - -Determine which partition the audit records are being written to with the following command: - -$ sudo grep log_file /etc/audit/auditd.conf -log_file = /var/log/audit/audit.log - -Check the size of the partition that audit records are written to with the following command and verify whether it is sufficiently large: - - # df -h /var/log/audit/ -/dev/sda2 24G 10.4G 13.6G 43% /var/log/audit - -If the audit record partition is not allocated for sufficient storage capacity, this is a finding.SRG-OS-000343-GPOS-00134<GroupDescription></GroupDescription>RHEL-09-653035RHEL 9 must take action when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity.<VulnDiscussion>If security personnel are not notified immediately when storage volume reaches 75 percent utilization, they are unable to plan for audit record storage capacity expansion.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001855Configure RHEL 9 to initiate an action to notify the SA and ISSO (at a minimum) when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity by adding/modifying the following line in the /etc/audit/auditd.conf file. - -space_left = 25%Verify RHEL 9 takes action when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity with the following command: - -$ sudo grep -w space_left /etc/audit/auditd.conf - -space_left = 25% - -If the value of the "space_left" keyword is not set to 25 percent of the storage volume allocated to audit logs, or if the line is commented out, ask the system administrator (SA) to indicate how the system is providing real-time alerts to the SA and information system security officer (ISSO). If the "space_left" value is not configured to the correct value, this is a finding.SRG-OS-000343-GPOS-00134<GroupDescription></GroupDescription>RHEL-09-653040RHEL 9 must notify the system administrator (SA) and information system security officer (ISSO) (at a minimum) when allocated audit record storage volume 75 percent utilization.<VulnDiscussion>If security personnel are not notified immediately when storage volume reaches 75 percent utilization, they are unable to plan for audit record storage capacity expansion.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001855Configure RHEL 9 to initiate an action to notify the SA and ISSO (at a minimum) when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity by adding/modifying the following line in the /etc/audit/auditd.conf file. - -space_left_action = emailVerify RHEL 9 notifies the SA and ISSO (at a minimum) when allocated audit record storage volume reaches 75 percent of the repository maximum audit record storage capacity with the following command: - -$ sudo grep -w space_left_action /etc/audit/auditd.conf - -space_left_action = email - -If the value of the "space_left_action" is not set to "email", or if the line is commented out, ask the SA to indicate how the system is providing real-time alerts to the SA and ISSO. - -If there is no evidence that real-time alerts are configured on the system, this is a finding.SRG-OS-000343-GPOS-00134<GroupDescription></GroupDescription>RHEL-09-653045RHEL 9 must take action when allocated audit record storage volume reaches 95 percent of the audit record storage capacity.<VulnDiscussion>If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001855Configure RHEL 9 to initiate an action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity by adding/modifying the following line in the /etc/audit/auditd.conf file. - -admin_space_left = 5%Verify RHEL 9 takes action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity with the following command: - -$ sudo grep -w admin_space_left /etc/audit/auditd.conf - -admin_space_left = 5% - -If the value of the "admin_space_left" keyword is not set to 5 percent of the storage volume allocated to audit logs, or if the line is commented out, ask the system administrator (SA) to indicate how the system is taking action if the allocated storage is about to reach capacity. If the "space_left" value is not configured to the correct value, this is a finding.SRG-OS-000343-GPOS-00134<GroupDescription></GroupDescription>RHEL-09-653050RHEL 9 must take action when allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity.<VulnDiscussion>If action is not taken when storage volume reaches 95 percent utilization, the auditing system may fail when the storage volume reaches capacity.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001855Configure "auditd" service to take action in the event of allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity. - -Edit the following line in "/etc/audit/auditd.conf" to ensure that the system is forced into single user mode in the event the audit record storage volume is about to reach maximum capacity: - -admin_space_left_action = single - -The audit daemon must be restarted for changes to take effect.Verify that RHEL 9 is configured to take action in the event of allocated audit record storage volume reaches 95 percent of the repository maximum audit record storage capacity with the following command: - -$ sudo grep admin_space_left_action /etc/audit/auditd.conf - -admin_space_left_action = single - -If the value of the "admin_space_left_action" is not set to "single", or if the line is commented out, ask the system administrator (SA) to indicate how the system is providing real-time alerts to the SA and information system security officer (ISSO). - -If there is no evidence that real-time alerts are configured on the system, this is a finding.SRG-OS-000047-GPOS-00023<GroupDescription></GroupDescription>RHEL-09-653055RHEL 9 audit system must take appropriate action when the audit files have reached maximum size.<VulnDiscussion>It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000140Configure RHEL 9 to rotate the audit log when it reaches maximum size. - -Add or update the following line in "/etc/audit/auditd.conf" file: - -max_log_file_action = ROTATEVerify that RHEL 9 takes the appropriate action when the audit files have reached maximum size with the following command: - -$ sudo grep max_log_file_action /etc/audit/auditd.conf - -max_log_file_action = ROTATE - -If the value of the "max_log_file_action" option is not "ROTATE", "SINGLE", or the line is commented out, ask the system administrator (SA)to indicate how the system takes appropriate action when an audit storage volume is full. If there is no evidence of appropriate action, this is a finding.SRG-OS-000039-GPOS-00017<GroupDescription></GroupDescription>RHEL-09-653060RHEL 9 must label all offloaded audit logs before sending them to the central log server.<VulnDiscussion>Enriched logging is needed to determine who, what, and when events occur on a system. Without this, determining root cause of an event will be much more difficult. - -When audit logs are not labeled before they are sent to a central log server, the audit data will not be able to be analyzed and tied back to the correct system. - -Satisfies: SRG-OS-000039-GPOS-00017, SRG-OS-000342-GPOS-00133, SRG-OS-000479-GPOS-00224</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000132CCI-001851Edit the /etc/audit/auditd.conf file and add or update the "name_format" option: - -name_format = hostname - -The audit daemon must be restarted for changes to take effect.Verify that RHEL 9 Audit Daemon is configured to label all offloaded audit logs, with the following command: - -$ sudo grep name_format /etc/audit/auditd.conf - -name_format = hostname - -If the "name_format" option is not "hostname", "fqd", or "numeric", or the line is commented out, this is a finding.SRG-OS-000342-GPOS-00133<GroupDescription></GroupDescription>RHEL-09-653065RHEL 9 must take appropriate action when the internal event queue is full.<VulnDiscussion>The audit system should have an action setup in the event the internal event queue becomes full so that no data is lost. Information stored in one location is vulnerable to accidental or incidental deletion or alteration. - -Offloading is a common process in information systems with limited audit storage capacity. - -Satisfies: SRG-OS-000342-GPOS-00133, SRG-OS-000479-GPOS-00224</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001851Edit the /etc/audit/auditd.conf file and add or update the "overflow_action" option: - -overflow_action = syslog - -The audit daemon must be restarted for changes to take effect.Verify that RHEL 9 audit system is configured to take an appropriate action when the internal event queue is full: - -$ sudo grep -i overflow_action /etc/audit/auditd.conf - -overflow_action = syslog - -If the value of the "overflow_action" option is not set to "syslog", "single", "halt" or the line is commented out, ask the system administrator (SA) to indicate how the audit logs are offloaded to a different system or media. - -If there is no evidence that the transfer of the audit logs being offloaded to another system or media takes appropriate action if the internal event queue becomes full, this is a finding.SRG-OS-000046-GPOS-00022<GroupDescription></GroupDescription>RHEL-09-653070RHEL 9 System Administrator (SA) and/or information system security officer (ISSO) (at a minimum) must be alerted of an audit processing failure event.<VulnDiscussion>It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. - -Audit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded. - -This requirement applies to each audit data storage repository (i.e., distinct information system component where audit records are stored), the centralized audit storage capacity of organizations (i.e., all audit data storage repositories combined), or both. - -Satisfies: SRG-OS-000046-GPOS-00022, SRG-OS-000343-GPOS-00134</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000139CCI-001855Configure "auditd" service to notify the SA and ISSO in the event of an audit processing failure. - -Edit the following line in "/etc/audit/auditd.conf" to ensure that administrators are notified via email for those situations: - -action_mail_acct = root - -The audit daemon must be restarted for changes to take effect.Verify that RHEL 9 is configured to notify the SA and/or ISSO (at a minimum) in the event of an audit processing failure with the following command: - -$ sudo grep action_mail_acct /etc/audit/auditd.conf - -action_mail_acct = root - -If the value of the "action_mail_acct" keyword is not set to "root" and/or other accounts for security personnel, the "action_mail_acct" keyword is missing, or the retuned line is commented out, ask the SA to indicate how they and the ISSO are notified of an audit process failure. If there is no evidence of the proper personnel being notified of an audit processing failure, this is a finding.SRG-OS-000062-GPOS-00031<GroupDescription></GroupDescription>RHEL-09-653075RHEL 9 audit system must audit local events.<VulnDiscussion>Without establishing what type of events occurred, the source of events, where events occurred, and the outcome of events, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. - -If option "local_events" isn't set to "yes" only events from network will be aggregated. - -Satisfies: SRG-OS-000062-GPOS-00031, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000169CCI-000366Configure RHEL 9 to generate audit records for local events by adding or updating the following line in "/etc/audit/auditd.conf": - -local_events = yes - -The audit daemon must be restarted for the changes to take effect.Verify that the RHEL 9 audit system is configured to audit local events with the following command: - -$ sudo grep local_events /etc/audit/auditd.conf - -local_events = yes - -If "local_events" isn't set to "yes", if the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000057-GPOS-00027<GroupDescription></GroupDescription>RHEL-09-653080RHEL 9 audit logs must be group-owned by root or by a restricted logging group to prevent unauthorized read access.<VulnDiscussion>Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. - -Satisfies: SRG-OS-000057-GPOS-00027, SRG-OS-000058-GPOS-00028, SRG-OS-000059-GPOS-00029, SRG-OS-000206-GPOS-00084</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000162CCI-000163CCI-000164CCI-001314Change the group of the directory of "/var/log/audit" to be owned by a correct group. - -Identify the group that is configured to own audit log: - -$ sudo grep -P '^[ ]*log_group[ ]+=.*$' /etc/audit/auditd.conf - -Change the ownership to that group: - -$ sudo chgrp ${GROUP} /var/log/auditVerify the audit logs are group-owned by "root" or a restricted logging group. - -First determine if a group other than "root" has been assigned to the audit logs with the following command: - -$ sudo grep log_group /etc/audit/auditd.conf - -Then determine where the audit logs are stored with the following command: - -$ sudo grep -iw log_file /etc/audit/auditd.conf - -log_file = /var/log/audit/audit.log - -Then using the location of the audit log file, determine if the audit log is group-owned by "root" using the following command: - -$ sudo stat -c "%G %n" /var/log/audit/audit.log - -root /var/log/audit/audit.log - -If the audit log is not group-owned by "root" or the configured alternative logging group, this is a finding.SRG-OS-000057-GPOS-00027<GroupDescription></GroupDescription>RHEL-09-653085RHEL 9 audit log directory must be owned by root to prevent unauthorized read access.<VulnDiscussion>Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. - -Satisfies: SRG-OS-000057-GPOS-00027, SRG-OS-000058-GPOS-00028, SRG-OS-000059-GPOS-00029, SRG-OS-000206-GPOS-00084</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000162CCI-000163CCI-000164CCI-001314Configure the audit log to be protected from unauthorized read access by setting the correct owner as "root" with the following command: - -$ sudo chown root /var/log/auditVerify the audit logs directory is owned by "root". - -First determine where the audit logs are stored with the following command: - -$ sudo grep -iw log_file /etc/audit/auditd.conf - -log_file = /var/log/audit/audit.log - -Then using the location of the audit log file, determine if the audit log directory is owned by "root" using the following command: - -$ sudo ls -ld /var/log/audit - -drwx------ 2 root root 23 Jun 11 11:56 /var/log/audit - -If the audit log directory is not owned by "root", this is a finding.SRG-OS-000057-GPOS-00027<GroupDescription></GroupDescription>RHEL-09-653090RHEL 9 audit logs file must have mode 0600 or less permissive to prevent unauthorized access to the audit log.<VulnDiscussion>Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the RHEL 9 system or platform. Additionally, Personally Identifiable Information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. - -The structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements. - -Satisfies: SRG-OS-000057-GPOS-00027, SRG-OS-000058-GPOS-00028, SRG-OS-000059-GPOS-00029, SRG-OS-000206-GPOS-00084</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000162CCI-000163CCI-000164CCI-001314Configure the audit logs to have a mode of "0600" with the following command: - -Replace "[audit_log_file]" to the correct audit log path, by default this location is "/var/log/audit/audit.log". - -$ sudo chmod 0600 /var/log/audit/[audit_log_file] - -Check the group that owns the system audit logs: - -$ sudo grep -m 1 -q ^log_group /etc/audit/auditd.conf - -If the log_group is not defined or it is set to root, configure the permissions the following way: - -$ sudo chmod 0640 $log_file -$ sudo chmod 0440 $log_file.* - -Otherwise, configure the permissions the following way: - -$ sudo chmod 0600 $log_file -$ sudo chmod 0400 $log_file.*Verify the audit logs have a mode of "0600". - -First determine where the audit logs are stored with the following command: - -$ sudo grep -iw log_file /etc/audit/auditd.conf - -log_file = /var/log/audit/audit.log - -Then using the location of the audit log file, determine if the audit log files as a mode of "0640" with the following command: - -$ sudo ls -la /var/log/audit/*.log - -rw-------. 2 root root 237923 Jun 11 11:56 /var/log/audit/audit.log - -If the audit logs have a mode more permissive than "0600", this is a finding.SRG-OS-000051-GPOS-00024<GroupDescription></GroupDescription>RHEL-09-653095RHEL 9 must periodically flush audit records to disk to prevent the loss of audit records.<VulnDiscussion>If option "freq" is not set to a value that requires audit records being written to disk after a threshold number is reached, then audit records may be lost.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000154Configure RHEL 9 to flush audit to disk by adding or updating the following rule in "/etc/audit/auditd.conf": - -freq = 100 - -The audit daemon must be restarted for the changes to take effect.Verify that audit system is configured to flush to disk after every 100 records with the following command: - -$ sudo grep freq /etc/audit/auditd.conf - -freq = 100 - -If "freq" isn't set to a value between "1" and "100", the value is missing, or the line is commented out, this is a finding.SRG-OS-000255-GPOS-00096<GroupDescription></GroupDescription>RHEL-09-653100RHEL 9 must produce audit records containing information to establish the identity of any individual or process associated with the event.<VulnDiscussion>Without establishing what type of events occurred, the source of events, where events occurred, and the outcome of events, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. - -Audit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. - -Enriched logging aids in making sense of who, what, and when events occur on a system. Without this, determining root cause of an event will be much more difficult. - -Satisfies: SRG-OS-000255-GPOS-00096, SRG-OS-000480-GPOS-00227</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366CCI-001487Edit the /etc/audit/auditd.conf file and add or update the "log_format" option: - -log_format = ENRICHED - -The audit daemon must be restarted for changes to take effect.Verify that RHEL 9 audit system is configured to resolve audit information before writing to disk, with the following command: - -$ sudo grep log_format /etc/audit/auditd.conf - -log_format = ENRICHED - -If the "log_format" option is not "ENRICHED", or the line is commented out, this is a finding.SRG-OS-000480-GPOS-00227<GroupDescription></GroupDescription>RHEL-09-653105RHEL 9 must write audit records to disk.<VulnDiscussion>Audit data should be synchronously written to disk to ensure log integrity. This setting assures that all audit event data is written disk.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000366Configure the audit system to write log files to the disk. - -Edit the /etc/audit/auditd.conf file and add or update the "write_logs" option to "yes": - -write_logs = yes - -The audit daemon must be restarted for changes to take effect.Verify that the audit system is configured to write logs to the disk with the following command: - -$ sudo grep write_logs /etc/audit/auditd.conf - -write_logs = yes - -If "write_logs" does not have a value of "yes", the line is commented out, or the line is missing, this is a finding.SRG-OS-000063-GPOS-00032<GroupDescription></GroupDescription>RHEL-09-653110RHEL 9 must allow only the information system security manager (ISSM) (or individuals or roles appointed by the ISSM) to select which auditable events are to be audited.<VulnDiscussion>Without the capability to restrict the roles and individuals that can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. Misconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000171Configure the files in directory "/etc/audit/rules.d/" and the "/etc/audit/auditd.conf" file to have a mode of "0640" with the following commands: - -$ sudo chmod 0640 /etc/audit/rules.d/audit.rules -$ sudo chmod 0640 /etc/audit/rules.d/[customrulesfile].rules -$ sudo chmod 0640 /etc/audit/auditd.confVerify that the files in directory "/etc/audit/rules.d/" and "/etc/audit/auditd.conf" file have a mode of "0640" or less permissive with the following command: - -# stat -c "%a %n" /etc/audit/rules.d/*.rules - -640 /etc/audit/rules.d/audit.rules - -If the files in the "/etc/audit/rules.d/" directory or the "/etc/audit/auditd.conf" file have a mode more permissive than "0640", this is a finding.SRG-OS-000063-GPOS-00032<GroupDescription></GroupDescription>RHEL-09-653115RHEL 9 /etc/audit/auditd.conf file must have 0640 or less permissive to prevent unauthorized access.<VulnDiscussion>Without the capability to restrict the roles and individuals that can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. Misconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000171Set the mode of /etc/audit/auditd.conf file to 0640 with the command: - -$ sudo chmod 0640 /etc/audit/auditd.confVerify the mode of /etc/audit/auditd.conf with the command: - -$ sudo stat -c "%a %n" /etc/audit/auditd.conf - -640 /etc/audit/auditd.conf - -If "/etc/audit/auditd.conf" does not have a mode of "0640", this is a finding.SRG-OS-000254-GPOS-00095<GroupDescription></GroupDescription>RHEL-09-653120RHEL 9 must allocate an audit_backlog_limit of sufficient size to capture processes that start prior to the audit daemon.<VulnDiscussion>Without the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -Allocating an audit_backlog_limit of sufficient size is critical in maintaining a stable boot process. With an insufficient limit allocated, the system is susceptible to boot failures and crashes. - -Satisfies: SRG-OS-000254-GPOS-00095, SRG-OS-000341-GPOS-00132</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001464CCI-001849Configure RHEL 9 to allocate sufficient audit_backlog_limit to capture processes that start prior to the audit daemon with the following command: - -$ sudo grubby --update-kernel=ALL --args=audit_backlog_limit=8192Verify RHEL 9 allocates a sufficient audit_backlog_limit to capture processes that start prior to the audit daemon with the following command: - -$ sudo grubby --info=ALL | grep args | grep -v 'audit_backlog_limit=8192' - -If the command returns any outputs, and audit_backlog_limit is less than "8192", this is a finding.SRG-OS-000046-GPOS-00022<GroupDescription></GroupDescription>RHEL-09-653125RHEL 9 must have mail aliases to notify the information system security officer (ISSO) and system administrator (SA) (at a minimum) in the event of an audit processing failure.<VulnDiscussion>It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. - -Audit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded. - -This requirement applies to each audit data storage repository (i.e., distinct information system component where audit records are stored), the centralized audit storage capacity of organizations (i.e., all audit data storage repositories combined), or both.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000139Edit the aliases map file (by default /etc/aliases) used by Postfix and configure a root alias (using the user ISSO as an example): - -root: ISSO - -and then update the aliases database with the command: - -$ sudo newaliasesVerify that RHEL 9 is configured to notify the appropriate interactive users in the event of an audit processing failure. - -Find the alias maps that are being used with the following command: - -$ postconf alias_maps - -alias_maps = hash:/etc/aliases - -Query the Postfix alias maps for an alias for the root user with the following command: - -$ postmap -q root hash:/etc/aliases -isso - -If an alias is not set, this is a finding.SRG-OS-000342-GPOS-00133<GroupDescription></GroupDescription>RHEL-09-653130RHEL 9 audispd-plugins package must be installed.<VulnDiscussion>"audispd-plugins" provides plugins for the real-time interface to the audit subsystem, "audispd". These plugins can do things like relay events to remote machines or analyze events for suspicious behavior.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001851The audispd-plugins package can be installed with the following command: - -$ sudo dnf install audispd-pluginsVerify that RHEL 9 has the audispd-plugins package for installed with the following command: - -$ sudo dnf list --installed audispd-plugins - -Example output: - -audispd-plugins.x86_64 3.0.7-101.el9_0.2 - -If the "audispd-plugins" package is not installed, this is a finding.SRG-OS-000326-GPOS-00126<GroupDescription></GroupDescription>RHEL-09-654010RHEL 9 must audit uses of the "execve" system call.<VulnDiscussion>Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised information system accounts, is a serious and ongoing concern and can have significant adverse impacts on organizations. Auditing the use of privileged functions is one way to detect such misuse and identify the risk from insider threats and the advanced persistent threat. - -Satisfies: SRG-OS-000326-GPOS-00126, SRG-OS-000327-GPOS-00127</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002233CCI-002234Configure RHEL 9 to audit the execution of the "execve" system call. - -Add or update the following file system rules to "/etc/audit/rules.d/audit.rules": - --a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv --a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv --a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv --a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "execve" system call with the following command: - -$ sudo auditctl -l | grep execve - --a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv --a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv --a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv --a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv - -If the command does not return all lines, or the lines are commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654015RHEL 9 must audit all uses of the chmod, fchmod, and fchmodat system calls.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210, SRG-OS-000458-GPOS-00203</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "chmod", "fchmod", and "fchmodat" syscalls. - -Add or update the following rules in "/etc/audit/rules.d/audit.rules": - --a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod - --a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "chmod", "fchmod", and "fchmodat" system calls with the following command: - -$ sudo auditctl -l | grep chmod - --a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod --a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_mod - -If both the "b32" and "b64" audit rules are not defined for the "chmod", "fchmod", and "fchmodat" system calls, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654020RHEL 9 must audit all uses of the chown, fchown, fchownat, and lchown system calls.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000466-GPOS-00210, SRG-OS-000458-GPOS-00203, SRG-OS-000474-GPOS-00219</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "chown", "fchown", "fchownat", and "lchown"" system calls. - -Add or update the following rules in "/etc/audit/rules.d/audit.rules": - --a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod --a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "chown", "fchown", "fchownat", and "lchown" system calls with the following command: - -$ sudo auditctl -l | grep chown - --a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod --a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_mod - -If both the "b32" and "b64" audit rules are not defined for the "chown", "fchown", "fchownat", and "lchown" system calls, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654025RHEL 9 must audit all uses of the setxattr, fsetxattr, lsetxattr, removexattr, fremovexattr, and lremovexattr system calls.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000458-GPOS-00203, SRG-OS-000462-GPOS-00206, SRG-OS-000463-GPOS-00207, SRG-OS-000471-GPOS-00215, SRG-OS-000474-GPOS-00219, SRG-OS-000466-GPOS-00210, SRG-OS-000064-GPOS-00033</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to audit the execution of the "setxattr", "fsetxattr", "lsetxattr", "removexattr", "fremovexattr", and "lremovexattr" system calls by adding or updating the following lines to "/etc/audit/rules.d/audit.rules": - --a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod --a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod - --a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod --a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "setxattr", "fsetxattr", "lsetxattr", "removexattr", "fremovexattr", and "lremovexattr" system calls with the following command: - -$ sudo auditctl -l | grep xattr - --a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod --a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod - --a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod --a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod - -If both the "b32" and "b64" audit rules are not defined for the "chmod", "fchmod", and "fchmodat" system calls "setxattr", "fsetxattr", "lsetxattr", "removexattr", "fremovexattr", and "lremovexattr" system calls, or any of the lines returned are commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654030RHEL 9 must audit all uses of umount system calls.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "umount" command by adding or updating the following rules in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "umount" command with the following command: - -$ sudo auditctl -l | grep umount - --a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount - -If the command does not return an audit rule for "umount" or any of the lines returned are commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654035RHEL 9 must audit all uses of the chacl command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "chacl" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_mod - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "chacl" command with the following command: - -$ sudo auditctl -l | grep chacl - --a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_mod - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654040RHEL 9 must audit all uses of the setfacl command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "setfacl" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_mod - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "setfacl" command with the following command: - -$ sudo auditctl -l | grep setfacl - --a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_mod - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654045RHEL 9 must audit all uses of the chcon command.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000468-GPOS-00212, SRG-OS-000471-GPOS-00215, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "chcon" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=unset -k perm_mod - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "chcon" command with the following command: - -$ sudo auditctl -l | grep chcon - --a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=unset -k perm_mod - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654050RHEL 9 must audit all uses of the semanage command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "semanage" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "semanage" command with the following command: - -$ sudo auditctl -l | grep semanage - --a always,exit -F path=/usr/sbin/semanage -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654055RHEL 9 must audit all uses of the setfiles command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "setfiles" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/setfiles -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "setfiles" command with the following command: - -$ sudo auditctl -l | grep setfiles - --a always,exit -F path=/usr/sbin/setfiles -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654060RHEL 9 must audit all uses of the setsebool command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000463-GPOS-00207, SRG-OS-000465-GPOS-00209</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate an audit event for any successful/unsuccessful use of the "setsebool " command by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F auid!=unset -F key=privileged - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "setsebool" command with the following command: - -$ sudo auditctl -l | grep setsebool - - -a always,exit -F path=/usr/sbin/setsebool -F perm=x -F auid>=1000 -F auid!=unset -F key=privileged - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654065RHEL 9 must audit all uses of the rename, unlink, rmdir, renameat, and unlinkat system calls.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000466-GPOS-00210, SRG-OS-000467-GPOS-00211, SRG-OS-000468-GPOS-00212</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate an audit event for any successful/unsuccessful use of the "rename", "unlink", "rmdir", "renameat", and "unlinkat" system calls by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete --a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit successful/unsuccessful attempts to use the "rename", "unlink", "rmdir", "renameat", and "unlinkat" system calls with the following command: - -$ sudo auditctl -l | grep 'rename\|unlink\|rmdir' - --a always,exit -F arch=b32 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete --a always,exit -F arch=b64 -S rename,unlink,rmdir,renameat,unlinkat -F auid>=1000 -F auid!=unset -k delete - -If the command does not return an audit rule for "rename", "unlink", "rmdir", "renameat", and "unlinkat" or any of the lines returned are commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654070RHEL 9 must audit all uses of the truncate, ftruncate, creat, open, openat, and open_by_handle_at system calls.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000064-GPOS-00033, SRG-OS-000458-GPOS-00203, SRG-OS-000461-GPOS-00205</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate an audit event for any successful/unsuccessful use of the "truncate", "ftruncate", "creat", "open", "openat", and "open_by_handle_at" system calls by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access --a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access - --a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access --a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit successful/unsuccessful attempts to use the "truncate", "ftruncate", "creat", "open", "openat", and "open_by_handle_at" system calls with the following command: - -$ sudo auditctl -l | grep 'open\|truncate\|creat' - --a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access --a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access - --a always,exit -F arch=b32 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access --a always,exit -F arch=b64 -S truncate,ftruncate,creat,open,openat,open_by_handle_at -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access - -If the output does not produce rules containing "-F exit=-EPERM", this is a finding. - -If the output does not produce rules containing "-F exit=-EACCES", this is a finding. - -If the command does not return an audit rule for "truncate", "ftruncate", "creat", "open", "openat", and "open_by_handle_at" or any of the lines returned are commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654075RHEL 9 must audit all uses of the delete_module system call.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate an audit event for any successful/unsuccessful use of the "delete_module" system call by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng --a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "delete_module" system call with the following command: - -$ sudo auditctl -l | grep delete_module - --a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng --a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng - -If both the "b32" and "b64" audit rules are not defined for the "delete_module" system call, or any of the lines returned are commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654080RHEL 9 must audit all uses of the init_module and finit_module system calls.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate an audit event for any successful/unsuccessful use of the "init_module" and "finit_module" system calls by adding or updating the following rules in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng --a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "init_module" and "finit_module" system calls with the following command: - -$ sudo auditctl -l | grep init_module - --a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng --a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng - -If both the "b32" and "b64" audit rules are not defined for the "delete_module" system call, or any of the lines returned are commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654085RHEL 9 must audit all uses of the chage command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000468-GPOS-00212, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "chage" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=unset -k privileged-chage - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "chage" command with the following command: - -$ sudo auditctl -l | grep chage - --a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=unset -k privileged-chage - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654090RHEL 9 must audit all uses of the chsh command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "chsh" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "chsh" command with the following command: - -$ sudo auditctl -l | grep chsh - --a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654095RHEL 9 must audit all uses of the crontab command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "crontab" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=unset -k privileged-crontab - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "crontab" command with the following command: - -$ sudo auditctl -l | grep crontab - --a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=unset -k privileged-crontab - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654100RHEL 9 must audit all uses of the gpasswd command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "gpasswd" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-gpasswd - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "gpasswd" command with the following command: - -$ sudo auditctl -l | grep gpasswd - --a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-gpasswd - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654105RHEL 9 must audit all uses of the kmod command.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000471-GPOS-00216, SRG-OS-000477-GPOS-00222</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "kmod" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=unset -k modules - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "kmod" command with the following command: - -$ sudo auditctl -l | grep kmod - --a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=unset -k modules - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654110RHEL 9 must audit all uses of the newgrp command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "newgrp" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "newgrp" command with the following command: - -$ sudo auditctl -l | grep newgrp - --a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654115RHEL 9 must audit all uses of the pam_timestamp_check command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "pam_timestamp_check" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=unset -k privileged-pam_timestamp_check - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "pam_timestamp_check" command with the following command: - -$ sudo auditctl -l | grep timestamp - --a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=unset -k privileged-pam_timestamp_check - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654120RHEL 9 must audit all uses of the passwd command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "passwd" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-passwd - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/gshadow" with the following command: - -$ sudo auditctl -l | egrep '(/usr/bin/passwd)' - --a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-passwd - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654125RHEL 9 must audit all uses of the postdrop command.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "postdrop" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "postdrop" command with the following command: - -$ sudo auditctl -l | grep postdrop - --a always,exit -F path=/usr/sbin/postdrop -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654130RHEL 9 must audit all uses of the postqueue command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "postqueue" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "postqueue" command with the following command: - -$ sudo auditctl -l | grep postqueue - --a always,exit -F path=/usr/sbin/postqueue -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654135RHEL 9 must audit all uses of the ssh-agent command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "ssh-agent" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "ssh-agent" command with the following command: - -$ sudo auditctl -l | grep ssh-agent - --a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654140RHEL 9 must audit all uses of the ssh-keysign command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "ssh-keysign" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "ssh-keysign" command with the following command: - -$ sudo auditctl -l | grep ssh-keysign - --a always,exit -F path=/usr/libexec/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654145RHEL 9 must audit all uses of the su command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "su" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset -k privileged-priv_change - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "su" command with the following command: - -$ sudo auditctl -l | grep /usr/bin/su - --a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=unset -k privileged-priv_change - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654150RHEL 9 must audit all uses of the sudo command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "sudo" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "sudo" command with the following command: - -$ sudo auditctl -l | grep /usr/bin/sudo - --a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654155RHEL 9 must audit all uses of the sudoedit command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "sudoedit" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "sudoedit" command with the following command: - -$ sudo auditctl -l | grep /usr/bin/sudoedit - --a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654160RHEL 9 must audit all uses of the unix_chkpwd command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "unix_chkpwd" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "unix_chkpwd" command with the following command: - -$ sudo auditctl -l | grep unix_chkpwd - --a always,exit -F path=/usr/sbin/unix_chkpwd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654165RHEL 9 must audit all uses of the unix_update command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000064-GPOS-00033, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "unix_update" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/unix_update -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "unix_update" command with the following command: - -$ sudo auditctl -l | grep unix_update - --a always,exit -F path=/usr/sbin/unix_update -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654170RHEL 9 must audit all uses of the userhelper command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "userhelper" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "userhelper" command with the following command: - -$ sudo auditctl -l | grep userhelper - --a always,exit -F path=/usr/sbin/userhelper -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654175RHEL 9 must audit all uses of the usermod command.<VulnDiscussion>Without generating audit record specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000466-GPOS-00210</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "usermod " command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F auid!=unset -k privileged-usermod - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "usermod" command with the following command: - -$ sudo auditctl -l | grep usermod - --a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F auid!=unset -k privileged-usermod - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654180RHEL 9 must audit all uses of the mount command.<VulnDiscussion>Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Audit records can be generated from various components within the information system (e.g., module or policy filter). - -When a user logs on, the auid is set to the uid of the account that is being authenticated. Daemons are not user sessions and have the loginuid set to -1. The auid representation is an unsigned 32-bit integer, which equals 4294967295. The audit system interprets -1, 4294967295, and "unset" in the same way. - -The system call rules are loaded into a matching engine that intercepts each system call made by all programs on the system. Therefore, it is very important to use system call rules only when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance can be helped, however, by combining system calls into one rule whenever possible. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records upon successful/unsuccessful attempts to use the "mount" command by adding or updating the following rule in "/etc/audit/rules.d/audit.rules": - --a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "mount" command with the following command: - -$ sudo auditctl -l | grep /usr/bin/mount - --a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000477-GPOS-00222<GroupDescription></GroupDescription>RHEL-09-654185Successful/unsuccessful uses of the init command in RHEL 9 must generate an audit record.<VulnDiscussion>Misuse of the init command may cause availability issues for the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000172Configure the audit system to generate an audit event for any successful/unsuccessful uses of the "init" command by adding or updating the following rule in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F path=/usr/sbin/init -F perm=x -F auid>=1000 -F auid!=unset -k privileged-init - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "init" command with the following command: - -$ sudo auditctl -l | grep init - --a always,exit -F path=/usr/sbin/init -F perm=x -F auid>=1000 -F auid!=unset -k privileged-init - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000477-GPOS-00222<GroupDescription></GroupDescription>RHEL-09-654190Successful/unsuccessful uses of the poweroff command in RHEL 9 must generate an audit record.<VulnDiscussion>Misuse of the poweroff command may cause availability issues for the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000172Configure the audit system to generate an audit event for any successful/unsuccessful uses of the "poweroff" command by adding or updating the following rule in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F path=/usr/sbin/poweroff -F perm=x -F auid>=1000 -F auid!=unset -k privileged-poweroff - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "poweroff" command with the following command: - -$ sudo auditctl -l | grep poweroff - --a always,exit -F path=/usr/sbin/poweroff -F perm=x -F auid>=1000 -F auid!=unset -k privileged-poweroff - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000477-GPOS-00222<GroupDescription></GroupDescription>RHEL-09-654195Successful/unsuccessful uses of the reboot command in RHEL 9 must generate an audit record.<VulnDiscussion>Misuse of the reboot command may cause availability issues for the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000172Configure the audit system to generate an audit event for any successful/unsuccessful uses of the "reboot" command by adding or updating the following rule in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F path=/usr/sbin/reboot -F perm=x -F auid>=1000 -F auid!=unset -k privileged-reboot - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "reboot" command with the following command: - -$ sudo auditctl -l | grep reboot - --a always,exit -F path=/usr/sbin/reboot -F perm=x -F auid>=1000 -F auid!=unset -k privileged-reboot - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000477-GPOS-00222<GroupDescription></GroupDescription>RHEL-09-654200Successful/unsuccessful uses of the shutdown command in RHEL 9 must generate an audit record.<VulnDiscussion>Misuse of the shutdown command may cause availability issues for the system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000172Configure the audit system to generate an audit event for any successful/unsuccessful uses of the "shutdown" command by adding or updating the following rule in the "/etc/audit/rules.d/audit.rules" file: - --a always,exit -F path=/usr/sbin/shutdown -F perm=x -F auid>=1000 -F auid!=unset -k privileged-shutdown - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 is configured to audit the execution of the "shutdown" command with the following command: - -$ sudo auditctl -l | grep shutdown - --a always,exit -F path=/usr/sbin/shutdown -F perm=x -F auid>=1000 -F auid!=unset -k privileged-shutdown - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654205Successful/unsuccessful uses of the umount system call in RHEL 9 must generate an audit record.<VulnDiscussion>The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000169CCI-000172CCI-002884Configure the audit system to generate an audit event for any successful/unsuccessful use of the "umount" system call by adding or updating the following rules in "/etc/audit/audit.rules" and adding the following rules to "/etc/audit/rules.d/perm_mod.rules" or updating the existing rules in files in the "/etc/audit/rules.d/" directory: - --a always,exit -F arch=b32 -S umount -F auid>=1000 -F auid!=unset -k privileged-umount - -The audit daemon must be restarted for the changes to take effect.Verify that RHEL 9 generates an audit record for all uses of the "umount" and system call with the following command: - -$ sudo grep "umount" /etc/audit/audit.* - -If the system is configured to audit this activity, it will return a line like the following: - --a always,exit -F arch=b32 -S umount -F auid>=1000 -F auid!=unset -k privileged-umount - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654210Successful/unsuccessful uses of the umount2 system call in RHEL 9 must generate an audit record.<VulnDiscussion>The changing of file permissions could indicate that a user is attempting to gain access to information that would otherwise be disallowed. Auditing DAC modifications can facilitate the identification of patterns of abuse among both authorized and unauthorized users. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000169CCI-000172CCI-002884Configure the audit system to generate an audit event for any successful/unsuccessful use of the "umount2" system call by adding or updating the following rules in "/etc/audit/audit.rules" and adding the following rules to "/etc/audit/rules.d/perm_mod.rules" or updating the existing rules in files in the "/etc/audit/rules.d/" directory: - --a always,exit -F arch=b32 -S umount2 -F auid>=1000 -F auid!=unset -k perm_mod --a always,exit -F arch=b64 -S umount2 -F auid>=1000 -F auid!=unset -k perm_mod - -The audit daemon must be restarted for the changes to take effect.To determine if the system is configured to audit calls to the umount2 system call, run the following command: - -$ sudo grep "umount2" /etc/audit/audit.* - -If the system is configured to audit this activity, it will return a line. - -If no line is returned, this is a finding.SRG-OS-000004-GPOS-00004<GroupDescription></GroupDescription>RHEL-09-654215RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/sudoers.<VulnDiscussion>The actions taken by system administrators must be audited to keep a record of what was executed on the system, as well as for accountability purposes. Editing the sudoers file may be sign of an attacker trying to establish persistent methods to a system, auditing the editing of the sudoers files mitigates this risk. - -Satisfies: SRG-OS-000004-GPOS-00004, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000304-GPOS-00121, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000470-GPOS-00214, SRG-OS-000471-GPOS-00215, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000466-GPOS-00210, SRG-OS-000476-GPOS-00221</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000018CCI-000130CCI-000135CCI-000169CCI-000172CCI-001403CCI-001404CCI-001405CCI-002130CCI-002132CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/etc/sudoers". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /etc/sudoers -p wa -k identity - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/sudoers" with the following command: - -$ sudo auditctl -l | grep /etc/sudoers - --w /etc/sudoers -p wa -k identity - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000004-GPOS-00004<GroupDescription></GroupDescription>RHEL-09-654220RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/sudoers.d/ directory.<VulnDiscussion>The actions taken by system administrators must be audited to keep a record of what was executed on the system, as well as for accountability purposes. Editing the sudoers file may be sign of an attacker trying to establish persistent methods to a system, auditing the editing of the sudoers files mitigates this risk. - -Satisfies: SRG-OS-000004-GPOS-00004, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000304-GPOS-00121, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000470-GPOS-00214, SRG-OS-000471-GPOS-00215, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000466-GPOS-00210, SRG-OS-000476-GPOS-00221</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000018CCI-000130CCI-000135CCI-000169CCI-000172CCI-001403CCI-001404CCI-001405CCI-002130CCI-002132CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/etc/sudoers.d/". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /etc/sudoers.d/ -p wa -k identity - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/sudoers.d/" with the following command: - -$ sudo auditctl -l | grep /etc/sudoers.d - --w /etc/sudoers.d/ -p wa -k identity - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000004-GPOS-00004<GroupDescription></GroupDescription>RHEL-09-654225RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/group.<VulnDiscussion>In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications must be investigated for legitimacy. - -Satisfies: SRG-OS-000004-GPOS-00004, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000304-GPOS-00121, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000470-GPOS-00214, SRG-OS-000471-GPOS-00215, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000466-GPOS-00210, SRG-OS-000476-GPOS-00221</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000018CCI-000130CCI-000135CCI-000169CCI-000172CCI-001403CCI-001404CCI-001405CCI-002130CCI-002132CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/etc/group". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /etc/group -p wa -k identity - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/group" with the following command: - -$ sudo auditctl -l | egrep '(/etc/group)' - --w /etc/group -p wa -k identity - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000004-GPOS-00004<GroupDescription></GroupDescription>RHEL-09-654230RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/gshadow.<VulnDiscussion>In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -Satisfies: SRG-OS-000004-GPOS-00004, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000304-GPOS-00121, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000470-GPOS-00214, SRG-OS-000471-GPOS-00215, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000466-GPOS-00210, SRG-OS-000476-GPOS-00221</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000018CCI-000130CCI-000135CCI-000169CCI-000172CCI-001403CCI-001404CCI-001405CCI-002130CCI-002132CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/etc/gshadow". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /etc/gshadow -p wa -k identity - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/gshadow" with the following command: - -$ sudo auditctl -l | egrep '(/etc/gshadow)' - --w /etc/gshadow -p wa -k identity - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000004-GPOS-00004<GroupDescription></GroupDescription>RHEL-09-654235RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/opasswd.<VulnDiscussion>In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -Satisfies: SRG-OS-000004-GPOS-00004, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000304-GPOS-00121, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000470-GPOS-00214, SRG-OS-000471-GPOS-00215, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000466-GPOS-00210, SRG-OS-000476-GPOS-00221</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000018CCI-000130CCI-000135CCI-000169CCI-000172CCI-001403CCI-001404CCI-001405CCI-002130CCI-002132CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/etc/security/opasswd". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /etc/security/opasswd -p wa -k identity - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/security/opasswd" with the following command: - -$ sudo auditctl -l | egrep '(/etc/security/opasswd)' - --w /etc/security/opasswd -p wa -k identity - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000004-GPOS-00004<GroupDescription></GroupDescription>RHEL-09-654240RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/passwd.<VulnDiscussion>In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -Satisfies: SRG-OS-000004-GPOS-00004, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000304-GPOS-00121, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000470-GPOS-00214, SRG-OS-000471-GPOS-00215, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000466-GPOS-00210, SRG-OS-000476-GPOS-00221, SRG-OS-000274-GPOS-00104, SRG-OS-000275-GPOS-00105, SRG-OS-000276-GPOS-00106, SRG-OS-000277-GPOS-00107</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000018CCI-000130CCI-000135CCI-000169CCI-000172CCI-001403CCI-001404CCI-001405CCI-001683CCI-001684CCI-001685CCI-001686CCI-002130CCI-002132CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/etc/passwd". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /etc/passwd -p wa -k identity - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/passwd" with the following command: - -$ sudo auditctl -l | egrep '(/etc/passwd)' - --w /etc/passwd -p wa -k identity - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000004-GPOS-00004<GroupDescription></GroupDescription>RHEL-09-654245RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/shadow.<VulnDiscussion>In addition to auditing new user and group accounts, these watches will alert the system administrator(s) to any modifications. Any unexpected users, groups, or modifications should be investigated for legitimacy. - -Satisfies: SRG-OS-000004-GPOS-00004, SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000304-GPOS-00121, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000470-GPOS-00214, SRG-OS-000471-GPOS-00215, SRG-OS-000239-GPOS-00089, SRG-OS-000240-GPOS-00090, SRG-OS-000241-GPOS-00091, SRG-OS-000303-GPOS-00120, SRG-OS-000466-GPOS-00210, SRG-OS-000476-GPOS-00221</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000018CCI-000130CCI-000135CCI-000169CCI-000172CCI-001403CCI-001404CCI-001405CCI-002130CCI-002132CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/etc/shadow". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /etc/shadow -p wa -k identity - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/etc/passwd with the following command: - -$ sudo auditctl -l | egrep '(/etc/shadow)' - --w /etc/shadow -p wa -k identity - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000392-GPOS-00172<GroupDescription></GroupDescription>RHEL-09-654250RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/faillock.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Satisfies: SRG-OS-000392-GPOS-00172, SRG-OS-000470-GPOS-00214, SRG-OS-000473-GPOS-00218</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000172CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/var/log/faillock". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /var/log/faillock -p wa -k logins - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/var/log/faillock" with the following command: - -$ sudo auditctl -l | grep /var/log/faillock - --w /var/log/faillock -p wa -k logins - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000037-GPOS-00015<GroupDescription></GroupDescription>RHEL-09-654255RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/lastlog.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Satisfies: SRG-OS-000037-GPOS-00015, SRG-OS-000042-GPOS-00020, SRG-OS-000062-GPOS-00031, SRG-OS-000392-GPOS-00172, SRG-OS-000462-GPOS-00206, SRG-OS-000471-GPOS-00215, SRG-OS-000473-GPOS-00218, SRG-OS-000470-GPOS-00214</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000130CCI-000135CCI-000169CCI-000172CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/var/log/lastlog". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /var/log/lastlog -p wa -k logins - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/var/log/lastlog" with the following command: - -$ sudo auditctl -l | grep /var/log/lastlog - --w /var/log/lastlog -p wa -k logins - -If the command does not return a line, or the line is commented out, this is a finding.SRG-OS-000392-GPOS-00172<GroupDescription></GroupDescription>RHEL-09-654260RHEL 9 must generate audit records for all account creations, modifications, disabling, and termination events that affect /var/log/tallylog.<VulnDiscussion>Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. - -Satisfies: SRG-OS-000392-GPOS-00172, SRG-OS-000470-GPOS-00214, SRG-OS-000473-GPOS-00218</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000172CCI-002884Configure RHEL 9 to generate audit records for all account creations, modifications, disabling, and termination events that affect "/var/log/tallylog". - -Add or update the following file system rule to "/etc/audit/rules.d/audit.rules": - --w /var/log/tallylog -p wa -k logins - -The audit daemon must be restarted for the changes to take effect.Verify RHEL 9 generates audit records for all account creations, modifications, disabling, and termination events that affect "/var/log/tallylog" with the following command: - -$ sudo auditctl -l | grep /var/log/tallylog - --w /var/log/tallylog -p wa -k logins - -If the command does not return a line, or the line is commented out, is a finding.SRG-OS-000046-GPOS-00022<GroupDescription></GroupDescription>RHEL-09-654265RHEL 9 must take appropriate action when a critical audit processing failure occurs.<VulnDiscussion>It is critical for the appropriate personnel to be aware if a system is at risk of failing to process audit logs as required. Without this notification, the security personnel may be unaware of an impending failure of the audit capability, and system operation may be adversely affected. - -Audit processing failures include software/hardware errors, failures in the audit capturing mechanisms, and audit storage capacity being reached or exceeded. - -Satisfies: SRG-OS-000046-GPOS-00022, SRG-OS-000047-GPOS-00023</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000139CCI-000140Configure RHEL 9 to shut down when auditing failures occur. - -Add the following line to the bottom of the /etc/audit/audit.rules file: - --f 2Verify the audit service is configured to panic on a critical error with the following command: - -$ sudo grep "\-f" /etc/audit/audit.rules - --f 2 - -If the value for "-f" is not "2", and availability is not documented as an overriding concern, this is a finding.SRG-OS-000462-GPOS-00206<GroupDescription></GroupDescription>RHEL-09-654270RHEL 9 audit system must protect logon UIDs from unauthorized change.<VulnDiscussion>If modification of login user identifiers (UIDs) is not prevented, they can be changed by nonprivileged users and make auditing complicated or impossible. - -Satisfies: SRG-OS-000462-GPOS-00206, SRG-OS-000475-GPOS-00220, SRG-OS-000057-GPOS-00027, SRG-OS-000058-GPOS-00028, SRG-OS-000059-GPOS-00029</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000162CCI-000163CCI-000164CCI-000172Configure RHEL 9 auditing to prevent modification of login UIDs once they are set by adding the following line to /etc/audit/rules.d/audit.rules: - ---loginuid-immutable - -The audit daemon must be restarted for the changes to take effect.Verify the audit system prevents unauthorized changes to logon UIDs with the following command: - -$ sudo grep -i immutable /etc/audit/audit.rules - ---loginuid-immutable - -If the "--loginuid-immutable" option is not returned in the "/etc/audit/audit.rules", or the line is commented out, this is a finding.SRG-OS-000057-GPOS-00027<GroupDescription></GroupDescription>RHEL-09-654275RHEL 9 audit system must protect auditing rules from unauthorized change.<VulnDiscussion>Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. - -Audit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit RHEL 9 system activity. - -In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. A system reboot would be noticeable, and a system administrator could then investigate the unauthorized changes. - -Satisfies: SRG-OS-000057-GPOS-00027, SRG-OS-000058-GPOS-00028, SRG-OS-000059-GPOS-00029</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000162CCI-000163CCI-000164Configure the audit system to set the audit rules to be immutable by adding the following line to end of "/etc/audit/rules.d/audit.rules" - --e 2 - -The audit daemon must be restarted for the changes to take effect.Verify the audit system prevents unauthorized changes with the following command: - -$ sudo grep "^\s*[^#]" /etc/audit/audit.rules | tail -1 - --e 2 - -If the audit system is not set to be immutable by adding the "-e 2" option to the end of "/etc/audit/audit.rules", this is a finding.SRG-OS-000033-GPOS-00014<GroupDescription></GroupDescription>RHEL-09-671010RHEL 9 must enable FIPS mode.<VulnDiscussion>Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated. This includes NIST FIPS-validated cryptography for the following: Provisioning digital signatures, generating cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards. - -Satisfies: SRG-OS-000033-GPOS-00014, SRG-OS-000125-GPOS-00065, SRG-OS-000396-GPOS-00176, SRG-OS-000423-GPOS-00187, SRG-OS-000478-GPOS-00223</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000068CCI-000877CCI-002418CCI-002450Configure the operating system to implement FIPS mode with the following command - -$ sudo fips-mode-setup --enable - -Reboot the system for the changes to take effect.Verify that RHEL 9 is in FIPS mode with the following command: - -$ sudo fips-mode-setup --check - -FIPS mode is enabled. - -If FIPS mode is not enabled, this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-09-671015RHEL 9 must employ FIPS 140-3 approved cryptographic hashing algorithms for all stored passwords.<VulnDiscussion>The system must use a strong hashing algorithm to store the password. - -Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. - -Satisfies: SRG-OS-000073-GPOS-00041, SRG-OS-000120-GPOS-00061</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000196CCI-000803Lock all interactive user accounts not using SHA-512 hashing until the passwords can be regenerated with SHA-512.Verify that the interactive user account passwords are using a strong password hash with the following command: - -$ sudo cut -d: -f2 /etc/shadow - -$6$kcOnRq/5$NUEYPuyL.wghQwWssXRcLRFiiru7f5JPV6GaJhNC2aK5F3PZpE/BCCtwrxRc/AInKMNX3CdMw11m9STiql12f/ - -Password hashes "!" or "*" indicate inactive accounts not available for logon and are not evaluated. - -If any interactive user password hash does not begin with "$6", this is a finding.SRG-OS-000033-GPOS-00014<GroupDescription></GroupDescription>RHEL-09-671020RHEL 9 IP tunnels must use FIPS 140-2/140-3 approved cryptographic algorithms.<VulnDiscussion>Overriding the system crypto policy makes the behavior of the Libreswan service violate expectations, and makes system configuration more fragmented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000068Configure Libreswan to use the system cryptographic policy. - -Add the following line to "/etc/ipsec.conf": - -include /etc/crypto-policies/back-ends/libreswan.configVerify that the IPsec service uses the system crypto policy with the following command: - -Note: If the ipsec service is not installed, this requirement is Not Applicable. - -$ sudo grep include /etc/ipsec.conf /etc/ipsec.d/*.conf - -/etc/ipsec.conf:include /etc/crypto-policies/back-ends/libreswan.config - -If the ipsec configuration file does not contain "include /etc/crypto-policies/back-ends/libreswan.config", this is a finding.SRG-OS-000073-GPOS-00041<GroupDescription></GroupDescription>RHEL-09-671025RHEL 9 pam_unix.so module must be configured in the password-auth file to use a FIPS 140-3 approved cryptographic hashing algorithm for system authentication.<VulnDiscussion>Unapproved mechanisms that are used for authentication to the cryptographic module are not verified and; therefore, cannot be relied upon to provide confidentiality or integrity, and DOD data may be compromised. - -RHEL 9 systems utilizing encryption are required to use FIPS-compliant mechanisms for authenticating to cryptographic modules. - -FIPS 140-3 is the current standard for validating that mechanisms used to access cryptographic modules utilize authentication that meets DOD requirements. This allows for Security Levels 1, 2, 3, or 4 for use on a general-purpose computing system.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000196Configure RHEL 9 to use a FIPS 140-3 approved cryptographic hashing algorithm for system authentication. - -Edit/modify the following line in the "/etc/pam.d/password-auth" file to include the sha512 option for pam_unix.so: - -password sufficient pam_unix.so sha512Verify that the pam_unix.so module is configured to use sha512 in /etc/pam.d/password-auth with the following command: - -$ grep "^password.*pam_unix.so.*sha512" /etc/pam.d/password-auth - -password sufficient pam_unix.so sha512 - -If "sha512" is missing, or the line is commented out, this is a finding.SRG-OS-000396-GPOS-00176<GroupDescription></GroupDescription>RHEL-09-672010RHEL 9 must have the crypto-policies package installed.<VulnDiscussion>Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. - -Satisfies: SRG-OS-000396-GPOS-00176, SRG-OS-000393-GPOS-00173, SRG-OS-000394-GPOS-00174</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002450CCI-002890CCI-003123Install the crypto-policies package (if the package is not already installed) with the following command: - -$ sudo dnf install crypto-policiesVerify that RHEL 9 crypto-policies package is installed with the following command: - -$ sudo dnf list --installed crypto-policies - -Example output: - -crypto-policies.noarch 20220223-1.git5203b41.el9_0.1 - -If the "crypto-policies" package is not installed, this is a finding.SRG-OS-000478-GPOS-00223<GroupDescription></GroupDescription>RHEL-09-672015RHEL 9 crypto policy files must match files shipped with the operating system.<VulnDiscussion>The RHEL 9 package "crypto-policies" defines the cryptography policies for the system. - -If the files are changed from those shipped with the operating system, it may be possible for RHEL 9 to use cryptographic functions that are not FIPS 140-3 approved. - -Satisfies: SRG-OS-000478-GPOS-00223, SRG-OS-000396-GPOS-00176</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002450Reinstall the crypto-policies package to remove any modifications. - -$ sudo dnf reinstall crypto-policiesVerify that the RHEL 9 package "crypto-policies" has not been modified with the following command: - -$ rpm -V crypto-policies - -If the command has any output, this is a finding.SRG-OS-000396-GPOS-00176<GroupDescription></GroupDescription>RHEL-09-672020RHEL 9 crypto policy must not be overridden.<VulnDiscussion>Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. - -Satisfies: SRG-OS-000396-GPOS-00176, SRG-OS-000393-GPOS-00173, SRG-OS-000394-GPOS-00174</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002450CCI-002890CCI-003123Configure RHEL 9 to FIPS crypto policy. - -$ sudo ln -s /usr/share/crypto-policies/FIPS/<service>.txt /etc/crypto-policies/back-ends/<service>.conf - -Replace <service> with every service that is not set to FIPS. - -The system must be rebooted to make the changes to take effect.Verify that RHEL 9 custom crypto policies are loaded correctly. - -List all of the crypto backends configured on the system. - -$ ls -l /etc/crypto-policies/back-ends/ -lrwxrwxrwx. 1 root root 40 Oct 7 08:44 bind.config -> /usr/share/crypto-policies/FIPS/bind.txt -lrwxrwxrwx. 1 root root 42 Oct 7 08:44 gnutls.config -> /usr/share/crypto-policies/FIPS/gnutls.txt -lrwxrwxrwx. 1 root root 40 Oct 7 08:44 java.config -> /usr/share/crypto-policies/FIPS/java.txt -lrwxrwxrwx. 1 root root 46 Oct 7 08:44 javasystem.config -> /usr/share/crypto-policies/FIPS/javasystem.txt -lrwxrwxrwx. 1 root root 40 Oct 7 08:44 krb5.config -> /usr/share/crypto-policies/FIPS/krb5.txt -lrwxrwxrwx. 1 root root 45 Oct 7 08:44 libreswan.config -> /usr/share/crypto-policies/FIPS/libreswan.txt -lrwxrwxrwx. 1 root root 42 Oct 7 08:44 libssh.config -> /usr/share/crypto-policies/FIPS/libssh.txt -lrwxrwxrwx. 1 root root 39 Oct 7 08:44 nss.config -> /usr/share/crypto-policies/FIPS/nss.txt -lrwxrwxrwx. 1 root root 43 Oct 7 08:44 openssh.config -> /usr/share/crypto-policies/FIPS/openssh.txt -lrwxrwxrwx. 1 root root 49 Oct 7 08:44 opensshserver.config -> /usr/share/crypto-policies/FIPS/opensshserver.txt -lrwxrwxrwx. 1 root root 46 Oct 7 08:44 opensslcnf.config -> /usr/share/crypto-policies/FIPS/opensslcnf.txt -lrwxrwxrwx. 1 root root 43 Oct 7 08:44 openssl.config -> /usr/share/crypto-policies/FIPS/openssl.txt - -If the paths do not point the respective files under /usr/share/crypto-policies/FIPS path, this is a finding.SRG-OS-000120-GPOS-00061<GroupDescription></GroupDescription>RHEL-09-672025RHEL 9 must use mechanisms meeting the requirements of applicable federal laws, executive orders, directives, policies, regulations, standards, and guidance for authentication to a cryptographic module.<VulnDiscussion>Overriding the system crypto policy makes the behavior of Kerberos violate expectations, and makes system configuration more fragmented.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-000803Configure Kerberos to use system crypto policy. - -Create a symlink pointing to system crypto policy in the Kerberos configuration using the following command: - -$ sudo ln -s /etc/crypto-policies/back-ends/krb5.config /usr/share/crypto-policies/FIPS/krb5.txtVerify that the symlink exists and targets the correct Kerberos crypto policy, with the following command: - -file /etc/crypto-policies/back-ends/krb5.config - -If command output shows the following line, Kerberos is configured to use the system-wide crypto policy: - -/etc/crypto-policies/back-ends/krb5.config: symbolic link to /usr/share/crypto-policies/FIPS/krb5.txt - -If the symlink does not exist or points to a different target, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-672030RHEL 9 must implement DOD-approved TLS encryption in the GnuTLS package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Transport Layer Security (TLS) encryption is a required security setting as a number of known vulnerabilities have been reported against Secure Sockets Layer (SSL) and earlier versions of TLS. Encryption of private information is essential to ensuring data confidentiality. If private information is not encrypted, it can be intercepted and easily read by an unauthorized party. SQL Server must use a minimum of FIPS 140-3 approved TLS version 1.2, and all non-FIPS-approved SSL and TLS versions must be disabled. NIST 800-53 specifies the preferred configurations for government systems. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -Satisfies: SRG-OS-000250-GPOS-00093, SRG-OS-000423-GPOS-00187</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453CCI-002418Configure the RHEL 9 GnuTLS library to use only NIST-approved encryption with the following steps to enable FIPS mode: - -$ sudo fips-mode-setup --enable - -A reboot is required for the changes to take effect.Verify if GnuTLS uses defined DOD-approved TLS Crypto Policy with the following command: - - $ update-crypto-policies --show -FIPS - -If the system wide crypto policy is not set to "FIPS", this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-672035RHEL 9 must implement DOD-approved encryption in the OpenSSL package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Remote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config file.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453Configure the RHEL 9 OpenSSL library to use the system cryptographic policy. - -Edit the "/etc/pki/tls/openssl.cnf" and add or modify the following line: - -.include = /etc/crypto-policies/back-ends/opensslcnf.configVerify that RHEL 9 OpenSSL library is configured to use only ciphers employing FIPS 140-3 approved algorithms with the following command: - -$ sudo grep -i opensslcnf.config /etc/pki/tls/openssl.cnf - -.include = /etc/crypto-policies/back-ends/opensslcnf.config - -If the "opensslcnf.config" is not defined in the "/etc/pki/tls/openssl.cnf" file, this is a finding.SRG-OS-000250-GPOS-00093<GroupDescription></GroupDescription>RHEL-09-672040RHEL 9 must implement DOD-approved TLS encryption in the OpenSSL package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Remote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/openssl.config file.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-001453Configure the RHEL 9 OpenSSL library to use only DOD-approved TLS encryption by editing the following line in the "/etc/crypto-policies/back-ends/opensslcnf.config" file: - -TLS.MinProtocol = TLSv1.2 -DTLS.MinProtocol = DTLSv1.2 - -A reboot is required for the changes to take effect.Verify that RHEL 9 OpenSSL library is configured to use TLS 1.2 encryption or stronger with following command: - -$ grep -i minprotocol /etc/crypto-policies/back-ends/opensslcnf.config - -TLS.MinProtocol = TLSv1.2 -DTLS.MinProtocol = DTLSv1.2 - -If the "TLS.MinProtocol" is set to anything older than "TLSv1.2" or the "DTLS.MinProtocol" is set to anything older than "DTLSv1.2", this is a finding.SRG-OS-000396-GPOS-00176<GroupDescription></GroupDescription>RHEL-09-672045RHEL 9 must implement a system-wide encryption policy.<VulnDiscussion>Centralized cryptographic policies simplify applying secure ciphers across an operating system and the applications that run on that operating system. Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. - -Satisfies: SRG-OS-000396-GPOS-00176, SRG-OS-000393-GPOS-00173, SRG-OS-000394-GPOS-00174</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002450CCI-002890CCI-003123Configure the operating system to implement FIPS mode with the following command - -$ sudo fips-mode-setup --enable - -Reboot the system for the changes to take effect.Verify that the RHEL 9 cryptography policy has been configured correctly with the following commands: - -$ sudo update-crypto-policies --show - -FIPS - -If the cryptography is not set to "FIPS" and is not applied, this is a finding. - -$ sudo update-crypto-policies --check - -The configured policy matches the generated policy - -If the command does not return "The configured policy matches the generated policy", this is a finding.SRG-OS-000423-GPOS-00187<GroupDescription></GroupDescription>RHEL-09-672050RHEL 9 must implement DOD-approved encryption in the bind package.<VulnDiscussion>Without cryptographic integrity protections, information can be altered by unauthorized users without detection. - -Cryptographic mechanisms used for protecting the integrity of information include, for example, signed hash functions using asymmetric cryptography enabling distribution of the public key to verify the hash information while maintaining the confidentiality of the secret key used to generate the hash. - -RHEL 9 incorporates system-wide crypto policies by default. The employed algorithms can be viewed in the /etc/crypto-policies/back-ends/ directory. - -Satisfies: SRG-OS-000423-GPOS-00187, SRG-OS-000426-GPOS-00190</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>DPMS Target Red Hat Enterprise Linux 9DISADPMS TargetRed Hat Enterprise Linux 95551CCI-002418CCI-002422Configure BIND to use the system crypto policy. - -Add the following line to the "options" section in "/etc/named.conf": - -include "/etc/crypto-policies/back-ends/bind.config";Verify that BIND uses the system crypto policy with the following command: - -Note: If the "bind" package is not installed, this requirement is Not Applicable. - -$ sudo grep include /etc/named.conf - -include "/etc/crypto-policies/back-ends/bind.config";' - -If BIND is installed and the BIND config file doesn't contain the include "/etc/crypto-policies/back-ends/bind.config" directive, or the line is commented out, this is a finding. \ No newline at end of file diff --git a/spec/ansible/disa/callback_plugins/stig_xml.py b/spec/ansible/disa/roles/rhel9STIG/callback_plugins/stig_xml.py similarity index 100% rename from spec/ansible/disa/callback_plugins/stig_xml.py rename to spec/ansible/disa/roles/rhel9STIG/callback_plugins/stig_xml.py diff --git a/spec/ansible/disa/defaults/main.yml b/spec/ansible/disa/roles/rhel9STIG/defaults/main.yml similarity index 100% rename from spec/ansible/disa/defaults/main.yml rename to spec/ansible/disa/roles/rhel9STIG/defaults/main.yml diff --git a/spec/ansible/disa/handlers/main.yml b/spec/ansible/disa/roles/rhel9STIG/handlers/main.yml similarity index 100% rename from spec/ansible/disa/handlers/main.yml rename to spec/ansible/disa/roles/rhel9STIG/handlers/main.yml diff --git a/spec/ansible/disa/tasks/main.yml b/spec/ansible/disa/roles/rhel9STIG/tasks/main.yml similarity index 100% rename from spec/ansible/disa/tasks/main.yml rename to spec/ansible/disa/roles/rhel9STIG/tasks/main.yml diff --git a/spec/ansible/disa/site.yml b/spec/ansible/disa/site.yml index 37a9921..d847b21 100644 --- a/spec/ansible/disa/site.yml +++ b/spec/ansible/disa/site.yml @@ -2,3 +2,17 @@ gather_facts: no roles: - rhel9STIG + vars: # turn off all tasks that would trigger the reboot handler to avoid pipeline issues + rhel9STIG_stigrule_257804_Manage: false + rhel9STIG_stigrule_257805_Manage: false + rhel9STIG_stigrule_257806_Manage: false + rhel9STIG_stigrule_257807_Manage: false + rhel9STIG_stigrule_257808_Manage: false + rhel9STIG_stigrule_257880_Manage: false + rhel9STIG_stigrule_257989_Manage: false + rhel9STIG_stigrule_258034_Manage: false + rhel9STIG_stigrule_258034_Manage: false + rhel9STIG_stigrule_258039_Manage: false + rhel9STIG_stigrule_258078_Manage: false + rhel9STIG_stigrule_258079_Manage: false + rhel9STIG_stigrule_258240_Manage: false diff --git a/ubi9_hardened.threshold.yml b/ubi9_hardened.threshold.yml index 104a1c7..2258806 100644 --- a/ubi9_hardened.threshold.yml +++ b/ubi9_hardened.threshold.yml @@ -1,3 +1,3 @@ --- -error.total.max: 1 -compliance.min: 2 +error.total.max: 0 +compliance.min: 70 diff --git a/ubi9_vanilla.threshold.yml b/ubi9_vanilla.threshold.yml index 104a1c7..1ccd1ad 100644 --- a/ubi9_vanilla.threshold.yml +++ b/ubi9_vanilla.threshold.yml @@ -1,3 +1,3 @@ --- -error.total.max: 1 -compliance.min: 2 +error.total.max: 0 +compliance.min: 1